@Test
public void testDirectRefresh() throws Exception {

    setupMocksForApp(1, 1, CRITICAL_APP, FLEX_APP);
    // Refresh
    ExtTestSubscriber<Void> replySubscriber = new ExtTestSubscriber<>();
    capacityMonitoringService.refresh().subscribe(replySubscriber);
    // Check that agentManagementService is triggered correctly
    testScheduler.triggerActions();
    verify(agentManagementService, times(1))
            .updateCapacity(CRITICAL_INSTANCE_GROUP_ID, Optional.of(1), Optional.empty());
    verify(agentManagementService, times(0))
            .updateCapacity(FLEX_INSTANCE_GROUP_ID, Optional.of(1), Optional.empty());
    replySubscriber.assertOnCompleted();
}