@Test
public void machineTypeDoesMatch() {

    AgentInstance instance = AgentGenerator.agentInstances().getValue().toBuilder()
            .withId(MACHINE_ID)
            .withAttributes(Collections.singletonMap(MACHINE_TYPE_ATTRIBUTE_NAME, MACHINE_TYPE))
            .build();
    when(agentManagementService.findAgentInstance(MACHINE_ID)).thenReturn(Optional.of(instance));
    Result result = constraint.evaluate(createTaskRequest(TASK_ID), createVirtualMachineCurrentStateMock(MACHINE_ID), createTaskTrackerState());
    assertThat(result.isSuccessful()).isTrue();
}