Skip to content

Commit

Permalink
[cleanup] [test] remove useless TestAuthorizationProvider2 (#22595)
Browse files Browse the repository at this point in the history
  • Loading branch information
thetumbled authored Apr 26, 2024
1 parent 69a600e commit d19860c
Showing 1 changed file with 2 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ public void testSubscriberPermission() throws Exception {
} catch (Exception e) {
// my-sub1 has no msg backlog, so expire message won't be issued on that subscription
assertTrue(e.getMessage().startsWith("Expire message by timestamp not issued on topic"));
} sub1Admin.topics().peekMessages(topicName, subscriptionName, 1);
}
sub1Admin.topics().peekMessages(topicName, subscriptionName, 1);
sub1Admin.topics().resetCursor(topicName, subscriptionName, 10);
sub1Admin.topics().resetCursor(topicName, subscriptionName, MessageId.earliest);

Expand Down Expand Up @@ -992,31 +993,6 @@ public CompletableFuture<Boolean> allowTopicOperationAsync(
}
}

/**
* This provider always fails authorization on consumer and passes on producer
*
*/
public static class TestAuthorizationProvider2 extends TestAuthorizationProvider {

@Override
public CompletableFuture<Boolean> canProduceAsync(TopicName topicName, String role,
AuthenticationDataSource authenticationData) {
return CompletableFuture.completedFuture(true);
}

@Override
public CompletableFuture<Boolean> canConsumeAsync(TopicName topicName, String role,
AuthenticationDataSource authenticationData, String subscription) {
return CompletableFuture.completedFuture(false);
}

@Override
public CompletableFuture<Boolean> canLookupAsync(TopicName topicName, String role,
AuthenticationDataSource authenticationData) {
return CompletableFuture.completedFuture(true);
}
}

public static class TestAuthorizationProviderWithSubscriptionPrefix extends TestAuthorizationProvider {
@Override
public CompletableFuture<Boolean> allowTopicOperationAsync(TopicName topic,
Expand Down

0 comments on commit d19860c

Please sign in to comment.