@Test public void should_honor_constructor_params() { //given String requestPath = UUID.randomUUID().toString(); String requestMethod = UUID.randomUUID().toString(); String message = UUID.randomUUID().toString(); //when MethodNotAllowed405Exception ex = new MethodNotAllowed405Exception(message, requestPath, requestMethod); //then assertThat(ex.getMessage(), is(message)); assertThat(ex.requestPath, is(requestPath)); assertThat(ex.requestMethod, is(requestMethod)); }
throw new MethodNotAllowed405Exception( "Found path match for incoming request, but no endpoint matched both path and HTTP method", requestInfo.getPath(), String.valueOf(requestInfo.getMethod()));
throw new MethodNotAllowed405Exception( "Found path match for incoming request, but no endpoint matched both path and HTTP method", requestInfo.getPath(), String.valueOf(requestInfo.getMethod()));
@Test public void shouldHandleMethodNotAllowed405Exception() { verifyExceptionHandled(new MethodNotAllowed405Exception("intentional boom", null, null), singletonError(testProjectApiErrors.getMethodNotAllowedApiError())); }