public static LlapDaemonProtocolProtos.RegisterDagRequestProto buildRegisterDagRequest(String appId, int dagId,
      Credentials credentials) throws IOException {
    LlapDaemonProtocolProtos.QueryIdentifierProto qrId = LlapDaemonProtocolProtos.QueryIdentifierProto.newBuilder()
        .setApplicationIdString(appId)
        .setAppAttemptNumber(0)
        .setDagIndex(dagId)
        .build();
    return LlapDaemonProtocolProtos.RegisterDagRequestProto.newBuilder()
        .setQueryIdentifier(qrId)
        .setUser("MockUser")
        .setCredentialsBinary(ByteString.copyFrom(LlapTezUtils.serializeCredentials(credentials)))
        .build();
  }
Utils class for testing Llap Daemon.
llap-server/src/test/org/apache/hadoop/hive/llap/daemon/LlapDaemonTestUtils.java