@Test(expected = ChaosException.class) public void getEndpointException () { Info info = mock(Info.class); String expectedEndpoint = UUID.randomUUID().toString(); doReturn(Mono.empty()).when(info).get(any()); doReturn(info).when(cloudFoundryClient).info(); assertEquals(expectedEndpoint, cloudFoundryContainerPlatform.getEndpoint(null)); }
@Override public String getEndpoint (CloudFoundryContainer container) { log.debug("Retrieving SSH Endpoint for {}", v(DataDogConstants.DATADOG_PLATFORM_KEY, this)); return cloudFoundryClient.info() .get(GetInfoRequest.builder().build()) .blockOptional().orElseThrow(EMPTY_RESPONSE.asChaosException()) .getApplicationSshEndpoint(); }
CloudFoundryContainerPlatform extends CloudFoundryPlatform implements SshBasedExperiment<CloudFoundryContainer> { @Override public String getEndpoint (CloudFoundryContainer container) { log.debug("Retrieving SSH Endpoint for {}", v(DataDogConstants.DATADOG_PLATFORM_KEY, this)); return cloudFoundryClient.info() .get(GetInfoRequest.builder().build()) .blockOptional().orElseThrow(EMPTY_RESPONSE.asChaosException()) .getApplicationSshEndpoint(); } }
CloudFoundryContainerPlatform extends CloudFoundryPlatform implements SshBasedExperiment<CloudFoundryContainer> { @Override public String getEndpoint (CloudFoundryContainer container) { log.debug("Retrieving SSH Endpoint for {}", v(DataDogConstants.DATADOG_PLATFORM_KEY, this)); return cloudFoundryClient.info() .get(GetInfoRequest.builder().build()) .blockOptional().orElseThrow(EMPTY_RESPONSE.asChaosException()) .getApplicationSshEndpoint(); } @Autowired  CloudFoundryContainerPlatform(); }
CloudFoundryContainerPlatform extends CloudFoundryPlatform implements SshBasedExperiment<CloudFoundryContainer> { @Override public String getEndpoint (CloudFoundryContainer container) { log.debug("Retrieving SSH Endpoint for {}", v(DataDogConstants.DATADOG_PLATFORM_KEY, this)); return cloudFoundryClient.info() .get(GetInfoRequest.builder().build()) .blockOptional().orElseThrow(EMPTY_RESPONSE.asChaosException()) .getApplicationSshEndpoint(); } @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 String getEndpoint (CloudFoundryContainer container) { log.debug("Retrieving SSH Endpoint for {}", v(DataDogConstants.DATADOG_PLATFORM_KEY, this)); return cloudFoundryClient.info() .get(GetInfoRequest.builder().build()) .blockOptional().orElseThrow(EMPTY_RESPONSE.asChaosException()) .getApplicationSshEndpoint(); } @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);  }