snikhil5 commented on code in PR #3479:
URL: https://github.com/apache/storm/pull/3479#discussion_r885710004


##########
storm-client/test/jvm/org/apache/storm/trident/TestTridentTopology.java:
##########
@@ -60,7 +61,7 @@ public void testGenBoltId() {
             Map<String, Bolt> cur = topology.get_bolts();
             System.out.println(cur.keySet());
             if (pre != null) {
-                Assert.assertTrue("bold id not consistent with group name", 
pre.equals(cur.keySet()));
+                assertEquals(pre, cur.keySet(), "bold id not consistent with 
group name");

Review Comment:
   done



##########
storm-client/test/jvm/org/apache/storm/utils/UtilsTest.java:
##########
@@ -146,31 +146,31 @@ public void 
getConfiguredClientThrowsRuntimeExceptionOnBadArgsTest() throws TTra
 
         try {
             new NimbusClient(config, "", 65535);
-            Assert.fail("Expected exception to be thrown");
+            fail("Expected exception to be thrown");
         } catch (RuntimeException e) {
-            Assert.assertTrue(
-                "Cause is not TTransportException " + e,
-                Utils.exceptionCauseIsInstanceOf(TTransportException.class, 
e));
+            assertTrue(

Review Comment:
   done



##########
storm-core/test/jvm/org/apache/storm/command/SetLogLevelTest.java:
##########
@@ -15,33 +15,35 @@
 import java.util.Map;
 import org.apache.storm.generated.LogLevel;
 import org.apache.storm.generated.LogLevelAction;
-import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
 
 public class SetLogLevelTest {
 
     @Test
     public void testUpdateLogLevelParser() {
         SetLogLevel.LogLevelsParser logLevelsParser = new 
SetLogLevel.LogLevelsParser(LogLevelAction.UPDATE);
         LogLevel logLevel = ((Map<String, LogLevel>) 
logLevelsParser.parse("com.foo.one=warn")).get("com.foo.one");
-        Assert.assertEquals(0, logLevel.get_reset_log_level_timeout_secs());
-        Assert.assertEquals("WARN", logLevel.get_target_log_level());
+        assertEquals(0, logLevel.get_reset_log_level_timeout_secs());
+        assertEquals("WARN", logLevel.get_target_log_level());
 
         logLevel = ((Map<String, LogLevel>) 
logLevelsParser.parse("com.foo.two=DEBUG:10")).get("com.foo.two");
-        Assert.assertEquals(10, logLevel.get_reset_log_level_timeout_secs());
-        Assert.assertEquals("DEBUG", logLevel.get_target_log_level());
+        assertEquals(10, logLevel.get_reset_log_level_timeout_secs());
+        assertEquals("DEBUG", logLevel.get_target_log_level());
     }
 
-    @Test(expected = NumberFormatException.class)
+    @Test
     public void testInvalidTimeout() {
         SetLogLevel.LogLevelsParser logLevelsParser = new 
SetLogLevel.LogLevelsParser(LogLevelAction.UPDATE);
-        logLevelsParser.parse("com.foo.bar=warn:NaN");
+        assertThrows(IllegalArgumentException.class, () -> 
logLevelsParser.parse("com.foo.bar=warn:NaN"));

Review Comment:
   done



##########
storm-core/test/jvm/org/apache/storm/serialization/SerializationTest.java:
##########
@@ -44,13 +47,13 @@ public void testJavaSerialization() throws IOException {
         conf.put(Config.TOPOLOGY_FALL_BACK_ON_JAVA_SERIALIZATION, false);
         try {
             roundtrip(vals, conf);
-            Assert.fail("Expected Exception not Thrown for config: " + conf);
+            fail("Expected Exception not Thrown for config: " + conf);
         } catch (Exception e) {
         }

Review Comment:
   done



##########
storm-server/src/test/java/org/apache/storm/DaemonConfigTest.java:
##########
@@ -50,45 +51,39 @@ private void stringOrStringListTest(String key) {
             try {
                 conf.put(key, value);
                 ConfigValidation.validateFields(conf);
-                Assert.fail("Expected Exception not Thrown for value: " + 
value);
-            } catch (IllegalArgumentException Ex) {
+                fail("Expected Exception not Thrown for value: " + value);
+            } catch (IllegalArgumentException ignore) {
             }
         }

Review Comment:
   done



-- 
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: dev-unsubscr...@storm.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to