Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Zixuan Liu <[email protected]>
  • Loading branch information
nodece committed Dec 25, 2024
1 parent 8cf7b92 commit 298982a
Showing 1 changed file with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@

import static org.awaitility.Awaitility.await;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertThrows;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.expectThrows;
import org.apache.pulsar.common.naming.TopicName;
import org.apache.pulsar.tests.integration.docker.ContainerExecException;
import org.apache.pulsar.tests.integration.docker.ContainerExecResult;
import org.apache.pulsar.tests.integration.suites.PulsarCliTestSuite;
import org.testng.annotations.AfterClass;
Expand Down Expand Up @@ -142,18 +145,14 @@ public void testReplicateSubscriptionStateCmd() throws Exception {

@Test
public void testReplicateSubscriptionStateCmdWithInvalidParameters() throws Exception {
ContainerExecResult result = pulsarCluster.runAdminCommandOnAnyBroker("namespaces",
"set-replicate-subscription-state", "public/default");
assertTrue(result.getExitCode() != 0);
result = pulsarCluster.runAdminCommandOnAnyBroker("namespaces",
"set-replicate-subscription-state", "--enabled", "public/default");
assertTrue(result.getExitCode() != 0);
assertThrows(ContainerExecException.class, () -> pulsarCluster.runAdminCommandOnAnyBroker("namespaces",
"set-replicate-subscription-state", "public/default"));
assertThrows(ContainerExecException.class, () -> pulsarCluster.runAdminCommandOnAnyBroker("namespaces",
"set-replicate-subscription-state", "--enabled", "public/default"));

result = pulsarCluster.runAdminCommandOnAnyBroker("topicPolicies",
"set-replicate-subscription-state", "public/default/test");
assertTrue(result.getExitCode() != 0);
result = pulsarCluster.runAdminCommandOnAnyBroker("topicPolicies",
"set-replicate-subscription-state", "--enabled", "public/default/test");
assertTrue(result.getExitCode() != 0);
assertThrows(ContainerExecException.class, () -> pulsarCluster.runAdminCommandOnAnyBroker("topicPolicies",
"set-replicate-subscription-state", "public/default/test"));
assertThrows(ContainerExecException.class, () -> pulsarCluster.runAdminCommandOnAnyBroker("topicPolicies",
"set-replicate-subscription-state", "--enabled", "public/default/test"));
}
}

0 comments on commit 298982a

Please sign in to comment.