dajac commented on code in PR #12886: URL: https://github.com/apache/kafka/pull/12886#discussion_r1067001037
########## core/src/test/scala/unit/kafka/coordinator/group/GroupCoordinatorAdapterTest.scala: ########## @@ -436,4 +440,74 @@ class GroupCoordinatorAdapterTest { assertEquals(expectedResults, future.get()) } + + @ParameterizedTest + @ApiKeyVersionsSource(apiKey = ApiKeys.OFFSET_COMMIT) + def testCommitOffsets(version: Short): Unit = { + val groupCoordinator = mock(classOf[GroupCoordinator]) + val time = new MockTime() + val adapter = new GroupCoordinatorAdapter(groupCoordinator, time) + val now = time.milliseconds() + + val ctx = makeContext(ApiKeys.OFFSET_COMMIT, version) + val data = new OffsetCommitRequestData() + .setGroupId("group") + .setMemberId("member") + .setGenerationId(10) + .setRetentionTimeMs(1000) Review Comment: We could but it does not add any value as the value is just copied to OffsetAndMetadata. As explained earlier, there is not validation for this. ########## core/src/test/scala/unit/kafka/coordinator/group/GroupCoordinatorAdapterTest.scala: ########## @@ -436,4 +440,74 @@ class GroupCoordinatorAdapterTest { assertEquals(expectedResults, future.get()) } + + @ParameterizedTest + @ApiKeyVersionsSource(apiKey = ApiKeys.OFFSET_COMMIT) + def testCommitOffsets(version: Short): Unit = { + val groupCoordinator = mock(classOf[GroupCoordinator]) + val time = new MockTime() + val adapter = new GroupCoordinatorAdapter(groupCoordinator, time) + val now = time.milliseconds() + + val ctx = makeContext(ApiKeys.OFFSET_COMMIT, version) + val data = new OffsetCommitRequestData() + .setGroupId("group") + .setMemberId("member") + .setGenerationId(10) + .setRetentionTimeMs(1000) + .setTopics(List( + new OffsetCommitRequestData.OffsetCommitRequestTopic() + .setName("foo") + .setPartitions(List( + new OffsetCommitRequestData.OffsetCommitRequestPartition() + .setPartitionIndex(0) + .setCommittedOffset(100) + .setCommitTimestamp(now) Review Comment: We could but it does not add any value as the value is just copied to OffsetAndMetadata. As explained earlier, there is not validation for this. -- 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