KAFKA-17833: Convert DescribeAuthorizedOperationsTest to use kraft#18252
KAFKA-17833: Convert DescribeAuthorizedOperationsTest to use kraft#18252mimaison merged 4 commits intoapache:trunkfrom
Conversation
7259a8d to
426b733
Compare
81d206d to
59066ef
Compare
|
@FrankYang0529 Could you please rebase the PR? I can help with reviews for this one. |
59066ef to
e893b81
Compare
|
@dajac Thanks. Rebased trunk. |
e893b81 to
815ce96
Compare
50da078 to
5cc93e3
Compare
Signed-off-by: PoAn Yang <payang@apache.org>
5cc93e3 to
81504b5
Compare
mimaison
left a comment
There was a problem hiding this comment.
Thanks for the PR. I left a few comments.
| return createAdminConfig(username, password, Map.of()); | ||
| } | ||
|
|
||
| private Map<String, Object> createAdminConfig(String username, String password, Map<String, Object> additionalConfigs) { |
There was a problem hiding this comment.
Not sure createAdminConfig() is the best name since this is also used to create consumer configs. What about createClientConfig() or createConfig()?
There was a problem hiding this comment.
We use alterConsumerGroupOffsets to create group, so we don't need this function. Thanks!
| private static final AccessControlEntry ALTER_ENTRY = createAccessControlEntry(JaasUtils.KAFKA_PLAIN_USER1, ALTER); | ||
| private static final AccessControlEntry DESCRIBE_ENTRY = createAccessControlEntry(JaasUtils.KAFKA_PLAIN_USER1, DESCRIBE); | ||
|
|
||
| static List<ClusterConfig> generator() { |
There was a problem hiding this comment.
Is this now the preferred approach over using @ClusterTest?
There was a problem hiding this comment.
All cases in this class use same configuration. However, ClusterTestDefaults doesn't have brokerSecurityProtocol and controllerSecurityProtocol fields, so I use ClusterTemplate to avoid defining similar configuration in each case. How about adding these fields to ClusterTestDefaults in another Jira? WDYT? Thanks.
| Consumer<Byte, Byte> consumer3 = clusterInstance.consumer(createAdminConfig(JaasUtils.KAFKA_PLAIN_ADMIN, JaasUtils.KAFKA_PLAIN_ADMIN_PASSWORD, Map.of(ConsumerConfig.GROUP_ID_CONFIG, GROUP3))) | ||
| ) { | ||
| // create consumers to avoid group not found error | ||
| consumer1.subscribe(List.of("topic1")); |
There was a problem hiding this comment.
Could we use Admin.alterConsumerGroupOffsets() to create the consumer groups?
There was a problem hiding this comment.
Updated it. Thanks.
| public void testConsumerGroupAuthorizedOperations(ClusterInstance clusterInstance) { | ||
| setupSecurity(clusterInstance); | ||
| try (Admin admin = clusterInstance.admin(createAdminConfig(JaasUtils.KAFKA_PLAIN_ADMIN, JaasUtils.KAFKA_PLAIN_ADMIN_PASSWORD))) { | ||
| assertDoesNotThrow(() -> admin.createTopics(List.of(new NewTopic("topic1", 1, (short) 1)))); |
There was a problem hiding this comment.
Do we need these assertDoesNotThrow() calls everywhere? If an exception was thrown wouldn't it automatically fail the test anyway?
There was a problem hiding this comment.
Removed useless assertDoesNotThrow. Thanks.
There was a problem hiding this comment.
There are still a bunch of assertDoesNotThrow() calls. Are they needed?
There was a problem hiding this comment.
Removed it. Thanks.
Signed-off-by: PoAn Yang <payang@apache.org>
Signed-off-by: PoAn Yang <payang@apache.org>
…18252) Reviewers: Mickael Maison <mickael.maison@gmail.com>
|
Applied to 4.0 too: b3837f8 |
|
Thanks for the review. 😄 |
…pache#18252) Reviewers: Mickael Maison <mickael.maison@gmail.com>
…pache#18252) Reviewers: Mickael Maison <mickael.maison@gmail.com>
We disabled
DescribeAuthorizedOperationsTestwhen implementing KAFKA-17614. Re-enable with a new test framework.Committer Checklist (excluded from commit message)