StatefulSetHandler { public StatefulSet getStatefulSet(ResourceConfig config, List<ImageConfiguration> images) { return new StatefulSetBuilder() .withMetadata(createStatefulSetMetaData(config)) .withSpec(createStatefulSetSpec(config, images)) .build(); } StatefulSetHandler(PodTemplateHandler podTemplateHandler); StatefulSet getStatefulSet(ResourceConfig config,
                                      List<ImageConfiguration> images);  }
@Test(expected = IllegalArgumentException.class) public void statefulSetHandlerWithInvalidNameTest() { ContainerHandler containerHandler = getContainerHandler(); PodTemplateHandler podTemplateHandler = new PodTemplateHandler(containerHandler); StatefulSetHandler statefulSetHandler = new StatefulSetHandler(podTemplateHandler); ResourceConfig config = new ResourceConfig.Builder() .imagePullPolicy("IfNotPresent") .controllerName("TesTing") .withServiceAccount("test-account") .withReplicas(5) .volumes(volumes1) .build(); statefulSetHandler.getStatefulSet(config, images); }
@Test(expected = IllegalArgumentException.class) public void statefulSetHandlerWithoutControllerTest() { ContainerHandler containerHandler = getContainerHandler(); PodTemplateHandler podTemplateHandler = new PodTemplateHandler(containerHandler); StatefulSetHandler statefulSetHandler = new StatefulSetHandler(podTemplateHandler); ResourceConfig config = new ResourceConfig.Builder() .imagePullPolicy("IfNotPresent") .withServiceAccount("test-account") .withReplicas(5) .volumes(volumes1) .build(); statefulSetHandler.getStatefulSet(config, images); }