mjsax commented on code in PR #19570:
URL: https://github.com/apache/kafka/pull/19570#discussion_r2061117196
##########
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:
This is the actually bug-fix -- the test used `WINDOW_SIZE_MS_CONFIG`
incorrectly, however, this lead to a `NumberFormatException` which extends
`IllegalArgumentException` and to the test still passed...
--
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]