jeffkbkim commented on code in PR #16883:
URL: https://github.com/apache/kafka/pull/16883#discussion_r1718390365


##########
coordinator-common/src/test/java/org/apache/kafka/coordinator/common/runtime/SnapshottableCoordinatorTest.java:
##########
@@ -14,17 +14,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.kafka.coordinator.group.runtime;
+package org.apache.kafka.coordinator.common.runtime;
 
 import org.apache.kafka.common.TopicPartition;
 import org.apache.kafka.common.utils.LogContext;
 import org.apache.kafka.common.utils.MockTime;
-import org.apache.kafka.coordinator.group.MockCoordinatorTimer;
+import org.apache.kafka.coordinator.common.MockCoordinatorTimer;
 import org.apache.kafka.timeline.SnapshotRegistry;
 
 import org.junit.jupiter.api.Test;
 
-import static 
org.apache.kafka.coordinator.group.runtime.CoordinatorRuntimeTest.MockCoordinatorShard;

Review Comment:
   ditto here



##########
coordinator-common/src/test/java/org/apache/kafka/coordinator/common/runtime/MultiThreadedEventProcessorTest.java:
##########
@@ -45,7 +46,6 @@
 import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.mockito.ArgumentMatchers.anyLong;
 import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.mock;

Review Comment:
   any reason we're changing this?



##########
settings.gradle:
##########
@@ -57,6 +57,7 @@ include 'clients',
     'connect:runtime',
     'connect:test-plugins',
     'connect:transforms',
+    'coordinator-common',

Review Comment:
   can you help me understand what this does? my understanding is we should 
only disclose group-coordinator-api to the clients module



##########
group-coordinator/src/test/java/org/apache/kafka/coordinator/group/GroupMetadataManagerTest.java:
##########
@@ -3117,11 +3117,11 @@ public void testSessionTimeoutExpiration() {
         context.assertSessionTimeout(groupId, memberId, 45000);
 
         // Advance time past the session timeout.
-        List<ExpiredTimeout<Void, CoordinatorRecord>> timeouts = 
context.sleep(45000 + 1);
+        List<MockCoordinatorTimer.ExpiredTimeout<Void, CoordinatorRecord>> 
timeouts = context.sleep(45000 + 1);

Review Comment:
   can we import
   ```
   import 
org.apache.kafka.coordinator.group.MockCoordinatorTimer.ExpiredTimeout;
   import 
org.apache.kafka.coordinator.group.MockCoordinatorTimer.ScheduledTimeout;
   ```
   instead? some of the lines become too long



##########
coordinator-common/src/test/java/org/apache/kafka/coordinator/common/runtime/CoordinatorRuntimeTest.java:
##########
@@ -629,8 +629,8 @@ public void testScheduleLoading() {
                 .withEventProcessor(new DirectEventProcessor())
                 .withPartitionWriter(writer)
                 .withCoordinatorShardBuilderSupplier(supplier)
-                
.withCoordinatorRuntimeMetrics(mock(GroupCoordinatorRuntimeMetrics.class))
-                .withCoordinatorMetrics(mock(GroupCoordinatorMetrics.class))
+                
.withCoordinatorRuntimeMetrics(Mockito.mock(CoordinatorRuntimeMetrics.class))
+                .withCoordinatorMetrics(Mockito.mock(CoordinatorMetrics.class))

Review Comment:
   for all of the mock related changes, can't we use `import static 
org.mockito.Mockito.when;` in L103?
   



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

Reply via email to