mattisonchao commented on a change in pull request #13970:
URL: https://github.com/apache/pulsar/pull/13970#discussion_r794990654



##########
File path: 
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/NamespacesTest.java
##########
@@ -1748,4 +1738,26 @@ private void 
assertInvalidRetentionPolicyAsPartOfAllPolicies(Policies policies,
             assertTrue(e.getMessage().startsWith("Invalid retention policy"));
         }
     }
+
+    @Test
+    public void testNamespaceResourceGroup() {
+        String namespace = BrokerTestUtil.newUniqueName(this.testTenant + 
"/namespace");
+        ResourceGroup testResourceGroup = new ResourceGroup();
+        testResourceGroup.setDispatchRateInBytes(10000L);
+        testResourceGroup.setDispatchRateInMsgs(100);
+        testResourceGroup.setPublishRateInMsgs(100);
+        testResourceGroup.setPublishRateInBytes(10000L);
+        final String resourceGroupName = "test-resource-group";
+        try {
+            admin.resourcegroups().createResourceGroup(resourceGroupName, 
testResourceGroup);
+            admin.namespaces().createNamespace(namespace);
+            admin.namespaces().setNamespaceResourceGroup(namespace, 
resourceGroupName);
+            String namespaceResourceGroup = 
admin.namespaces().getNamespaceResourceGroup(namespace);
+            assertEquals(namespaceResourceGroup, resourceGroupName);
+            admin.namespaces().removeNamespaceResourceGroup(namespace);
+            
assertTrue(StringUtils.isBlank(admin.namespaces().getNamespaceResourceGroup(namespace)));
+        } catch (PulsarAdminException e) {

Review comment:
       done.




-- 
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-unsubscr...@pulsar.apache.org

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


Reply via email to