use of org.ff4j.web.api.filter.ApiKeyValidatorFilter in project ff4j by ff4j.
the class ApiKeyValidatorFilterTest method testApiKeyValidaton.
@Test
public void testApiKeyValidaton() throws Exception {
Map<String, ApiKey> initMap = new HashMap<>();
ApiKey ak1 = new ApiKey();
ak1.setUserId("user1");
ak1.setValue("key1");
ak1.setExpirationTime(new Date(System.currentTimeMillis() + 20000));
initMap.put(ak1.getValue(), ak1);
new ApiKeyValidatorFilter(initMap);
Assert.assertTrue(ApiKeyValidatorFilter.getValidApiKeysMap().containsKey("key1"));
ApiKeyValidatorFilter.setValidApiKeysMap(initMap);
}
Aggregations