xvrl commented on code in PR #14827:
URL: https://github.com/apache/druid/pull/14827#discussion_r1317635815


##########
server/src/test/java/org/apache/druid/client/cache/MemcachedCacheTest.java:
##########
@@ -224,6 +217,37 @@ public void emit(Event event)
     }
   }
 
+  @Test
+  public void testSslConnection()
+  {
+    final MemcachedCacheConfig config = new MemcachedCacheConfig()
+    {
+      @Override
+      public boolean enableTls()
+      {
+        return true;
+      }
+
+      @Override
+      public String getHosts()
+      {
+        return "localhost:9999";
+      }
+    };
+    // Static Mode
+    Assert.assertEquals(config.getClientMode(), "static");
+    MemcachedCache client = new MemcachedCache(
+            Suppliers.ofInstance(
+                    StupidResourceHolder.create(new MockMemcachedClient())
+            ),
+            config,
+            NOOP_MONITOR
+    );
+    Assert.assertNull(client.get(new Cache.NamedKey("a", HI)));
+    put(client, "a", HI, 1);
+    Assert.assertEquals(1, get(client, "a", HI));

Review Comment:
   this code doesn't actually verify anything SSL related, since all the ssl 
configuration handling is done in `MemcachedCache.create(...)` and the supplier 
you provide is creating its own mock instances independently.
   
   If we want to ensure the connection factory is actually configured 
correctly, you will probably have to refactor the create method a little bit to 
move the connection factory creation into its own method which you can then 
test independently.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to