You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/12/21 12:43:13 UTC

[GitHub] [pulsar] codelipenghui commented on a diff in pull request #18999: [fix][admin] Fix `validatePersistencePolicies` that Namespace/Topic persistent policies cannot set to < 0

codelipenghui commented on code in PR #18999:
URL: https://github.com/apache/pulsar/pull/18999#discussion_r1054344127


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicPoliciesTest.java:
##########
@@ -18,6 +18,7 @@
  */
 package org.apache.pulsar.broker.admin;
 
+import static org.mockito.Mockito.*;

Review Comment:
   Please avoid star import.



##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/TopicPoliciesTest.java:
##########
@@ -868,6 +873,34 @@ public void testSetPersistence() throws Exception {
         consumer.close();
     }
 
+    @DataProvider(name = "incorrectPersistentPolicies")
+    public Object[][] incorrectPersistentPolicies() {
+        return new Object[][] {
+                {0, 0, 0},
+                {1, 0, 0},
+                {0, 0, 1},
+                {0, 1, 0},
+                {1, 1, 0},
+                {1, 0, 1}
+        };
+    }

Review Comment:
   Can we add to `MockedPulsarServiceBaseTest` to avoid the duplicated code?



##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/NamespacesTest.java:
##########
@@ -1155,6 +1152,29 @@ public void testPersistence() throws Exception {
         assertEquals(persistence2, persistence1);
     }
 
+    @DataProvider(name = "incorrectPersistentPolicies")
+    public Object[][] incorrectPersistentPolicies() {

Review Comment:
   ```suggestion
       @DataProvider(name = "invalidPersistentPolicies")
       public Object[][] invalidPersistentPolicies() {
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org