Search in sources :

Example 6 with ErrorCapture

use of co.elastic.apm.impl.error.ErrorCapture in project apm-agent-java by elastic.

the class BodyProcessorTest method processError.

private ErrorCapture processError() {
    final ErrorCapture error = new ErrorCapture();
    error.getContext().getRequest().withRawBody("foo");
    bodyProcessor.processBeforeReport(error);
    return error;
}
Also used : ErrorCapture(co.elastic.apm.impl.error.ErrorCapture)

Example 7 with ErrorCapture

use of co.elastic.apm.impl.error.ErrorCapture in project apm-agent-java by elastic.

the class BodyProcessorTest method processBeforeReport_Error_EventTypeOff.

@Test
void processBeforeReport_Error_EventTypeOff() {
    when(config.getCaptureBody()).thenReturn(WebConfiguration.EventType.OFF);
    final ErrorCapture error = processError();
    assertThat(error.getContext().getRequest().getBody()).isEqualTo("[REDACTED]");
}
Also used : ErrorCapture(co.elastic.apm.impl.error.ErrorCapture) Test(org.junit.jupiter.api.Test)

Aggregations

ErrorCapture (co.elastic.apm.impl.error.ErrorCapture)7 Test (org.junit.jupiter.api.Test)5 Transaction (co.elastic.apm.impl.transaction.Transaction)1