m1a2st commented on code in PR #23389:
URL: https://github.com/apache/kafka/pull/23389#discussion_r4011236084


##########
streams/src/test/java/org/apache/kafka/streams/kstream/JoinWindowsTest.java:
##########
@@ -82,23 +81,13 @@ public void graceShouldNotCalledAfterGraceSet() {
     @Test
     public void endTimeShouldNotBeBeforeStart() {
         final JoinWindows windowSpec = 
JoinWindows.ofTimeDifferenceWithNoGrace(ofMillis(ANY_SIZE));
-        try {
-            windowSpec.after(ofMillis(-ANY_SIZE - 1));
-            fail("window end time should not be before window start time");
-        } catch (final IllegalArgumentException e) {
-            // expected
-        }
+        assertThrows(IllegalArgumentException.class, () -> 
windowSpec.after(ofMillis(-ANY_SIZE - 1)));

Review Comment:
   We should keep the failure message.



##########
streams/src/test/java/org/apache/kafka/streams/kstream/JoinWindowsTest.java:
##########
@@ -82,23 +81,13 @@ public void graceShouldNotCalledAfterGraceSet() {
     @Test
     public void endTimeShouldNotBeBeforeStart() {
         final JoinWindows windowSpec = 
JoinWindows.ofTimeDifferenceWithNoGrace(ofMillis(ANY_SIZE));
-        try {
-            windowSpec.after(ofMillis(-ANY_SIZE - 1));
-            fail("window end time should not be before window start time");
-        } catch (final IllegalArgumentException e) {
-            // expected
-        }
+        assertThrows(IllegalArgumentException.class, () -> 
windowSpec.after(ofMillis(-ANY_SIZE - 1)));
     }
 
     @Test
     public void startTimeShouldNotBeAfterEnd() {
         final JoinWindows windowSpec = 
JoinWindows.ofTimeDifferenceWithNoGrace(ofMillis(ANY_SIZE));
-        try {
-            windowSpec.before(ofMillis(-ANY_SIZE - 1));
-            fail("window start time should not be after window end time");
-        } catch (final IllegalArgumentException e) {
-            // expected
-        }
+        assertThrows(IllegalArgumentException.class, () -> 
windowSpec.before(ofMillis(-ANY_SIZE - 1)));

Review Comment:
   ditto



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