JobHandler { public Job getJob(ResourceConfig config, List<ImageConfiguration> images) { return new JobBuilder() .withMetadata(createJobSpecMetaData(config)) .withSpec(createJobSpec(config, images)) .build(); } JobHandler(PodTemplateHandler podTemplateHandler); Job getJob(ResourceConfig config,
                      List<ImageConfiguration> images);  }
@Test(expected = IllegalArgumentException.class) public void daemonTemplateHandlerWithInvalidNameTest() { ContainerHandler containerHandler = getContainerHandler(); PodTemplateHandler podTemplateHandler = new PodTemplateHandler(containerHandler); JobHandler jobHandler = new JobHandler(podTemplateHandler); ResourceConfig config = new ResourceConfig.Builder() .imagePullPolicy("IfNotPresent") .controllerName("TesTing") .withServiceAccount("test-account") .volumes(volumes1) .build(); jobHandler.getJob(config, images); }
@Test(expected = IllegalArgumentException.class) public void daemonTemplateHandlerWithoutControllerTest() { ContainerHandler containerHandler = getContainerHandler(); PodTemplateHandler podTemplateHandler = new PodTemplateHandler(containerHandler); JobHandler jobHandler = new JobHandler(podTemplateHandler); ResourceConfig config = new ResourceConfig.Builder() .imagePullPolicy("IfNotPresent") .withServiceAccount("test-account") .volumes(volumes1) .build(); jobHandler.getJob(config, images); }