FrankChen021 commented on code in PR #20057:
URL: https://github.com/apache/druid/pull/20057#discussion_r3805184530


##########
server/src/test/java/org/apache/druid/guice/BrokerProcessingModuleTest.java:
##########
@@ -86,27 +93,29 @@
   public void testCachePopulatorAsSingleton()
   {
     CachePopulator cachePopulator = injector.getInstance(CachePopulator.class);
-    Assert.assertNotNull(cachePopulator);
+    Assertions.assertNotNull(cachePopulator);
   }
 
-  @Test(expected = ProvisionException.class)
+  @Test
   public void testMemoryCheckThrowsException()
   {
-    // JDK 9 and above do not support checking for direct memory size
-    // so this test only validates functionality for Java 8.
-    try {
-      JvmUtils.getRuntimeInfo().getDirectMemorySizeBytes();
-    }
-    catch (UnsupportedOperationException e) {
-      Assume.assumeNoException(e);
-    }
-    Properties props = new Properties();
-    props.setProperty("druid.processing.buffer.sizeBytes", "3GiB");
-    Injector injector1 = makeInjector(props);
-
-    DruidProcessingConfig processingBufferConfig = 
injector1.getInstance(DruidProcessingConfig.class);
-    BrokerProcessingModule module = new BrokerProcessingModule();
-    module.getMergeBufferPool(processingBufferConfig, 
JvmUtils.getRuntimeInfo());
+    Assertions.assertThrows(ProvisionException.class, () -> {
+      // JDK 9 and above do not support checking for direct memory size
+      // so this test only validates functionality for Java 8.
+      try {
+        JvmUtils.getRuntimeInfo().getDirectMemorySizeBytes();

Review Comment:
   Pre-existing on `offical/master`: the same 
`JvmUtils.getRuntimeInfo().getDirectMemorySizeBytes()` invocation is present in 
the base test at line 98. PR2 only migrated the surrounding JUnit 
assumption/assertion flow; no deprecated API call was introduced.



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