@Test
public void testKubeBackendAffinity() {

    Pair<V1Affinity, Map<String, String>> affinityWithAnnotations = factory.buildV1Affinity(
            newJobWithHardConstraint(JobConstraints.KUBE_BACKEND, "kublet"), JobGenerator.oneBatchTask()
    );
    V1NodeSelector nodeSelector = affinityWithAnnotations.getLeft().getNodeAffinity().getRequiredDuringSchedulingIgnoredDuringExecution();
    assertThat(nodeSelector.getNodeSelectorTerms()).hasSize(1);
    V1NodeSelectorRequirement requirement = nodeSelector.getNodeSelectorTerms().get(0).getMatchExpressions().get(0);
    assertThat(requirement.getKey()).isEqualTo(KubeConstants.TAINT_KUBE_BACKEND);
    assertThat(requirement.getValues()).contains("kublet");
}