narendly commented on a change in pull request #849: Add REST APIs for get, 
set, update RestConfig
URL: https://github.com/apache/helix/pull/849#discussion_r391850065
 
 

 ##########
 File path: helix-core/src/test/java/org/apache/helix/TestConfigAccessor.java
 ##########
 @@ -204,4 +207,56 @@ public void testSetNonexistentParticipantConfig() throws 
Exception {
     configAccessor.close();
     System.out.println("END " + clusterName + " at " + new 
Date(System.currentTimeMillis()));
   }
+
+  @Test
+  public void testSetRestConfig() {
+    String className = TestHelper.getTestClassName();
+    String methodName = TestHelper.getTestMethodName();
+    String clusterName = className + "_" + methodName;
+
+    ZKHelixAdmin admin = new ZKHelixAdmin(ZK_ADDR);
+    admin.addCluster(clusterName, true);
+    ConfigAccessor configAccessor = new ConfigAccessor(ZK_ADDR);
+    HelixConfigScope scope = new 
HelixConfigScopeBuilder(ConfigScopeProperty.REST).forCluster(clusterName).build();
+    Assert.assertNull(configAccessor.getRESTConfig(clusterName));
+
+    RESTConfig restConfig = new RESTConfig(clusterName);
+    restConfig.set(RESTConfig.SimpleFields.CUSTOMIZED_HEALTH_URL, "TEST_URL");
+    configAccessor.setRESTConfig(clusterName, restConfig);
+    Assert.assertEquals(restConfig, configAccessor.getRESTConfig(clusterName));
+  }
+
+  @Test (expectedExceptions = HelixException.class)
 
 Review comment:
   Could you mark it clearly where the exception should be expected? Because 
it's not often easy to tell, I prefer the style of 
   
   ```
   try {
   //your logic
   Assert.fail("Exception expected!");
   catch (exception) {
   // Exception expected..
   }
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to