DiscFilterResponse { public HttpResponse getParentResponse() { if (parent instanceof HttpResponse) return (HttpResponse)parent; throw new UnsupportedOperationException( "getParentResponse is not supported for " + parent.getClass().getName()); } DiscFilterResponse(ServletOrJdiscHttpResponse parent); Enumeration<String> getAttributeNames(); Object getAttribute(String name); void setAttribute(String name, Object value); void removeAttribute(String name); HeaderFields getUntreatedHeaders(); List<Cookie> getUntreatedCookies(); abstract void setHeader(String name, String value); abstract void removeHeaders(String name); abstract void setHeaders(String name, String value); abstract void setHeaders(String name, List<String> values); abstract void addHeader(String name, String value); abstract String getHeader(String name); List<Cookie> getCookies(); abstract void setCookies(List<Cookie> cookies); int getStatus(); abstract void setStatus(int status); HttpResponse getParentResponse(); void addCookie(JDiscCookieWrapper cookie); void sendError(int errorCode); void setCookie(String name, String value);  }
@Test public void testGetParentResponse() { URI uri = URI.create("http: HttpRequest httpReq = newRequest(uri, HttpRequest.Method.GET, HttpRequest.Version.HTTP_1_1); HttpResponse httpResp = newResponse(httpReq, 200); DiscFilterResponse response = new JdiscFilterResponse(httpResp); Assert.assertSame(response.getParentResponse(), httpResp); }