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


##########
streams/src/test/java/org/apache/kafka/streams/kstream/TimeWindowedDeserializerTest.java:
##########
@@ -97,34 +104,41 @@ public void 
shouldThrowErrorIfWindowSizeSetInConstructorConfigAndConstructor() {
         assertThrows(IllegalArgumentException.class, () -> 
timeWindowedDeserializer.configure(props, false));
     }
 
+    @Deprecated
     @Test
     public void 
shouldThrowErrorIfWindowSizeIsNotSetAndWindowedInnerClassSerdeIsSet() {
         props.put(StreamsConfig.WINDOWED_INNER_CLASS_SERDE, 
Serdes.ByteArraySerde.class.getName());
-        final TimeWindowedDeserializer<?> deserializer = new 
TimeWindowedDeserializer<>();
-        assertThrows(IllegalArgumentException.class, () -> 
deserializer.configure(props, false));
+        try (final TimeWindowedDeserializer<?> deserializer = new 
TimeWindowedDeserializer<>()) {
+            assertThrows(IllegalArgumentException.class, () -> 
deserializer.configure(props, false));
+        }
     }
 
     @Test
     public void 
shouldThrowErrorIfWindowSizeIsNotSetAndWindowedInnerDeserializerClassIsSet() {
-        props.put(TimeWindowedDeserializer.WINDOW_SIZE_MS_CONFIG, 
Serdes.ByteArraySerde.class.getName());
-        final TimeWindowedDeserializer<?> deserializer = new 
TimeWindowedDeserializer<>();
-        assertThrows(IllegalArgumentException.class, () -> 
deserializer.configure(props, false));
+        props.put(TimeWindowedDeserializer.WINDOWED_INNER_DESERIALIZER_CLASS, 
Serdes.ByteArraySerde.class.getName());

Review Comment:
   Interesting idea. For this PR, I think it would just be more "busy work". 
But in general, it could be a reasonable idea.



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to