@Test
public void testUpdateInstanceGroupAttributes() {

    ExtTestSubscriber<Object> testSubscriber = new ExtTestSubscriber<>();
    AgentInstanceGroup instanceGroup = instanceGroups.get(0);
    String instanceGroupId = instanceGroup.getId();
    Map<String, String> attributes = Collections.singletonMap("a", "1");
    when(agentCache.updateInstanceGroupStore(eq(instanceGroupId), any()))
            .thenReturn(Single.just(instanceGroup.toBuilder().withAttributes(attributes).build()));
    service.updateInstanceGroupAttributes(instanceGroupId, attributes).toObservable().subscribe(testSubscriber);
    verify(agentCache, times(1)).updateInstanceGroupStore(eq(instanceGroupId), any());
}