use of com.newrelic.agent.errors.ReportableError in project newrelic-java-agent by newrelic.
the class SpanErrorBuilderTest method shouldOmitClassForNoticeErrorStringAPI.
@Test
public void shouldOmitClassForNoticeErrorStringAPI() {
when(mockAnalyzer.isReportable(anyInt(), ArgumentMatchers.<Throwable>any())).thenThrow(new AssertionError("should not have been called"));
when(mockAnalyzer.isReportable(anyInt())).thenReturn(false);
when(mockTracer.getException()).thenReturn(new ReportableError("will not be replaced"));
when(mockTracer.wasExceptionSetByAPI()).thenReturn(true);
when(mockReplacer.getMessage(ArgumentMatchers.<Throwable>any())).thenThrow(new AssertionError("should not have been called"));
SpanError target = new SpanErrorBuilder(mockAnalyzer, mockReplacer).buildSpanError(mockTracer, false, 400, "fine", null);
assertSpanError(target, null, null, "will not be replaced", false);
}
Aggregations