@Test
public void machineIdDoesNotMatch() {

    AgentInstance instance = AgentGenerator.agentInstances().getValue().toBuilder().withId("noMatch").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 id does not match the specified id");
}