StatefulSetHandler { StatefulSetHandler(PodTemplateHandler podTemplateHandler) { this.podTemplateHandler = podTemplateHandler; } StatefulSetHandler(PodTemplateHandler podTemplateHandler); StatefulSet getStatefulSet(ResourceConfig config,
                                      List<ImageConfiguration> images);  }
@Test public void statefulSetHandlerTest() { 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(); StatefulSet statefulSet = statefulSetHandler.getStatefulSet(config,images); assertNotNull(statefulSet.getSpec()); assertNotNull(statefulSet.getMetadata()); assertEquals(5,statefulSet.getSpec().getReplicas().intValue()); assertNotNull(statefulSet.getSpec().getTemplate()); assertEquals("testing",statefulSet.getMetadata().getName()); assertEquals("testing",statefulSet.getSpec().getServiceName()); assertEquals("test-account",statefulSet.getSpec().getTemplate() .getSpec().getServiceAccountName()); assertFalse(statefulSet.getSpec().getTemplate().getSpec().getVolumes().isEmpty()); assertEquals("test",statefulSet.getSpec().getTemplate().getSpec(). getVolumes().get(0).getName()); assertEquals("/test/path",statefulSet.getSpec().getTemplate() .getSpec().getVolumes().get(0).getHostPath().getPath()); assertNotNull(statefulSet.getSpec().getTemplate().getSpec().getContainers()); }