@Test
public void machineDoesNotExist() {

    when(agentManagementService.findAgentInstance(MACHINE_ID)).thenReturn(Optional.empty());
    Result result = constraint.evaluate(createTaskRequest(TASK_ID), createVirtualMachineCurrentStateMock(MACHINE_ID), createTaskTrackerState());
    assertThat(result.isSuccessful()).isFalse();
    assertThat(result.getFailureReason()).isEqualToIgnoringCase("The machine does not exist");
}