ReplicationControllerHandler { public ReplicationController getReplicationController(ResourceConfig config, List<ImageConfiguration> images) { return new ReplicationControllerBuilder() .withMetadata(createRcMetaData(config)) .withSpec(createRcSpec(config, images)) .build(); } ReplicationControllerHandler(PodTemplateHandler podTemplateHandler); ReplicationController getReplicationController(ResourceConfig config,
                                                          List<ImageConfiguration> images);  }
@Test(expected = IllegalArgumentException.class) public void replicationControllerHandlerWithInvalidNameTest() { ContainerHandler containerHandler = getContainerHandler(); PodTemplateHandler podTemplateHandler = new PodTemplateHandler(containerHandler); ReplicationControllerHandler replicationControllerHandler = new ReplicationControllerHandler(podTemplateHandler); ResourceConfig config = new ResourceConfig.Builder() .imagePullPolicy("IfNotPresent") .controllerName("TesTing") .withServiceAccount("test-account") .withReplicas(5) .volumes(volumes1) .build(); replicationControllerHandler.getReplicationController(config, images); }
@Test(expected = IllegalArgumentException.class) public void replicationControllerHandlerWithoutControllerTest() { ContainerHandler containerHandler = getContainerHandler(); PodTemplateHandler podTemplateHandler = new PodTemplateHandler(containerHandler); ReplicationControllerHandler replicationControllerHandler = new ReplicationControllerHandler(podTemplateHandler); ResourceConfig config = new ResourceConfig.Builder() .imagePullPolicy("IfNotPresent") .withServiceAccount("test-account") .withReplicas(5) .volumes(volumes1) .build(); replicationControllerHandler.getReplicationController(config, images); }