From 2dbe73c975fc522477f37a07f1f2d1537fc498d2 Mon Sep 17 00:00:00 2001 From: ran Date: Thu, 19 Dec 2024 10:21:40 +0800 Subject: [PATCH] remove useless check in tests (#1471) (cherry picked from commit 9e686d482252eebba320708ed27a44cbd56feba2) --- .../pulsar/handlers/amqp/AmqpProtocolHandlerTestBase.java | 6 ------ .../io/streamnative/pulsar/handlers/amqp/AmqpTestBase.java | 2 -- .../pulsar/handlers/amqp/qpid/core/AoPBrokerAdmin.java | 2 -- .../test/java/com/rabbitmq/client/test/BrokerTestCase.java | 1 - .../pulsar/handlers/amqp/AmqpProtocolHandlerTestBase.java | 6 ------ .../io/streamnative/pulsar/handlers/amqp/AmqpTestBase.java | 2 -- .../handlers/amqp/AmqpTokenAuthenticationTestBase.java | 2 -- 7 files changed, 21 deletions(-) diff --git a/tests-qpid-jms-client/src/test/java/io/streamnative/pulsar/handlers/amqp/AmqpProtocolHandlerTestBase.java b/tests-qpid-jms-client/src/test/java/io/streamnative/pulsar/handlers/amqp/AmqpProtocolHandlerTestBase.java index 921a7ef6..299dff8b 100644 --- a/tests-qpid-jms-client/src/test/java/io/streamnative/pulsar/handlers/amqp/AmqpProtocolHandlerTestBase.java +++ b/tests-qpid-jms-client/src/test/java/io/streamnative/pulsar/handlers/amqp/AmqpProtocolHandlerTestBase.java @@ -374,12 +374,6 @@ public static void setFieldValue(Class clazz, Object classObj, String fieldName, field.set(classObj, fieldValue); } - public void checkPulsarServiceState() { - for (PulsarService pulsarService : pulsarServiceList) { - Mockito.when(pulsarService.getState()).thenReturn(PulsarService.State.Started); - } - } - /** * Get available proxy port. * @return random proxy port diff --git a/tests-qpid-jms-client/src/test/java/io/streamnative/pulsar/handlers/amqp/AmqpTestBase.java b/tests-qpid-jms-client/src/test/java/io/streamnative/pulsar/handlers/amqp/AmqpTestBase.java index 60169f27..3518d36b 100644 --- a/tests-qpid-jms-client/src/test/java/io/streamnative/pulsar/handlers/amqp/AmqpTestBase.java +++ b/tests-qpid-jms-client/src/test/java/io/streamnative/pulsar/handlers/amqp/AmqpTestBase.java @@ -68,8 +68,6 @@ public void setup() throws Exception { NamespaceName.get(ns), "__lookup__").toString()); } } - - checkPulsarServiceState(); } @AfterClass diff --git a/tests-qpid-jms-client/src/test/java/io/streamnative/pulsar/handlers/amqp/qpid/core/AoPBrokerAdmin.java b/tests-qpid-jms-client/src/test/java/io/streamnative/pulsar/handlers/amqp/qpid/core/AoPBrokerAdmin.java index 533e1e71..edd78c21 100644 --- a/tests-qpid-jms-client/src/test/java/io/streamnative/pulsar/handlers/amqp/qpid/core/AoPBrokerAdmin.java +++ b/tests-qpid-jms-client/src/test/java/io/streamnative/pulsar/handlers/amqp/qpid/core/AoPBrokerAdmin.java @@ -70,8 +70,6 @@ protected void setup() throws Exception { NamespaceName.get(ns), "__lookup__").toString()); } } - - checkPulsarServiceState(); } @Override diff --git a/tests/src/test/java/com/rabbitmq/client/test/BrokerTestCase.java b/tests/src/test/java/com/rabbitmq/client/test/BrokerTestCase.java index c3ebeef8..abcc3f6f 100644 --- a/tests/src/test/java/com/rabbitmq/client/test/BrokerTestCase.java +++ b/tests/src/test/java/com/rabbitmq/client/test/BrokerTestCase.java @@ -126,7 +126,6 @@ public void setup() throws Exception { } ((PulsarClientImpl) getPulsarServiceList().get(0).getClient()).getLookup(). getBroker(TopicName.get("public/vhost1/test")).join(); - checkPulsarServiceState(); assumeTrue(shouldRun()); openConnection(); openChannel(); diff --git a/tests/src/test/java/io/streamnative/pulsar/handlers/amqp/AmqpProtocolHandlerTestBase.java b/tests/src/test/java/io/streamnative/pulsar/handlers/amqp/AmqpProtocolHandlerTestBase.java index 0ea3ae9f..83dc0a40 100644 --- a/tests/src/test/java/io/streamnative/pulsar/handlers/amqp/AmqpProtocolHandlerTestBase.java +++ b/tests/src/test/java/io/streamnative/pulsar/handlers/amqp/AmqpProtocolHandlerTestBase.java @@ -401,12 +401,6 @@ public static void setFieldValue(Class clazz, Object classObj, String fieldName, field.set(classObj, fieldValue); } - public void checkPulsarServiceState() { - for (PulsarService pulsarService : pulsarServiceList) { - doReturn(PulsarService.State.Started).when(pulsarService).getState(); - } - } - /** * Get available proxy port. * @return random proxy port diff --git a/tests/src/test/java/io/streamnative/pulsar/handlers/amqp/AmqpTestBase.java b/tests/src/test/java/io/streamnative/pulsar/handlers/amqp/AmqpTestBase.java index e5341c23..76af5bea 100644 --- a/tests/src/test/java/io/streamnative/pulsar/handlers/amqp/AmqpTestBase.java +++ b/tests/src/test/java/io/streamnative/pulsar/handlers/amqp/AmqpTestBase.java @@ -83,8 +83,6 @@ public void setup() throws Exception { NamespaceName.get(ns), "__lookup__").toString()); } } - - checkPulsarServiceState(); } @AfterClass diff --git a/tests/src/test/java/io/streamnative/pulsar/handlers/amqp/AmqpTokenAuthenticationTestBase.java b/tests/src/test/java/io/streamnative/pulsar/handlers/amqp/AmqpTokenAuthenticationTestBase.java index 03031f8d..276e9925 100644 --- a/tests/src/test/java/io/streamnative/pulsar/handlers/amqp/AmqpTokenAuthenticationTestBase.java +++ b/tests/src/test/java/io/streamnative/pulsar/handlers/amqp/AmqpTokenAuthenticationTestBase.java @@ -93,8 +93,6 @@ public void setup() throws Exception { NamespaceName.get(ns), "__lookup__").toString()); } } - - checkPulsarServiceState(); } @AfterClass