ReplicaSetHandler { public ReplicaSet getReplicaSet(ResourceConfig config, List<ImageConfiguration> images) { return new ReplicaSetBuilder() .withMetadata(createRsMetaData(config)) .withSpec(createRsSpec(config, images)) .build(); } ReplicaSetHandler(PodTemplateHandler podTemplateHandler); ReplicaSet getReplicaSet(ResourceConfig config,
                                    List<ImageConfiguration> images);  }
@Test(expected = IllegalArgumentException.class) public void replicaSetHandlerWithInvalidNameTest() { ContainerHandler containerHandler = getContainerHandler(); PodTemplateHandler podTemplateHandler = new PodTemplateHandler(containerHandler); ReplicaSetHandler replicaSetHandler = new ReplicaSetHandler(podTemplateHandler); ResourceConfig config = new ResourceConfig.Builder() .imagePullPolicy("IfNotPresent") .controllerName("TesTing") .withServiceAccount("test-account") .withReplicas(5) .volumes(volumes1) .build(); replicaSetHandler.getReplicaSet(config, images); }
@Test(expected = IllegalArgumentException.class) public void replicaSetHandlerWithoutControllerTest() { ContainerHandler containerHandler = getContainerHandler(); PodTemplateHandler podTemplateHandler = new PodTemplateHandler(containerHandler); ReplicaSetHandler replicaSetHandler = new ReplicaSetHandler(podTemplateHandler); ResourceConfig config = new ResourceConfig.Builder() .imagePullPolicy("IfNotPresent") .withServiceAccount("test-account") .withReplicas(5) .volumes(volumes1) .build(); replicaSetHandler.getReplicaSet(config, images); }