@Test
public void testNormalWorkerComponentZeroNumberOfWorkers()
    throws IOException {

  testCommons.yarnConfig.set("hadoop.registry.dns.domain-name", "testDomain");
  TensorFlowRunJobParameters parameters = new TensorFlowRunJobParameters();
  parameters.setWorkerResource(testCommons.resource);
  parameters.setName("testJobName");
  parameters.setWorkerDockerImage("testWorkerDockerImage");
  parameters.setNumWorkers(0);
  TensorFlowWorkerComponent workerComponent =
      createWorkerComponent(parameters);
  expectedException.expect(IllegalArgumentException.class);
  expectedException.expectMessage("Number of workers should be at least 1!");
  workerComponent.createComponent();
}