HttpServletResponseWrapper extends HttpServerResponse { public static HttpServerResponse create(@Nullable HttpServletRequest request, HttpServletResponse response, @Nullable Throwable caught) { return new HttpServletResponseWrapper(request, response, caught); } HttpServletResponseWrapper(@Nullable HttpServletRequest request, HttpServletResponse response,
    @Nullable Throwable caught); static HttpServerResponse create(@Nullable HttpServletRequest request,
    HttpServletResponse response, @Nullable Throwable caught); @Override final Object unwrap(); @Override @Nullable HttpServletRequestWrapper request(); @Override Throwable error(); @Override int statusCode();  }
@Test public void nullRequestOk() { HttpServletResponseWrapper.create(null, response, null); }
@Test public void method_isRequestMethod() { HttpServerResponse wrapper = HttpServletResponseWrapper.create(request, response, null); when(request.getMethod()).thenReturn("POST"); assertThat(wrapper.method()).isEqualTo("POST"); }
@Test public void route_okOnBadAttribute() { HttpServerResponse wrapper = HttpServletResponseWrapper.create(request, response, null); when(request.getAttribute("http.route")).thenReturn(new Object()); assertThat(wrapper.route()).isNull(); }
@Test public void route_isHttpRouteAttribute() { HttpServerResponse wrapper = HttpServletResponseWrapper.create(request, response, null); when(request.getAttribute("http.route")).thenReturn("/users/{userId}"); assertThat(wrapper.route()).isEqualTo("/users/{userId}"); }