@Test
public void instanceGroupNotFound() {

    AgentInstance instance = createAgentInstance("");
    when(agentManagementService.findAgentInstance(INSTANCE_ID)).thenReturn(Optional.of(instance));
    Result result = agentManagementConstraint.evaluate(createTaskRequest(),
            createVirtualMachineCurrentStateMock(INSTANCE_ID), mock(TaskTrackerState.class));
    assertThat(result.isSuccessful()).isFalse();
    assertThat(result.getFailureReason()).isEqualToIgnoringCase("Instance group not found");
}