@Test public void recycleContainer () { Integer index = new Random().nextInt(100) + 1; String name = UUID.randomUUID().toString(); CloudFoundryContainer container = CloudFoundryContainer.builder().name(name).instance(index).build(); doReturn(applications).when(cloudFoundryOperations).applications(); doReturn(Mono.empty()).when(applications).restartInstance(any()); cloudFoundryContainerPlatform.recycleContainer(container); verify(applications, times(1)).restartInstance(RestartApplicationInstanceRequest.builder() .name(name) .instanceIndex(index) .build()); }
@Override public void recycleContainer (CloudFoundryContainer container) { restartInstance(RestartApplicationInstanceRequest.builder() .name(container.getName()) .instanceIndex(container.getInstance()) .build()); }
CloudFoundryContainerPlatform extends CloudFoundryPlatform implements SshBasedExperiment<CloudFoundryContainer> { @Override public void recycleContainer (CloudFoundryContainer container) { restartInstance(RestartApplicationInstanceRequest.builder() .name(container.getName()) .instanceIndex(container.getInstance()) .build()); } }
CloudFoundryContainerPlatform extends CloudFoundryPlatform implements SshBasedExperiment<CloudFoundryContainer> { @Override public void recycleContainer (CloudFoundryContainer container) { restartInstance(RestartApplicationInstanceRequest.builder() .name(container.getName()) .instanceIndex(container.getInstance()) .build()); } @Autowired  CloudFoundryContainerPlatform(); }
CloudFoundryContainerPlatform extends CloudFoundryPlatform implements SshBasedExperiment<CloudFoundryContainer> { @Override public void recycleContainer (CloudFoundryContainer container) { restartInstance(RestartApplicationInstanceRequest.builder() .name(container.getName()) .instanceIndex(container.getInstance()) .build()); } @Autowired  CloudFoundryContainerPlatform(); @Override boolean isContainerRecycled(Container container); ContainerHealth checkHealth(String applicationId, Integer instanceId); @Override List<Container> generateRoster(); void restartInstance(RestartApplicationInstanceRequest restartApplicationInstanceRequest); @Override String getEndpoint(CloudFoundryContainer container); @Override SSHCredentials getSshCredentials(CloudFoundryContainer container); @Override void recycleContainer(CloudFoundryContainer container); }
CloudFoundryContainerPlatform extends CloudFoundryPlatform implements SshBasedExperiment<CloudFoundryContainer> { @Override public void recycleContainer (CloudFoundryContainer container) { restartInstance(RestartApplicationInstanceRequest.builder() .name(container.getName()) .instanceIndex(container.getInstance()) .build()); } @Autowired  CloudFoundryContainerPlatform(); @Override boolean isContainerRecycled(Container container); ContainerHealth checkHealth(String applicationId, Integer instanceId); @Override List<Container> generateRoster(); void restartInstance(RestartApplicationInstanceRequest restartApplicationInstanceRequest); @Override String getEndpoint(CloudFoundryContainer container); @Override SSHCredentials getSshCredentials(CloudFoundryContainer container); @Override void recycleContainer(CloudFoundryContainer container);  }