You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by lh...@apache.org on 2024/04/26 11:21:52 UTC
(pulsar) branch master updated: [cleanup] [test] remove useless TestAuthorizationProvider2 (#22595)
This is an automated email from the ASF dual-hosted git repository.
lhotari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/master by this push:
new d19860c706e [cleanup] [test] remove useless TestAuthorizationProvider2 (#22595)
d19860c706e is described below
commit d19860c706e47b3f2525678da5edfad3f6adafd1
Author: thetumbled <52...@users.noreply.github.com>
AuthorDate: Fri Apr 26 19:21:45 2024 +0800
[cleanup] [test] remove useless TestAuthorizationProvider2 (#22595)
---
.../api/AuthorizationProducerConsumerTest.java | 28 ++--------------------
1 file changed, 2 insertions(+), 26 deletions(-)
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/AuthorizationProducerConsumerTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/AuthorizationProducerConsumerTest.java
index 3ead51ad7fc..2638709abc5 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/AuthorizationProducerConsumerTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/AuthorizationProducerConsumerTest.java
@@ -350,7 +350,8 @@ public class AuthorizationProducerConsumerTest extends ProducerConsumerBase {
} 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);
@@ -992,31 +993,6 @@ public class AuthorizationProducerConsumerTest extends ProducerConsumerBase {
}
}
- /**
- * 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,