snuyanzin commented on code in PR #106:
URL: 
https://github.com/apache/flink-connector-kafka/pull/106#discussion_r1650422693


##########
flink-connector-kafka/src/test/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaProducerBaseTest.java:
##########
@@ -160,25 +168,17 @@ public void testAsyncErrorRethrownOnInvoke() throws 
Throwable {
                 .get(0)
                 .onCompletion(null, new Exception("artificial async 
exception"));
 
-        try {
-            testHarness.processElement(new StreamRecord<>("msg-2"));
-        } catch (Exception e) {
-            // the next invoke should rethrow the async exception
-            assertThat(e.getCause().getMessage()).contains("artificial async 
exception");
-
-            // test succeeded
-            return;
-        }
-
-        fail("unknown failure");
+        // the next invoke should rethrow the async exception
+        assertThatThrownBy(() -> testHarness.processElement(new 
StreamRecord<>("msg-2")))
+                .hasStackTraceContaining("artificial async exception");

Review Comment:
   Here it is not one-to-one migration since it's started to check the, whole 
trace instead of just a cause 



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