harmadasg commented on code in PR #23199:
URL: https://github.com/apache/kafka/pull/23199#discussion_r3882849187


##########
streams/src/test/java/org/apache/kafka/streams/kstream/internals/suppress/KTableSuppressProcessorTest.java:
##########
@@ -448,39 +440,17 @@ public void suppressShouldShutDownWhenOverByteCapacity() {
 
         context.setRecordMetadata("", 0, 1L);
         context.setTimestamp(1L);
-        try {
-            harness.processor.process(new Record<>("dummyKey", value, 
timestamp));
-            fail("expected an exception");
-        } catch (final StreamsException e) {
-            assertThat(e.getMessage(), containsString("buffer exceeded its max 
capacity"));
-        }
+        assertThrows(StreamsException.class,
+            () -> harness.processor.process(new Record<>("dummyKey", value, 
timestamp)),
+            "buffer exceeded its max capacity"

Review Comment:
   oh right I misused `assertThrows` again 🫤 The JavaDoc even calls out this 
specific scenario
   
   > Note that the supplied message is not the expected message of the thrown 
exception. To assert the expected message of the thrown exception, you must use 
a separate, subsequent assertion against the exception returned from this 
method.
   
   @chia7712 hopefully it is good now, thanks for your patience 



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