You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/04/26 20:59:15 UTC

[GitHub] [kafka] pierDipi commented on a change in pull request #8157: KAFKA-9088: Consolidate InternalMockProcessorContext and MockInternalProcessorContext

pierDipi commented on a change in pull request #8157:
URL: https://github.com/apache/kafka/pull/8157#discussion_r415399621



##########
File path: streams/src/test/java/org/apache/kafka/streams/state/internals/MeteredWindowStoreTest.java
##########
@@ -114,18 +110,9 @@
 
     @Before
     public void setUp() {
-        final StreamsMetricsImpl streamsMetrics =
-            new StreamsMetricsImpl(metrics, "test", builtInMetricsVersion);
-
-        context = new InternalMockProcessorContext(
-            TestUtils.tempDirectory(),
-            Serdes.String(),
-            Serdes.Long(),
-            streamsMetrics,
-            new StreamsConfig(StreamsTestUtils.getStreamsConfig()),
-            MockRecordCollector::new,
-            new ThreadCache(new LogContext("testCache "), 0, streamsMetrics)
-        );
+        final Properties props = StreamsTestUtils.getStreamsConfig();
+        props.put(StreamsConfig.BUILT_IN_METRICS_VERSION_CONFIG, builtInMetricsVersion);
+        context = new MockInternalProcessorContext(props, metrics);

Review comment:
       I didn't find a way of re-using the `MockProcessorContext`'s `StreamsMetricsImpl` instance because of this test that needs to call `Metrics#addReporter()`.
   If we find a way we can get rid of the constructor  ```MockInternalProcessorContext(Properties, Metrics)```
   
   comment: https://github.com/apache/kafka/pull/8157#discussion_r388196472




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

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