Skip to content
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

[cleanup] [test] remove useless TestAuthorizationProvider2 #22595

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,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 @@ -990,31 +991,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
Loading