ServletRuntime { public abstract int status(HttpServletResponse response); ServletRuntime(); HttpServletResponse httpServletResponse(ServletResponse response); abstract int status(HttpServletResponse response); abstract boolean isAsync(HttpServletRequest request); abstract void handleAsync(
    HttpServerHandler<HttpServerRequest, HttpServerResponse> handler,
    HttpServletRequest request, HttpServletResponse response, Span span); static ServletRuntime get();  }
@Test public void servlet25_status() { assertThat(servlet25.status(new HttpServletResponseImpl())) .isEqualTo(200); }
@Test public void servlet25_status_cached() { HttpServletResponseImpl response = new HttpServletResponseImpl(); assertThat(servlet25.status(response)) .isEqualTo(200); assertThat(servlet25.status(response)) .isEqualTo(200); }
@Test public void servlet25_status_cached_laterThrows() { HttpServletResponseImpl response = new HttpServletResponseImpl(); servlet25.status(response); response.shouldThrow = true; assertThat(servlet25.status(response)) .isEqualTo(0); }
@Test public void servlet25_status_doesntParseAnonymousTypes() { Response jettyResponse = new Response(null, null) { @Override public int getStatus() { throw new AssertionError(); } }; assertThat(servlet25.status(jettyResponse)) .isZero(); }
@Test public void servlet25_status_doesntParseLocalTypes() { class LocalResponse extends HttpServletResponseImpl { } assertThat(servlet25.status(new LocalResponse())) .isZero(); }
@Test public void servlet25_status_zeroOnException() { assertThat(servlet25.status(new ExceptionResponse())) .isZero(); }
@Test public void servlet25_status_zeroOnException_cached() { servlet25.status(new ExceptionResponse()); assertThat(servlet25.status(new ExceptionResponse())) .isZero(); }
@Test public void servlet25_status_cachesUpToTenTypes() { assertThat(servlet25.status(new Response1())) .isEqualTo(200); assertThat(servlet25.status(new Response2())) .isEqualTo(200); assertThat(servlet25.status(new Response3())) .isEqualTo(200); assertThat(servlet25.status(new Response4())) .isEqualTo(200); assertThat(servlet25.status(new Response5())) .isEqualTo(200); assertThat(servlet25.status(new Response6())) .isEqualTo(200); assertThat(servlet25.status(new Response7())) .isEqualTo(200); assertThat(servlet25.status(new Response8())) .isEqualTo(200); assertThat(servlet25.status(new Response9())) .isEqualTo(200); assertThat(servlet25.status(new Response10())) .isEqualTo(200); assertThat(servlet25.status(new Response11())) .isZero(); }