@Test
public void shouldGive400OnInvalidLongConversion() throws IOException {

    FakeServletRequest request = new FakeServletRequest("POST", contextRoot, "/api", "/withLong");
    request.setParameter("longValue", "one hundred");
    expectedLogEvents.expect(ApiControllerAction.class, Level.DEBUG,
            "While processing ServletHttpExchange[POST " + contextRoot + "/api/withLong?longValue=one+hundred] arguments to " +
            "ApiControllerMethodAction{POST /withLong => ControllerWithTypedParameters.methodWithLong(long)}: " +
            new HttpRequestException("Could not convert longValue=one hundred to long"));
    servlet.service(request, response);
    assertThat(response.getStatus()).isEqualTo(400);
    assertThat(response.getStatusMessage()).contains("Could not convert longValue=one hundred to long");
}