dajac commented on code in PR #12181:
URL: https://github.com/apache/kafka/pull/12181#discussion_r893369165
##########
metadata/src/test/java/org/apache/kafka/controller/ReplicationControlManagerTest.java:
##########
@@ -857,26 +869,68 @@ public void testShrinkAndExpandIsr() throws Exception {
new int[][] {new int[] {0, 1, 2}});
TopicIdPartition topicIdPartition = new
TopicIdPartition(createTopicResult.topicId(), 0);
- TopicPartition topicPartition = new TopicPartition("foo", 0);
assertEquals(OptionalInt.of(0), ctx.currentLeader(topicIdPartition));
long brokerEpoch = ctx.currentBrokerEpoch(0);
PartitionData shrinkIsrRequest = newAlterPartition(
replicationControl, topicIdPartition, asList(0, 1),
LeaderRecoveryState.RECOVERED);
- ControllerResult<AlterPartitionResponseData> shrinkIsrResult =
sendAlterIsr(
- replicationControl, 0, brokerEpoch, "foo", shrinkIsrRequest);
+ ControllerResult<AlterPartitionResponseData> shrinkIsrResult =
sendAlterPartition(
+ replicationControl, 0, brokerEpoch, topicIdPartition.topicId(),
shrinkIsrRequest);
AlterPartitionResponseData.PartitionData shrinkIsrResponse =
assertAlterPartitionResponse(
- shrinkIsrResult, topicPartition, NONE);
+ shrinkIsrResult, topicIdPartition, NONE);
assertConsistentAlterPartitionResponse(replicationControl,
topicIdPartition, shrinkIsrResponse);
PartitionData expandIsrRequest = newAlterPartition(
replicationControl, topicIdPartition, asList(0, 1, 2),
LeaderRecoveryState.RECOVERED);
- ControllerResult<AlterPartitionResponseData> expandIsrResult =
sendAlterIsr(
- replicationControl, 0, brokerEpoch, "foo", expandIsrRequest);
+ ControllerResult<AlterPartitionResponseData> expandIsrResult =
sendAlterPartition(
+ replicationControl, 0, brokerEpoch, topicIdPartition.topicId(),
expandIsrRequest);
AlterPartitionResponseData.PartitionData expandIsrResponse =
assertAlterPartitionResponse(
- expandIsrResult, topicPartition, NONE);
+ expandIsrResult, topicIdPartition, NONE);
assertConsistentAlterPartitionResponse(replicationControl,
topicIdPartition, expandIsrResponse);
}
+ @ParameterizedTest
+ @ApiKeyVersionsSource(apiKey = ApiKeys.ALTER_PARTITION)
+ public void testAlterPartitionHandleUnknownTopicIdOrName(short version)
throws Exception {
Review Comment:
We do have a new test case for this in testAlterPartitionErrors, if I
understood you correctly.
```
assertAlterPartition(
partitionError = Errors.UNKNOWN_TOPIC_ID,
topicPartition = tp,
topicIdOpt = Some(Uuid.randomUuid())
)
```
Is this what you had in mind?
--
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]