use of org.ff4j.web.api.security.FF4jSecurityContextFilter in project ff4j by ff4j.
the class SecurityFilterTest method testUnAuthorizedApiKey.
@Test(expected = WebApplicationException.class)
public void testUnAuthorizedApiKey() throws IOException {
FF4jSecurityContextFilter faf = new FF4jSecurityContextFilter();
ContainerRequest mockRequest = mock(ContainerRequest.class);
when(mockRequest.getMethod()).thenReturn("GET");
when(mockRequest.getPath(true)).thenReturn("someURLl");
when(mockRequest.getHeaderValue("Authorization")).thenReturn("apiKey=12");
FF4jSecurityContextFilter.setSecurityConfig(new ApiConfig());
Assert.assertNotNull(faf);
faf.filter(mockRequest);
}
Aggregations