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


##########
storm-client/test/jvm/org/apache/storm/TestConfigValidate.java:
##########
@@ -261,56 +250,57 @@ public void testWorkerChildoptsIsStringOrStringList() 
throws InvocationTargetExc
             try {
                 conf.put(Config.TOPOLOGY_WORKER_CHILDOPTS, 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) {
             }
         }
     }
 
     @Test
     public void testValidity() {
-        Map<String, Object> conf = new HashMap<String, Object>();
+        Map<String, Object> conf = new HashMap<>();
         conf.put(Config.TOPOLOGY_DEBUG, true);
         conf.put("q", "asasdasd");
-        conf.put("aaa", new Integer("123"));
-        conf.put("bbb", new Long("456"));
-        List<Object> testList = new ArrayList<Object>();
+        conf.put("aaa", Integer.valueOf("123"));
+        conf.put("bbb", Long.valueOf("456"));
+        List<Object> testList = new ArrayList<>();
         testList.add(1);
         testList.add(2);
-        testList.add(new Integer("3"));
-        testList.add(new Long("4"));
+        testList.add(Integer.valueOf("3"));
+        testList.add(Long.valueOf("4"));
         testList.add(new Float("3"));
         testList.add(new Double("4"));
         testList.add(ImmutableList.of("asdf", 3));
         conf.put("eee", testList);
-        Assert.assertTrue(Utils.isValidConf(conf));
+        assertTrue(Utils.isValidConf(conf));
     }
 
     @Test
     public void testNonValidConfigChar() {
-        Map<String, Object> conf = new HashMap<String, Object>();
+        Map<String, Object> conf = new HashMap<>();
         conf.put("q", ImmutableList.of("asdf", 'c'));
-        Assert.assertFalse(Utils.isValidConf(conf));
+        assertFalse(Utils.isValidConf(conf));
     }
 
     @Test
     public void testNonValidConfigRandomObject() {
-        Map<String, Object> conf = new HashMap<String, Object>();
+        Map<String, Object> conf = new HashMap<>();
         conf.put("q", ImmutableList.of("asdf", new TestConfigValidate()));
-        Assert.assertFalse(Utils.isValidConf(conf));
+        assertFalse(Utils.isValidConf(conf));
     }
 
     @Test
     public void testKryoRegValidator() {
         KryoRegValidator validator = new KryoRegValidator();
 
         // fail cases
-        Object[] failCases = { ImmutableMap.of("f", "g"), ImmutableList.of(1), 
Arrays.asList(ImmutableMap.of("a", 1)) };
+        Object[] failCases = { ImmutableMap.of("f", "g"), ImmutableList.of(1),
+            Collections.singletonList(ImmutableMap.of("a", 1))};
         for (Object value : failCases) {
             try {
                 validator.validateField("test", value);

Review Comment:
   use assertThrows(IllegalArgumentException.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

Reply via email to