@Test public void should_honor_constructor_params() { //given String requestPath = UUID.randomUUID().toString(); String authorizationHeader = UUID.randomUUID().toString(); String message = UUID.randomUUID().toString(); //when Forbidden403Exception ex = new Forbidden403Exception(message, requestPath, authorizationHeader); //then assertThat(ex.getMessage(), is(message)); assertThat(ex.requestPath, is(requestPath)); assertThat(ex.authorizationHeader, is(authorizationHeader)); }
@Test public void should_handle_Forbidden403Exception() { verifyExceptionHandled(new Forbidden403Exception("foo", "/bar", "blah"), singletonError(testProjectApiErrors.getForbiddenApiError())); }