Copilot commented on code in PR #20575:
URL: https://github.com/apache/kafka/pull/20575#discussion_r2372745099
##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/DefaultStreamsRebalanceListenerTest.java:
##########
@@ -109,9 +108,9 @@ void testOnTasksRevokedWithException() {
createRebalanceListenerWithRebalanceData(new
StreamsRebalanceData(UUID.randomUUID(), Optional.empty(), Map.of(), Map.of()));
- final Optional<Exception> result =
defaultStreamsRebalanceListener.onTasksRevoked(Set.of());
+ final Exception actualException = assertThrows(RuntimeException.class,
() -> defaultStreamsRebalanceListener.onTasksRevoked(Set.of()));
- assertTrue(result.isPresent());
+ assertEquals(actualException, exception);
Review Comment:
[nitpick] Extra space before 'exception' parameter. Should be
'assertEquals(actualException, exception);' for consistent formatting.
##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/DefaultStreamsRebalanceListenerTest.java:
##########
@@ -211,9 +208,10 @@ void testOnAllTasksLostWithException() {
final StreamsRebalanceData streamsRebalanceData =
mock(StreamsRebalanceData.class);
when(streamsRebalanceData.subtopologies()).thenReturn(Map.of());
createRebalanceListenerWithRebalanceData(streamsRebalanceData);
- final Optional<Exception> result =
defaultStreamsRebalanceListener.onAllTasksLost();
- assertTrue(result.isPresent());
- assertEquals(exception, result.get());
+
+ final Exception actualException = assertThrows(RuntimeException.class,
() -> defaultStreamsRebalanceListener.onAllTasksLost());
+
+ assertEquals(exception, actualException);
Review Comment:
[nitpick] Extra space before 'actualException' parameter. Should be
'assertEquals(exception, actualException);' for consistent formatting.
--
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]