UladzislauBlok commented on code in PR #21971:
URL: https://github.com/apache/kafka/pull/21971#discussion_r3614575459
##########
streams/src/test/java/org/apache/kafka/streams/state/internals/MeteredKeyValueStoreTest.java:
##########
@@ -521,20 +522,26 @@ public void
shouldThrowNullPointerOnReverseRangeIfToIsNull() {
assertThrows(NullPointerException.class, () ->
metered.reverseRange("from", null));
}
+ @SuppressWarnings("unchecked")
@Test
public void shouldGetRecordsWithPrefixKey() {
setUp();
- final StringSerializer stringSerializer = new StringSerializer();
- when(inner.prefixScan(KEY, stringSerializer))
+ final Serializer<String> mockSerializer = mock(Serializer.class);
+ final Headers headers = new RecordHeaders();
+ when(context.headers()).thenReturn(headers);
Review Comment:
Yes, heavy mock test (comparing to more realistic test for metered store
with headers)
This is done intentionally as
- They are simpler to setup
- Headers propagation is not critical for this store (it's more about being
consistent thing)
- Generally same testing approach is used for other tests in this class
--
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]