You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "clolov (via GitHub)" <gi...@apache.org> on 2024/01/02 13:01:10 UTC

[PR] KAFKA-14133: Migrate activeStateManager and standbyStateManager mocks in StoreChangelogReaderTest to Mockito [kafka]

clolov opened a new pull request, #15106:
URL: https://github.com/apache/kafka/pull/15106

   This pull request takes a similar approach to how TaskManagerTest is being migrated to Mockito mock by mock for easier reviews.


-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-14133: Migrate activeStateManager and standbyStateManager mocks in StoreChangelogReaderTest to Mockito [kafka]

Posted by "lucasbru (via GitHub)" <gi...@apache.org>.
lucasbru commented on code in PR #15106:
URL: https://github.com/apache/kafka/pull/15106#discussion_r1439431364


##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/StoreChangelogReaderTest.java:
##########
@@ -642,11 +645,12 @@ public void shouldRestoreFromBeginningAndCheckCompletion() {
 
     @Test
     public void shouldCheckCompletionIfPositionLargerThanEndOffset() {
+        setupActiveStateManager();

Review Comment:
   I suppose the point of not doing this in @Before is to avoid unnecessary-mocking errors?



-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-14133: Migrate activeStateManager and standbyStateManager mocks in StoreChangelogReaderTest to Mockito [kafka]

Posted by "clolov (via GitHub)" <gi...@apache.org>.
clolov commented on code in PR #15106:
URL: https://github.com/apache/kafka/pull/15106#discussion_r1439447074


##########
streams/src/test/java/org/apache/kafka/streams/processor/internals/StoreChangelogReaderTest.java:
##########
@@ -642,11 +645,12 @@ public void shouldRestoreFromBeginningAndCheckCompletion() {
 
     @Test
     public void shouldCheckCompletionIfPositionLargerThanEndOffset() {
+        setupActiveStateManager();

Review Comment:
   Yeah, the reason for not doing it in @before is that since not all tests exercise the methods in the stubbing Mockito complains that there are unused stubs. This way we only stub in the tests where the code is exercised!



-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] KAFKA-14133: Migrate activeStateManager and standbyStateManager mocks in StoreChangelogReaderTest to Mockito [kafka]

Posted by "lucasbru (via GitHub)" <gi...@apache.org>.
lucasbru merged PR #15106:
URL: https://github.com/apache/kafka/pull/15106


-- 
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-unsubscribe@kafka.apache.org

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