epugh commented on a change in pull request #2430: URL: https://github.com/apache/lucene-solr/pull/2430#discussion_r583223688
########## File path: solr/core/src/test/org/apache/solr/security/JWTIssuerConfigTest.java ########## @@ -125,6 +128,31 @@ public void parseIssuerConfigExplicit() { assertEquals("https://host/jwk", issuerConfig.getJwksUrls().get(0)); } + @Test + public void jwksUrlwithHttpLogsaWarning() { + HashMap<String, Object> issuerConfigMap = new HashMap<>(); + issuerConfigMap.put("name", "myName"); + issuerConfigMap.put("iss", "myIss"); + issuerConfigMap.put("jwksUrl", "http://host/jwk"); + + JWTIssuerConfig issuerConfig = new JWTIssuerConfig(issuerConfigMap); + + LogWatcherConfig watcherCfg = new LogWatcherConfig(true, null, "WARN", 100); + @SuppressWarnings({"rawtypes"}) + LogWatcher watcher = LogWatcher.newRegisteredLogWatcher(watcherCfg, null); + + assertEquals(1, issuerConfig.getHttpsJwks().size()); + assertEquals("http://host/jwk", issuerConfig.getHttpsJwks().get(0).getLocation()); + + + SolrDocumentList history = watcher.getHistory(-1, null); + + if (history.stream().filter(d -> "org.apache.solr.security.JWTIssuerConfig".equals(d.getFirstValue("logger"))).count() == 0) { Review comment: I am struggling to get this.. I can get a .findFirst(), but not with the filter.... I'd be happy for you to push up an edit ;-) This is at my outer edges of experinece in Java! the whole `->` weirds me out! ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org