@Test
public void taintNotToleratedInConfiguration() {

    AgentInstance agentInstance = createAgentInstance(INSTANCE_ID, INSTANCE_GROUP_ID);
    when(agentManagementService.findAgentInstance(INSTANCE_ID)).thenReturn(Optional.of(agentInstance));
    V1Taint taint = createTaint("not_tolerated_taint_key", "NoSchedule", "not_tolerated_taint_value");
    V1Node node = createNode(INSTANCE_ID, true, Collections.singletonList(taint));
    when(indexer.getByKey(INSTANCE_ID)).thenReturn(node);
    ConstraintEvaluator.Result result = kubeConstraint.evaluate(
            createTaskRequest(TASK_ID),
            createVirtualMachineCurrentStateMock(INSTANCE_ID, Collections.emptyList(), Collections.emptyList()),
            taskTrackerState);
    assertThat(result.isSuccessful()).isFalse();
    assertThat(result.getFailureReason()).isEqualToIgnoringCase(KubeConstraint.TAINT_NOT_TOLERATED_IN_CONFIGURATION_REASON);
}