@Test
public void shouldGive400OnInvalidEnumConversion() throws IOException {

    FakeServletRequest request = new FakeServletRequest("POST", contextRoot, "/api", "/withEnum");
    request.setParameter("enumValue", "unknown");
    expectedLogEvents.expect(ApiControllerAction.class, Level.DEBUG,
            "While processing ServletHttpExchange[POST " + contextRoot + "/api/withEnum?enumValue=unknown] arguments to " +
            "ApiControllerMethodAction{POST /withEnum => ControllerWithTypedParameters.methodWithEnum(ElementType)}: " +
            new HttpRequestException("Could not convert enumValue=unknown to java.lang.annotation.ElementType"));
    servlet.service(request, response);
    assertThat(response.getStatus()).isEqualTo(400);
    assertThat(response.getStatusMessage()).contains("Could not convert enumValue=unknown to java.lang.annotation.ElementType");
}