-
Notifications
You must be signed in to change notification settings - Fork 14.4k
MINOR: Cleanup Core Module- Scala Modules (4/n) #19805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
core/src/test/scala/unit/kafka/network/RequestChannelTest.scala
Outdated
Show resolved
Hide resolved
@@ -567,7 +567,7 @@ class AuthorizerTest extends QuorumTestHarness with BaseAuthorizerTest { | |||
val acl3 = new AclBinding(resource2, new AccessControlEntry(principal.toString, WILDCARD_HOST, DESCRIBE, ALLOW)) | |||
val acl4 = new AclBinding(prefixedResource, new AccessControlEntry(wildcardPrincipal.toString, WILDCARD_HOST, READ, ALLOW)) | |||
|
|||
authorizer1.createAcls(requestContext, List(acl1, acl2, acl3, acl4).asJava) | |||
authorizer1.createAcls(requestContext, util.List.of(acl1, acl2, acl3, acl4)) | |||
assertEquals(Set(acl1, acl2, acl3, acl4), authorizer1.acls(AclBindingFilter.ANY).asScala.toSet) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we change it to java.util.Set
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving it to Set comes with one major issue -> The ordering.
Since its a assertEquals, if the ordering is not preserved, the test will turn flaky. And I somehow am not convinced to add a load amount of lines to use HashSet.
Hey @frankvicky |
Gentle reminder @frankvicky |
Now that Kafka Brokers support Java 17, this PR makes some changes in
core module. The changes in this PR are limited to only some Scala files
in the Core module's tests. The changes mostly include:
Arrays.asList() are replaced with List.of()
with Map.of()
To be clear, the directories being targeted in this PR from unit.kafka
module:
Reviewers: TengYao Chi [email protected]