divijvaidya commented on code in PR #14410:
URL: https://github.com/apache/kafka/pull/14410#discussion_r1366795800


##########
streams/src/test/java/org/apache/kafka/streams/state/internals/GlobalStateStoreProviderTest.java:
##########
@@ -105,28 +105,19 @@ public void before() {
                 Serdes.String(),
                 Serdes.String()).build());
 
-        final ProcessorContextImpl mockContext = 
niceMock(ProcessorContextImpl.class);
-        expect(mockContext.applicationId()).andStubReturn("appId");
-        expect(mockContext.metrics())
-            .andStubReturn(
+        final ProcessorContextImpl mockContext = 
mock(ProcessorContextImpl.class);
+        when(mockContext.applicationId()).thenReturn("appId");
+        when(mockContext.metrics())
+            .thenReturn(
                 new StreamsMetricsImpl(new Metrics(), "threadName", 
StreamsConfig.METRICS_LATEST, new MockTime())
             );
-        expect(mockContext.taskId()).andStubReturn(new TaskId(0, 0));
-        expect(mockContext.recordCollector()).andStubReturn(null);

Review Comment:
   Why aren't we stubbing this method to return null after moving to powermock?



##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/StreamsProducerTest.java:
##########
@@ -1173,17 +1126,13 @@ public void 
shouldResetTransactionInitializedOnResetProducer() {
         );
         streamsProducer.initTransaction();
 
-        reset(mockedProducer);
-        mockedProducer.close();
-        mockedProducer.initTransactions();

Review Comment:
   Correct me if I am wrong but easymock expected 
`mockedProducer.initTransactions();` to occur only one time reflected by 
expectLastCall() but it seems like it is being called twice for us when we 
moved to powermock. I am curious how was it working before?



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