This is an automated email from the ASF dual-hosted git repository.

xiangying pushed a commit to branch branch-2.10
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-2.10 by this push:
     new a585dd9bb33 [improve][test] Add test case for system topic schema not 
compatible bug. (#17992)
a585dd9bb33 is described below

commit a585dd9bb337d270dbabf0ab3d28464ff10761a3
Author: Shen Liu <[email protected]>
AuthorDate: Mon Oct 17 10:59:03 2022 +0800

    [improve][test] Add test case for system topic schema not compatible bug. 
(#17992)
    
    Co-authored-by: druidliu <[email protected]>
    (cherry picked from commit 96cc2403c8797f6fbe022c71c166337069907412)
---
 .../systopic/NamespaceEventsSystemTopicServiceTest.java     | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git 
a/pulsar-broker/src/test/java/org/apache/pulsar/broker/systopic/NamespaceEventsSystemTopicServiceTest.java
 
b/pulsar-broker/src/test/java/org/apache/pulsar/broker/systopic/NamespaceEventsSystemTopicServiceTest.java
index b680d74b86b..6115bdba04c 100644
--- 
a/pulsar-broker/src/test/java/org/apache/pulsar/broker/systopic/NamespaceEventsSystemTopicServiceTest.java
+++ 
b/pulsar-broker/src/test/java/org/apache/pulsar/broker/systopic/NamespaceEventsSystemTopicServiceTest.java
@@ -18,11 +18,14 @@
  */
 package org.apache.pulsar.broker.systopic;
 
+import static org.mockito.Mockito.mock;
 import com.google.common.collect.Sets;
 import lombok.Cleanup;
+import org.apache.bookkeeper.mledger.ManagedLedger;
 import org.apache.pulsar.broker.auth.MockedPulsarServiceBaseTest;
 import org.apache.pulsar.broker.service.BrokerService;
 import org.apache.pulsar.broker.service.persistent.PersistentTopic;
+import org.apache.pulsar.broker.service.persistent.SystemTopic;
 import org.apache.pulsar.client.admin.PulsarAdminException;
 import org.apache.pulsar.client.api.Message;
 import org.apache.pulsar.client.api.MessageId;
@@ -89,6 +92,16 @@ public class NamespaceEventsSystemTopicServiceTest extends 
MockedPulsarServiceBa
         Assert.assertEquals(SchemaCompatibilityStrategy.ALWAYS_COMPATIBLE, 
topic.getSchemaCompatibilityStrategy());
     }
 
+    @Test
+    public void testSystemTopicSchemaCompatibility() throws Exception {
+        TopicPoliciesSystemTopicClient systemTopicClientForNamespace1 = 
systemTopicFactory
+                
.createTopicPoliciesSystemTopicClient(NamespaceName.get(NAMESPACE1));
+        String topicName = 
systemTopicClientForNamespace1.getTopicName().toString();
+        SystemTopic topic = new SystemTopic(topicName, 
mock(ManagedLedger.class), pulsar.getBrokerService());
+
+        Assert.assertEquals(SchemaCompatibilityStrategy.ALWAYS_COMPATIBLE, 
topic.getSchemaCompatibilityStrategy());
+    }
+
     @Test
     public void testSendAndReceiveNamespaceEvents() throws Exception {
         TopicPoliciesSystemTopicClient systemTopicClientForNamespace1 = 
systemTopicFactory

Reply via email to