Skip to content

Commit 4b5dba7

Browse files
committed
Fix apache#22163 cherry-picking problem
1 parent 0256117 commit 4b5dba7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicPoliciesAuthZTest.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
package org.apache.pulsar.broker.admin;
2020

2121
import static org.awaitility.Awaitility.await;
22+
import com.google.common.collect.Sets;
2223
import io.jsonwebtoken.Jwts;
2324
import io.jsonwebtoken.SignatureAlgorithm;
2425
import java.util.HashMap;
2526
import java.util.Map;
2627
import java.util.Properties;
27-
import java.util.Set;
2828
import java.util.UUID;
2929
import javax.crypto.SecretKey;
3030
import lombok.Cleanup;
@@ -75,9 +75,11 @@ public final class TopicPoliciesAuthZTest extends MockedPulsarServiceBaseTest {
7575
protected void setup() throws Exception {
7676
conf.setAuthorizationEnabled(true);
7777
conf.setAuthorizationProvider(PulsarAuthorizationProvider.class.getName());
78-
conf.setSuperUserRoles(Set.of(SUPER_USER_SUBJECT, BROKER_INTERNAL_CLIENT_SUBJECT));
78+
conf.setSuperUserRoles(Sets.newHashSet(SUPER_USER_SUBJECT, BROKER_INTERNAL_CLIENT_SUBJECT));
7979
conf.setAuthenticationEnabled(true);
80-
conf.setAuthenticationProviders(Set.of(AuthenticationProviderToken.class.getName()));
80+
conf.setSystemTopicEnabled(true);
81+
conf.setTopicLevelPoliciesEnabled(true);
82+
conf.setAuthenticationProviders(Sets.newHashSet(AuthenticationProviderToken.class.getName()));
8183
// internal client
8284
conf.setBrokerClientAuthenticationPlugin(AuthenticationToken.class.getName());
8385
final Map<String, String> brokerClientAuthParams = new HashMap<>();
@@ -192,7 +194,7 @@ public void testRetention() {
192194
// test sub user with permissions
193195
for (AuthAction action : AuthAction.values()) {
194196
superUserAdmin.namespaces().grantPermissionOnNamespace("public/default",
195-
subject, Set.of(action));
197+
subject, Sets.newHashSet(action));
196198
try {
197199
subAdmin.topicPolicies().getRetention(topic);
198200
Assert.fail("unexpected behaviour");

0 commit comments

Comments
 (0)