mjsax commented on code in PR #16745:
URL: https://github.com/apache/kafka/pull/16745#discussion_r1699434616


##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/RecordDeserializerTest.java:
##########
@@ -62,27 +63,29 @@ public class RecordDeserializerTest {
 
     @Test
     public void 
shouldReturnConsumerRecordWithDeserializedValueWhenNoExceptions() {
-        final RecordDeserializer recordDeserializer = new RecordDeserializer(
-            new TheSourceNode(
-                sourceNodeName,
-                false,
-                false,
-                "key",
-                "value"
-            ),
-            null,
-            new LogContext(),
-            new Metrics().sensor("dropped-records")
-        );
-        final ConsumerRecord<Object, Object> record = 
recordDeserializer.deserialize(null, rawRecord);
-        assertEquals(rawRecord.topic(), record.topic());
-        assertEquals(rawRecord.partition(), record.partition());
-        assertEquals(rawRecord.offset(), record.offset());
-        assertEquals("key", record.key());
-        assertEquals("value", record.value());
-        assertEquals(rawRecord.timestamp(), record.timestamp());
-        assertEquals(TimestampType.CREATE_TIME, record.timestampType());
-        assertEquals(rawRecord.headers(), record.headers());
+        try (final Metrics metrics = new Metrics()) {

Review Comment:
   Side cleanup. `Metrics` must be close to avoid resource leaks. (A few more 
times below.)



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