MINOR: Move CreateTopicsRequestTest to clients-integration-tests and rewrite in Java#22105
Merged
chia7712 merged 2 commits intoapache:trunkfrom Apr 22, 2026
Merged
Conversation
m1a2st
reviewed
Apr 21, 2026
Collaborator
m1a2st
left a comment
There was a problem hiding this comment.
Thanks for this patch, left some comments
| assertFalse(response.errorCounts().keySet().stream().anyMatch(e -> e.code() > 0), | ||
| "There should be no errors, found " + response.errorCounts().keySet()); | ||
|
|
||
| KafkaConfig brokerConfig = cluster.brokers().values().iterator().next().config(); |
Collaborator
There was a problem hiding this comment.
How about using serverProperties to avoid relying on Scala KafkaConfig?
int defaultPartitions = defaultNumPartitions(cluster);
int defaultReplicationFactor = defaultReplicationFactor(cluster);
private static int defaultNumPartitions(ClusterInstance cluster) {
return Integer.parseInt(cluster.config().serverProperties()
.getOrDefault(ServerLogConfigs.NUM_PARTITIONS_CONFIG, "1"));
}
private static int defaultReplicationFactor(ClusterInstance cluster) {
return Integer.parseInt(cluster.config().serverProperties()
.getOrDefault(ReplicationConfigs.DEFAULT_REPLICATION_FACTOR_CONFIG, "1"));
}
Contributor
Author
There was a problem hiding this comment.
Thanks for pointing it out! Scala dependencies should be avoided here. Updated.
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.apache.kafka.clients.admin; |
Collaborator
There was a problem hiding this comment.
It’s a bit odd to place this test in the admin package since it doesn’t use the Admin client.
Contributor
Author
There was a problem hiding this comment.
Good catch, thanks! Moved to org.apache.kafka.clients.
chia7712
approved these changes
Apr 22, 2026
| assignment.forEach((partitionIndex, brokerIdList) -> | ||
| effectiveAssignments.add(new CreatableReplicaAssignment() | ||
| .setPartitionIndex(partitionIndex) | ||
| .setBrokerIds(new ArrayList<>(brokerIdList)))); |
Member
There was a problem hiding this comment.
We could use List.copyOf here for better immutability. Let's keep it in mind for next time!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rewrite
CreateTopicsRequestTestin Java and move it from core toclients-integration-tests.Reviewers: Ken Huang s7133700@gmail.com, Chia-Ping Tsai
chia7712@gmail.com