diff --git a/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java b/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java index 9250e8c914c..c752253e51f 100644 --- a/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/autoscaling/AutoScalingHandlerTest.java @@ -284,12 +284,24 @@ public class AutoScalingHandlerTest extends SolrCloudTestCase { assertNotNull(violations); assertEquals(0, violations.size()); + String setEmptyClusterPolicyCommand = "{" + + " 'set-cluster-policy': []" + + "}"; + req = createAutoScalingRequest(SolrRequest.METHOD.POST, setEmptyClusterPolicyCommand); + response = solrClient.request(req); + assertEquals(response.get("result").toString(), "success"); + // lets create a collection which violates the rule replicas < 2 CollectionAdminRequest.Create create = CollectionAdminRequest.Create.createCollection("readApiTestViolations", CONFIGSET_NAME, 1, 6); create.setMaxShardsPerNode(10); CollectionAdminResponse adminResponse = create.process(solrClient); assertTrue(adminResponse.isSuccess()); + // reset the original cluster policy + req = createAutoScalingRequest(SolrRequest.METHOD.POST, setClusterPolicyCommand); + response = solrClient.request(req); + assertEquals(response.get("result").toString(), "success"); + // get the diagnostics output again req = createAutoScalingRequest(SolrRequest.METHOD.GET, "/diagnostics", null); response = solrClient.request(req);