diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicAutoCreationTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicAutoCreationTest.java index ab2de8820439f2..7bd15992f640d8 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicAutoCreationTest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicAutoCreationTest.java @@ -23,6 +23,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertTrue; import java.net.InetSocketAddress; import java.util.List; import java.util.UUID; @@ -143,6 +144,9 @@ public void testPartitionedTopicAutoCreationForbiddenDuringNamespaceDeletion() .topic(topic) .create();) { } catch (PulsarClientException.LookupException expected) { + String msg = "Namespace bundle for topic (%s) not served by this instance"; + log.info("Expected error", expected); + assertTrue(expected.getMessage().contains(String.format(msg, topic))); } try (Consumer consumer = pulsarClient.newConsumer() @@ -150,6 +154,9 @@ public void testPartitionedTopicAutoCreationForbiddenDuringNamespaceDeletion() .subscriptionName("test") .subscribe();) { } catch (PulsarClientException.LookupException expected) { + String msg = "Namespace bundle for topic (%s) not served by this instance"; + log.info("Expected error", expected); + assertTrue(expected.getMessage().contains(String.format(msg, topic))); }