@Test
public void testUpdateTier() {

    ExtTestSubscriber<Object> testSubscriber = new ExtTestSubscriber<>();
    AgentInstanceGroup instanceGroup = instanceGroups.get(0);
    String instanceGroupId = instanceGroup.getId();
    when(agentCache.updateInstanceGroupStore(eq(instanceGroupId), any()))
            .thenReturn(Single.just(instanceGroup.toBuilder().withTier(Tier.Critical).build()));
    service.updateInstanceGroupTier(instanceGroupId, Tier.Critical).toObservable().subscribe(testSubscriber);
    verify(agentCache, times(1)).updateInstanceGroupStore(eq(instanceGroupId), any());
}