@Test
public void testResolver() {

    String node1Name = "node1";
    String node2Name = "node2";
    V1Node node1 = newNode(node1Name);
    V1Node node2 = newNode(node2Name);
    KubeApiFacade kubeApiFacade = TestDataFactory.mockKubeApiFacade(node1, node2);
    KubernetesNodeDataResolver resolver = new KubernetesNodeDataResolver(configuration, kubeApiFacade, node -> true);
    Map<String, Node> resolved = resolver.resolve();
    assertThat(resolved).hasSize(2);
    // Nothing is flagged yet
    assertThat(resolver.resolve().get(node1Name).isRelocationRequired()).isFalse();
    assertThat(resolver.resolve().get(node1Name).isRelocationRequiredImmediately()).isFalse();
    assertThat(resolver.resolve().get(node1Name).isRelocationNotAllowed()).isFalse();
    assertThat(resolver.resolve().get(node1Name).isInBadCondition()).isFalse();
    // Tag one as removable
    addNodeTaint(node1, "required.titus.com/decommissioning", "true", TAINT_EFFECT_NO_EXECUTE);
    node1.getMetadata().getLabels().put(RelocationAttributes.RELOCATION_REQUIRED, "true");
    assertThat(resolver.resolve().get(node1Name).isRelocationRequired()).isTrue();
    assertThat(resolver.resolve().get(node1Name).isRelocationRequiredImmediately()).isFalse();
    assertThat(resolver.resolve().get(node1Name).isRelocationNotAllowed()).isFalse();
    // Now removable immediately
    addNodeTaint(node1, "immediately.titus.com/decommissioning", "true", TAINT_EFFECT_NO_EXECUTE);
    assertThat(resolver.resolve().get(node1Name).isRelocationRequiredImmediately()).isTrue();
    assertThat(resolver.resolve().get(node1Name).isRelocationNotAllowed()).isFalse();
    // bad memory condition = True
    addNodeCondition(node2, "CorrectableMemoryFailure", "True");
    assertThat(resolver.resolve().get(node2Name)).isNotNull();
    assertThat(resolver.resolve().get(node2Name).isInBadCondition()).isTrue();
    // bad memory condition = False
    addNodeCondition(node1, "CorrectableMemoryFailure", "False");
    assertThat(resolver.resolve().get(node1Name)).isNotNull();
    assertThat(resolver.resolve().get(node1Name).isInBadCondition()).isFalse();
}