Search in sources :

Example 1 with UnexpectedMajorExceptionHandlingError

use of com.nike.backstopper.handler.UnexpectedMajorExceptionHandlingError in project riposte by Nike-Inc.

the class RiposteApiExceptionHandlerTest method maybeHandleErrorExplosionThrowsUnexpectedMajorErrorHandlingError.

// Note the difference between UnexpectedMajor**Exception**HandlingError and UnexpectedMajor**Error**HandlingError. I know, I know, confusing and annoying. Adapters can be like that.
@Test(expected = UnexpectedMajorErrorHandlingError.class)
public void maybeHandleErrorExplosionThrowsUnexpectedMajorErrorHandlingError() throws UnexpectedMajorExceptionHandlingError, UnexpectedMajorErrorHandlingError {
    UnexpectedMajorExceptionHandlingError innerExplosion = new UnexpectedMajorExceptionHandlingError("intentional kaboom", new Exception());
    doThrow(innerExplosion).when(adapterSpy).maybeHandleException(any(Throwable.class), any(RequestInfoForLogging.class));
    RequestInfo requestInfoMock = mock(RequestInfo.class);
    adapterSpy.maybeHandleError(new Exception(), requestInfoMock);
}
Also used : UnexpectedMajorExceptionHandlingError(com.nike.backstopper.handler.UnexpectedMajorExceptionHandlingError) RequestInfoForLogging(com.nike.backstopper.handler.RequestInfoForLogging) RequestInfo(com.nike.riposte.server.http.RequestInfo) Test(org.junit.Test)

Aggregations

RequestInfoForLogging (com.nike.backstopper.handler.RequestInfoForLogging)1 UnexpectedMajorExceptionHandlingError (com.nike.backstopper.handler.UnexpectedMajorExceptionHandlingError)1 RequestInfo (com.nike.riposte.server.http.RequestInfo)1 Test (org.junit.Test)1