Skip to content

Commit

Permalink
Fix #22163 cherry-picking problem
Browse files Browse the repository at this point in the history
  • Loading branch information
mattisonchao committed Mar 4, 2024
1 parent 0256117 commit 4b5dba7
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
package org.apache.pulsar.broker.admin;

import static org.awaitility.Awaitility.await;
import com.google.common.collect.Sets;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.UUID;
import javax.crypto.SecretKey;
import lombok.Cleanup;
Expand Down Expand Up @@ -75,9 +75,11 @@ public final class TopicPoliciesAuthZTest extends MockedPulsarServiceBaseTest {
protected void setup() throws Exception {
conf.setAuthorizationEnabled(true);
conf.setAuthorizationProvider(PulsarAuthorizationProvider.class.getName());
conf.setSuperUserRoles(Set.of(SUPER_USER_SUBJECT, BROKER_INTERNAL_CLIENT_SUBJECT));
conf.setSuperUserRoles(Sets.newHashSet(SUPER_USER_SUBJECT, BROKER_INTERNAL_CLIENT_SUBJECT));
conf.setAuthenticationEnabled(true);
conf.setAuthenticationProviders(Set.of(AuthenticationProviderToken.class.getName()));
conf.setSystemTopicEnabled(true);
conf.setTopicLevelPoliciesEnabled(true);
conf.setAuthenticationProviders(Sets.newHashSet(AuthenticationProviderToken.class.getName()));
// internal client
conf.setBrokerClientAuthenticationPlugin(AuthenticationToken.class.getName());
final Map<String, String> brokerClientAuthParams = new HashMap<>();
Expand Down Expand Up @@ -192,7 +194,7 @@ public void testRetention() {
// test sub user with permissions
for (AuthAction action : AuthAction.values()) {
superUserAdmin.namespaces().grantPermissionOnNamespace("public/default",
subject, Set.of(action));
subject, Sets.newHashSet(action));
try {
subAdmin.topicPolicies().getRetention(topic);
Assert.fail("unexpected behaviour");
Expand Down

0 comments on commit 4b5dba7

Please sign in to comment.