clolov commented on code in PR #14222: URL: https://github.com/apache/kafka/pull/14222#discussion_r1304087260
########## streams/src/test/java/org/apache/kafka/streams/state/internals/TimestampedKeyValueStoreBuilderTest.java: ########## @@ -155,42 +144,24 @@ public void shouldThrowNullPointerIfInnerIsNull() { @Test public void shouldNotThrowNullPointerIfKeySerdeIsNull() { - reset(supplier); - expect(supplier.name()).andReturn("name"); - expect(supplier.metricsScope()).andReturn("metricScope").anyTimes(); - replay(supplier); - // does not throw new TimestampedKeyValueStoreBuilder<>(supplier, null, Serdes.String(), new MockTime()); } @Test public void shouldNotThrowNullPointerIfValueSerdeIsNull() { - reset(supplier); - expect(supplier.name()).andReturn("name"); - expect(supplier.metricsScope()).andReturn("metricScope").anyTimes(); - replay(supplier); - // does not throw new TimestampedKeyValueStoreBuilder<>(supplier, Serdes.String(), null, new MockTime()); } @Test public void shouldThrowNullPointerIfTimeIsNull() { - reset(supplier); - expect(supplier.name()).andReturn("name"); - expect(supplier.metricsScope()).andReturn("metricScope").anyTimes(); - replay(supplier); - assertThrows(NullPointerException.class, () -> new TimestampedKeyValueStoreBuilder<>(supplier, Serdes.String(), Serdes.String(), null)); } @Test public void shouldThrowNullPointerIfMetricsScopeIsNull() { - reset(supplier); - expect(supplier.get()).andReturn(new RocksDBTimestampedStore("name", null)); - expect(supplier.name()).andReturn("name"); Review Comment: Line 192 is part of the setup - https://github.com/apache/kafka/pull/14222/files#diff-5d8f05341b748d36ea99e0ce541ca3ff0a4ac0a6d35a2e2ad0ffb383202b1201R52 The builder's code is ``` public TimestampedKeyValueStoreBuilder(final KeyValueBytesStoreSupplier storeSupplier, final Serde<K> keySerde, final Serde<V> valueSerde, final Time time) { super( storeSupplier.name(), keySerde, valueSerde == null ? null : new ValueAndTimestampSerde<>(valueSerde), time); Objects.requireNonNull(storeSupplier, "storeSupplier can't be null"); Objects.requireNonNull(storeSupplier.metricsScope(), "storeSupplier's metricsScope can't be null"); <- THIS IS THE LINE WHICH WE ARE TRYING TO TEST this.storeSupplier = storeSupplier; } ``` It does not use the supplier.get() method on the test path -- 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