|
19 | 19 | package org.apache.pulsar.broker.admin; |
20 | 20 |
|
21 | 21 | import static org.awaitility.Awaitility.await; |
| 22 | +import com.google.common.collect.Sets; |
22 | 23 | import io.jsonwebtoken.Jwts; |
23 | 24 | import io.jsonwebtoken.SignatureAlgorithm; |
24 | 25 | import java.util.HashMap; |
25 | 26 | import java.util.Map; |
26 | 27 | import java.util.Properties; |
27 | | -import java.util.Set; |
28 | 28 | import java.util.UUID; |
29 | 29 | import javax.crypto.SecretKey; |
30 | 30 | import lombok.Cleanup; |
@@ -75,9 +75,11 @@ public final class TopicPoliciesAuthZTest extends MockedPulsarServiceBaseTest { |
75 | 75 | protected void setup() throws Exception { |
76 | 76 | conf.setAuthorizationEnabled(true); |
77 | 77 | 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)); |
79 | 79 | 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())); |
81 | 83 | // internal client |
82 | 84 | conf.setBrokerClientAuthenticationPlugin(AuthenticationToken.class.getName()); |
83 | 85 | final Map<String, String> brokerClientAuthParams = new HashMap<>(); |
@@ -192,7 +194,7 @@ public void testRetention() { |
192 | 194 | // test sub user with permissions |
193 | 195 | for (AuthAction action : AuthAction.values()) { |
194 | 196 | superUserAdmin.namespaces().grantPermissionOnNamespace("public/default", |
195 | | - subject, Set.of(action)); |
| 197 | + subject, Sets.newHashSet(action)); |
196 | 198 | try { |
197 | 199 | subAdmin.topicPolicies().getRetention(topic); |
198 | 200 | Assert.fail("unexpected behaviour"); |
|
0 commit comments