dajac commented on code in PR #14845: URL: https://github.com/apache/kafka/pull/14845#discussion_r1415299461
########## group-coordinator/src/test/java/org/apache/kafka/coordinator/group/GroupCoordinatorServiceTest.java: ########## @@ -1615,4 +1618,127 @@ public void testDeleteGroupsWhenNotStarted() throws ExecutionException, Interrup future.get() ); } + + @Test + public void testCommitTransactionalOffsetsWhenNotStarted() throws ExecutionException, InterruptedException { + CoordinatorRuntime<GroupCoordinatorShard, Record> runtime = mockRuntime(); + GroupCoordinatorService service = new GroupCoordinatorService( + new LogContext(), + createConfig(), + runtime, + new GroupCoordinatorMetrics() + ); + + TxnOffsetCommitRequestData request = new TxnOffsetCommitRequestData() + .setGroupId("foo") + .setTransactionalId("transactional-id") + .setMemberId("member-id") + .setGenerationId(10) + .setTopics(Collections.singletonList(new TxnOffsetCommitRequestData.TxnOffsetCommitRequestTopic() + .setName("topic") + .setPartitions(Collections.singletonList(new TxnOffsetCommitRequestData.TxnOffsetCommitRequestPartition() + .setPartitionIndex(0) + .setCommittedOffset(100))))); + + CompletableFuture<TxnOffsetCommitResponseData> future = service.commitTransactionalOffsets( + requestContext(ApiKeys.TXN_OFFSET_COMMIT), + request, + BufferSupplier.NO_CACHING + ); + + assertEquals( + new TxnOffsetCommitResponseData() + .setTopics(Collections.singletonList(new TxnOffsetCommitResponseData.TxnOffsetCommitResponseTopic() + .setName("topic") + .setPartitions(Collections.singletonList(new TxnOffsetCommitResponseData.TxnOffsetCommitResponsePartition() + .setPartitionIndex(0) + .setErrorCode(Errors.COORDINATOR_NOT_AVAILABLE.code()))))), + future.get() + ); + } + + @ParameterizedTest + @NullSource Review Comment: That's right. -- 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