@Test
public void testScaleUp() {

    ExtTestSubscriber<Object> testSubscriber = new ExtTestSubscriber<>();
    AgentInstanceGroup instanceGroup = instanceGroups.get(0);
    String instanceGroupId = instanceGroup.getId();
    when(agentCache.updateInstanceGroupStoreAndSyncCloud(eq(instanceGroupId), any()))
            .thenReturn(Single.just(instanceGroup));
    service.scaleUp(instanceGroup.getId(), 500).toObservable().subscribe(testSubscriber);
    verify(connector, times(1)).scaleUp(instanceGroup.getId(), 500);
    verify(agentCache, times(1)).updateInstanceGroupStoreAndSyncCloud(eq(instanceGroupId), any());
}