ResourceContext { public ResourceContext(HttpServletRequest request, HttpServletResponse response, Http.AuthorityList authorities, Authorizer authorizer) { this.request = request; this.response = response; this.authorities = authorities; this.authorizer = authorizer; this.principal = null; this.checked = false; } ResourceContext(HttpServletRequest request, HttpServletResponse response,
            Http.AuthorityList authorities, Authorizer authorizer); static void setSendMultipleWwwAuthenticateHeaders(boolean bSendMultipleHeaders); HttpServletRequest request(); HttpServletResponse response(); Principal principal(); Principal authenticate(); Principal authenticate(boolean optionalAuth); void authorize(String action, String resource, String trustedDomain); void sendAuthenticateChallenges(ResourceException exc); String getRequestDomain(); void setRequestDomain(String requestDomain);  }
@Test public void testResourceContext() { HttpServletRequest httpServletRequest = Mockito.mock(HttpServletRequest.class); HttpServletResponse httpServletResponse = Mockito.mock(HttpServletResponse.class); Authorizer authorizer = Mockito.mock(Authorizer.class); Http.AuthorityList authorities = new Http.AuthorityList(); ResourceContext context = new ResourceContext(httpServletRequest, httpServletResponse, authorities, authorizer); assertEquals(context.request(), httpServletRequest); assertEquals(context.response(), httpServletResponse); assertNull(context.principal()); }