@Test
  public void testAddCredentialsWithCredentialSupplierNewTokenAdded() {
    IncrementalIntDagCredentialSupplier supplier = new IncrementalIntDagCredentialSupplier();
    DagUtils dagUtils = new DagUtils(Collections.singletonList(supplier));
    DAG dag = DAG.create("test_credentials_dag");

    dagUtils.addCredentials(mock(MapWork.class), dag, null);
    Token<?> newToken = dag.getCredentials().getToken(supplier.getTokenAlias());
    assertEquals(String.valueOf(1), new String(newToken.getIdentifier()));
  }
Tests for {@link DagUtils} where {@link UserGroupInformation#isSecurityEnabled()} is true.
ql/src/test/org/apache/hadoop/hive/ql/exec/tez/TestDagUtilsSecurityEnabled.java