@Test
public void testSetControllerAutobalancing() throws Exception {

    ControllerHelixManager mockHelixManager = EasyMock.createMock(ControllerHelixManager.class);
    AdminHelper helper = new AdminHelper(mockHelixManager);
    Map<String, PriorityQueue<InstanceTopicPartitionHolder>> instanceMap = new HashMap<>();
    PriorityQueue<InstanceTopicPartitionHolder> sjc1aTosjc1Agg1 = new PriorityQueue<>();
    String pipeline = ControllerUtils.getPipelineName("sjc1a", "sjc1-agg1");
    InstanceTopicPartitionHolder ith = new InstanceTopicPartitionHolder("compute9527-sjc1",
        new TopicPartition(pipeline, 0));
    sjc1aTosjc1Agg1.add(ith);
    instanceMap.put(pipeline, sjc1aTosjc1Agg1);
    EasyMock.expect(mockHelixManager.getPipelineToInstanceMap()).andReturn(instanceMap).atLeastOnce();
    EasyMock.expect(mockHelixManager.notifyControllerAutobalancing("compute9527-sjc1", true))
        .andReturn(true);
    EasyMock.replay(mockHelixManager);
    Map<String, Boolean> status = helper.setControllerAutobalancing("sjc1a", "sjc1-agg1", true);
    Assert.assertEquals(status.size(), 1);
    Assert.assertEquals(status.get("compute9527-sjc1"), true);
    EasyMock.verify(mockHelixManager);
}