use of org.ff4j.web.api.security.FF4jAuthenticationFilter in project ff4j by ff4j.
the class SecurityAuthenticationFilterTest method testNoAuthorizationAttributeInHeader.
@Test(expected = WebApplicationException.class)
public void testNoAuthorizationAttributeInHeader() throws IOException {
// Given
FF4jAuthenticationFilter faf = new FF4jAuthenticationFilter();
ContainerRequestContext mockRequest = mock(ContainerRequestContext.class);
when(mockRequest.getHeaderString("Authorization")).thenReturn(null);
when(mockRequest.getMethod()).thenReturn("GET");
UriInfo mockUriInfo = mock(UriInfo.class);
when(mockUriInfo.getPath()).thenReturn("someURL");
when(mockRequest.getUriInfo()).thenReturn(mockUriInfo);
faf.filter(mockRequest);
}
Aggregations