TaskSpec registerRunningTaskAttemptWithSourceVertex(ContainerId containerId, int taskIdx) {
      TaskSpec taskSpec = createBaseTaskSpec(VERTEX_NAME2, vertexId2, taskIdx);

      InputSpec inputSpec =
          new InputSpec(VERTEX_NAME1, InputDescriptor.create("fakeInputClassName"), 3);
      List<InputSpec> inputs = Lists.newArrayList(inputSpec);

      doReturn(inputs).when(taskSpec).getInputs();

      taskCommunicator
          .registerRunningTaskAttempt(containerId, taskSpec, new HashMap<String, LocalResource>(),
              new Credentials(), false, 2);
      return taskSpec;
    }
Wrapper class which is responsible for setting up various mocks required for different tests.
llap-tez/src/test/org/apache/hadoop/hive/llap/tezplugins/TestLlapTaskCommunicator.java