markap14 commented on code in PR #11221:
URL: https://github.com/apache/nifi/pull/11221#discussion_r3226721290


##########
nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/StandardProcessSessionIT.java:
##########
@@ -1601,7 +1601,10 @@ public void 
testMissingFlowFileExceptionThrownWhenUnableToReadData() {
 
         // attempt to read the data.
         final FlowFile ff1 = session.get();
-        assertThrows(MissingFlowFileException.class, () -> session.read(ff1, 
InputStream::read));
+        final MissingFlowFileException ex = 
assertThrows(MissingFlowFileException.class,
+                () -> session.read(ff1, InputStream::read));
+        
assertTrue(ex.getMessage().contains("12345678-1234-1234-1234-123456789012"));
+        assertTrue(ex.getMessage().contains("rolling back"));

Review Comment:
   It is acceptable to assert that an Exception message contains specific key 
elements such as "rolling back" - what is a very bad practice is to assert that 
the Exception message `equals` XYZ because the text could change any time and 
that should not break the unit test. So I'd say this is okay.



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