bipinprasad commented on code in PR #3479: URL: https://github.com/apache/storm/pull/3479#discussion_r881056066
########## 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: this should probably be assertThrows(NumberFormatException.class, ...) -- 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