madrob commented on a change in pull request #2430:
URL: https://github.com/apache/lucene-solr/pull/2430#discussion_r583244417



##########
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:
       Ah, you're right, I should have checked an IDE before commenting. You 
want `assertTrue(msg, history.stream().anyMatch(d -> ...)`




----------------------------------------------------------------
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

Reply via email to