fapaul commented on a change in pull request #17964:
URL: https://github.com/apache/flink/pull/17964#discussion_r763052747



##########
File path: 
flink-connectors/flink-connector-kafka/src/test/java/org/apache/flink/streaming/connectors/kafka/table/KafkaDynamicTableFactoryTest.java
##########
@@ -851,6 +851,17 @@ public void testPrimaryKeyValidation() {
             assertEquals(error, t.getCause().getMessage());
         }
 
+        try {
+            createTableSink(pkSchema, getKeyValueOptions());
+            fail();
+        } catch (Throwable t) {

Review comment:
       Can you quickly explain why is it enough to only add this assertion to 
an existing test over adding a new test?

##########
File path: 
flink-connectors/flink-connector-kafka/src/test/java/org/apache/flink/streaming/connectors/kafka/table/KafkaDynamicTableFactoryTest.java
##########
@@ -851,6 +851,17 @@ public void testPrimaryKeyValidation() {
             assertEquals(error, t.getCause().getMessage());
         }
 
+        try {
+            createTableSink(pkSchema, getKeyValueOptions());

Review comment:
       I think you can already use something along the lines of
   
   ```java
   assertThatThrownBy(() -> createTableSink(pkSchema, getKeyValueOptions())
       .isInstanceOf(...)
       .hasMessageContaining()
   ```




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