ContainerRequest implements GenericContainerRequest { @Override public boolean isUserInRole(String role) { return securityContext.isUserInRole(role); } ContainerRequest(String method, URI requestUri, URI baseUri, InputStream entityStream,
                            MultivaluedMap<String, String> httpHeaders, SecurityContext securityContext); @Override MediaType getAcceptableMediaType(List<MediaType> mediaTypes); @Override List<String> getCookieHeaders(); @Override InputStream getEntityStream(); @Override URI getRequestUri(); @Override URI getBaseUri(); @Override String getMethod(); @Override void setMethod(String method); @Override void setEntityStream(InputStream entityStream); @Override void setUris(URI requestUri, URI baseUri); @Override void setCookieHeaders(List<String> cookieHeaders); @Override void setRequestHeaders(MultivaluedMap<String, String> httpHeaders); @Override String getAuthenticationScheme(); @Override Principal getUserPrincipal(); @Override boolean isSecure(); @Override boolean isUserInRole(String role); @Override ResponseBuilder evaluatePreconditions(EntityTag etag); @Override ResponseBuilder evaluatePreconditions(Date lastModified); @Override ResponseBuilder evaluatePreconditions(Date lastModified, EntityTag etag); @Override ResponseBuilder evaluatePreconditions(); @Override Variant selectVariant(List<Variant> variants); @Override List<Locale> getAcceptableLanguages(); @Override List<MediaType> getAcceptableMediaTypes(); @Override List<AcceptMediaType> getAcceptMediaTypeList(); @Override Map<String, Cookie> getCookies(); @Override Date getDate(); @Override int getLength(); @Override Locale getLanguage(); @Override MediaType getMediaType(); @Override List<String> getRequestHeader(String name); @Override String getHeaderString(String name); @Override MultivaluedMap<String, String> getRequestHeaders(); @Override String toString();  }
@Test public void testIsUserInRole() { when(securityContext.isUserInRole("admin")).thenReturn(true); assertTrue(containerRequest.isUserInRole("admin")); }