You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2021/09/06 14:58:43 UTC

[GitHub] [nifi] exceptionfactory commented on a change in pull request #5333: NIFI-9081 Updated nifi-framework-api tests to JUnit 5.

exceptionfactory commented on a change in pull request #5333:
URL: https://github.com/apache/nifi/pull/5333#discussion_r702958003



##########
File path: nifi-external/nifi-kafka-connect/nifi-kafka-connector-tests/src/test/java/org/apache/nifi/kafka/connect/StatelessNiFiSourceTaskIT.java
##########
@@ -133,24 +129,24 @@ public void testHeaders() throws InterruptedException {
     }
 
     @Test
-    public void testTransferToWrongPort() throws InterruptedException {
+    public void testTransferToWrongPort(TestInfo testInfo) throws InterruptedException {
         final StatelessNiFiSourceTask sourceTask = new StatelessNiFiSourceTask();
         sourceTask.initialize(createContext());
 
-        final Map<String, String> properties = createDefaultProperties();
+        final Map<String, String> properties = createDefaultProperties(testInfo);
         properties.put(StatelessNiFiSourceConnector.OUTPUT_PORT_NAME, "Another");
         sourceTask.start(properties);
 
         try {
             sourceTask.poll();
-            Assert.fail("Expected RetriableException to be thrown");
+            fail("Expected RetriableException to be thrown");
         } catch (final RetriableException re) {
             // Expected
         }

Review comment:
       This should be changed to use `assertThrows()`.

##########
File path: nifi-external/nifi-kafka-connect/nifi-kafka-connector-tests/src/test/java/org/apache/nifi/kafka/connect/StatelessNiFiSinkTaskIT.java
##########
@@ -121,27 +117,27 @@ public void testWrongOutputPort() {
         final File[] files = DEFAULT_OUTPUT_DIRECTORY.listFiles();
         if (files != null) {
             for (final File file : files) {
-                assertTrue("Failed to delete existing file " + file.getAbsolutePath(), file.delete());
+                assertTrue(file.delete(), "Failed to delete existing file " + file.getAbsolutePath());
             }
         }
 
         try {
             sinkTask.put(Collections.singleton(record));
             sinkTask.flush(Collections.emptyMap());
-            Assert.fail("Expected RetriableException to be thrown");
+            fail("Expected RetriableException to be thrown");
         } catch (final RetriableException re) {
             // Expected
         }

Review comment:
       This should be changed to use `assertThrows()`.




-- 
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: issues-unsubscribe@nifi.apache.org

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