@Test
public void testTensorBoardComponent() throws IOException {

  testCommons.yarnConfig.set("hadoop.registry.dns.domain-name", "testDomain");
  TensorFlowRunJobParameters parameters = new TensorFlowRunJobParameters();
  parameters.setTensorboardResource(testCommons.resource);
  parameters.setName("testJobName");
  parameters.setTensorboardDockerImage("testTBDockerImage");
  TensorBoardComponent tensorBoardComponent =
      createTensorBoardComponent(parameters);
  Component component = tensorBoardComponent.createComponent();
  assertEquals(testCommons.role.getComponentName(), component.getName());
  testCommons.verifyCommonConfigEnvs(component);
  assertEquals(1L, (long) component.getNumberOfContainers());
  assertEquals(RestartPolicyEnum.NEVER, component.getRestartPolicy());
  testCommons.verifyResources(component);
  assertEquals(
      new Artifact().type(Artifact.TypeEnum.DOCKER).id("testTBDockerImage"),
      component.getArtifact());
  assertEquals(String.format(
      "http://tensorboard-0.testJobName.%s" + ".testDomain:6006",
      testCommons.userName),
      tensorBoardComponent.getTensorboardLink());
  assertEquals("./run-TENSORBOARD.sh", component.getLaunchCommand());
  verify(testCommons.fsOperations)
      .uploadToRemoteFileAndLocalizeToContainerWorkDir(
      any(Path.class), eq("mockScript"), eq("run-TENSORBOARD.sh"),
      eq(component));
}