public static SubmitWorkRequestProto buildSubmitProtoRequest(String appId, int dagId, String dagName, int amPort,
      Credentials credentials) throws IOException {
    LlapDaemonProtocolProtos.QueryIdentifierProto qrId = LlapDaemonProtocolProtos.QueryIdentifierProto.newBuilder()
        .setApplicationIdString(appId)
        .setAppAttemptNumber(0)
        .setDagIndex(dagId)
        .build();
    LlapDaemonProtocolProtos.SignableVertexSpec vSpec = LlapDaemonProtocolProtos.SignableVertexSpec.newBuilder()
        .setQueryIdentifier(qrId)
        .setVertexIndex(1)
        .setDagName(dagName)
        .setHiveQueryId(dagName)
        .setVertexName("MockVertex")
        .setUser("MockUser")
        .setTokenIdentifier("MockToken_1")
        .setProcessorDescriptor(LlapDaemonProtocolProtos.EntityDescriptorProto.newBuilder().setClassName("MockProcessor").build())
        .build();
    LlapDaemonProtocolProtos.FragmentRuntimeInfo frInfo = LlapDaemonProtocolProtos.FragmentRuntimeInfo.newBuilder()
        .setDagStartTime(0)
        .setFirstAttemptStartTime(0)
        .setNumSelfAndUpstreamTasks(0)
        .setNumSelfAndUpstreamCompletedTasks(0)
        .setWithinDagPriority(1)
        .build();
    return SubmitWorkRequestProto.newBuilder()
        .setAttemptNumber(0)
        .setFragmentNumber(1)
        .setWorkSpec(LlapDaemonProtocolProtos.VertexOrBinary.newBuilder().setVertex(vSpec).build())
        .setAmHost("localhost")
        .setAmPort(amPort)
        .setCredentialsBinary(ByteString.copyFrom(LlapTezUtils.serializeCredentials(credentials)))
        .setContainerIdString("MockContainer_1")
        .setFragmentRuntimeInfo(frInfo)
        .build();
  }
Utils class for testing Llap Daemon.
llap-server/src/test/org/apache/hadoop/hive/llap/daemon/LlapDaemonTestUtils.java