@Test
public void machineGroupDoesExist() {

    AgentInstance instance = AgentGenerator.agentInstances().getValue().toBuilder().withId(MACHINE_ID).withInstanceGroupId("").build();
    when(agentManagementService.findAgentInstance(MACHINE_ID)).thenReturn(Optional.of(instance));
    Result result = constraint.evaluate(createTaskRequest(TASK_ID), createVirtualMachineCurrentStateMock(MACHINE_ID), createTaskTrackerState());
    assertThat(result.isSuccessful()).isFalse();
    assertThat(result.getFailureReason()).isEqualToIgnoringCase("The machine group does not exist");
}