ApiKeyFilter implements Filter { @Override public boolean matches(String uri, Context context) { return uri.startsWith(protectedUrlPrefix);} @Inject  ApiKeyFilter(UsersWritable users, ApiKeyStore apiKeyStore); @Override boolean matches(String uri, Context context); @Override Payload apply(String uri, Context context, PayloadSupplier nextFilter);  }
@Test public void test_matches() { assertThat(apiKeyFilter.matches("/foo", null)).isFalse(); assertThat(apiKeyFilter.matches("/api", null)).isTrue(); assertThat(apiKeyFilter.matches("/api_bar", null)).isTrue(); }