philipnee commented on code in PR #14123:
URL: https://github.com/apache/kafka/pull/14123#discussion_r1277840446
##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/PrototypeAsyncConsumerTest.java:
##########
@@ -153,12 +153,14 @@ public void testCommitAsync_UserSuppliedCallback() {
@SuppressWarnings("unchecked")
public void testCommitted() {
Set<TopicPartition> mockTopicPartitions =
mockTopicPartitionOffset().keySet();
- mockConstruction(OffsetFetchApplicationEvent.class, (mock, ctx) -> {
- when(mock.complete(any())).thenReturn(new HashMap<>());
- });
- consumer = newConsumer(time, new StringDeserializer(), new
StringDeserializer());
- assertDoesNotThrow(() -> consumer.committed(mockTopicPartitions,
Duration.ofMillis(1)));
-
verify(eventHandler).add(ArgumentMatchers.isA(OffsetFetchApplicationEvent.class));
+ try (MockedConstruction<OffsetFetchApplicationEvent> mockConstruction
= mockConstruction(OffsetFetchApplicationEvent.class,
Review Comment:
try-with-resources ensure thread-lock mockConstruction is closed to ensure
other tests would function properly.
--
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]