@Test
public void testPSComponentWithNullResource() throws IOException {

  TensorFlowRunJobParameters parameters = new TensorFlowRunJobParameters();
  parameters.setPsResource(null);
  TensorFlowPsComponent psComponent =
      createPsComponent(parameters);
  expectedException.expect(NullPointerException.class);
  expectedException.expectMessage("PS resource must not be null");
  psComponent.createComponent();
}