emiliosetiadarma commented on code in PR #6272:
URL: https://github.com/apache/nifi/pull/6272#discussion_r939430610


##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutSQL.java:
##########
@@ -338,14 +342,12 @@ public void 
testFailInMiddleWithBadStatementRollbackOnFailure() throws Initializ
         runner.enqueue("INSERT INTO PERSONS_AI (NAME, CODE) VALUES ('Tom', 
3)".getBytes());
         runner.enqueue("INSERT INTO PERSONS_AI (NAME, CODE) VALUES ('Harry', 
44)".getBytes());
 
-        try {
-            runner.run();
-            fail("ProcessException should be thrown");
-        } catch (AssertionError e) {
-            assertTrue(e.getCause() instanceof ProcessException);
-            runner.assertTransferCount(PutSQL.REL_FAILURE, 0);
-            runner.assertTransferCount(PutSQL.REL_SUCCESS, 0);
-        }
+        final AssertionError e = assertThrows(AssertionError.class, () -> {
+           runner.run();
+        });
+        assertTrue(e.getCause() instanceof ProcessException);

Review Comment:
   Making the changes in TestPutSQL



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

Reply via email to