@Test public void testGetHealthCheckRegions() { GetHealthCheckResult getHealthCheckResult = PowerMockito.mock(GetHealthCheckResult.class); HealthCheck healthCheck = new HealthCheck(); healthCheck.setHealthCheckConfig(new HealthCheckConfig().withRegions("us-west-2","us-east-1")); Mockito.when(mockAmazonRoute53.getHealthCheck(Mockito.any())).thenReturn(getHealthCheckResult); Mockito.when(getHealthCheckResult.getHealthCheck()).thenReturn(healthCheck); List<String> regions = route53RaiderUnderTest.getHealthCheckRegions(SW2_R53_HEALTH_CHECK_ID); Assert.assertNotNull(regions); Assert.assertEquals(regions.get(0),"us-west-2"); }
@Override public List<String> getHealthCheckRegions(String healthCheckId) { return route53Delegator.getAmazonRoute53().getHealthCheck(new GetHealthCheckRequest().withHealthCheckId(healthCheckId)) .getHealthCheck() .getHealthCheckConfig() .getRegions(); }
Route53RaiderImpl implements Route53Raider { @Override public List<String> getHealthCheckRegions(String healthCheckId) { return route53Delegator.getAmazonRoute53().getHealthCheck(new GetHealthCheckRequest().withHealthCheckId(healthCheckId)) .getHealthCheck() .getHealthCheckConfig() .getRegions(); } }
Route53RaiderImpl implements Route53Raider { @Override public List<String> getHealthCheckRegions(String healthCheckId) { return route53Delegator.getAmazonRoute53().getHealthCheck(new GetHealthCheckRequest().withHealthCheckId(healthCheckId)) .getHealthCheck() .getHealthCheckConfig() .getRegions(); } Route53RaiderImpl(); }
Route53RaiderImpl implements Route53Raider { @Override public List<String> getHealthCheckRegions(String healthCheckId) { return route53Delegator.getAmazonRoute53().getHealthCheck(new GetHealthCheckRequest().withHealthCheckId(healthCheckId)) .getHealthCheck() .getHealthCheckConfig() .getRegions(); } Route53RaiderImpl(); @Override List<HealthCheck> listHealthCheckers(); @Override List<HealthCheckObservation> getHealthCheckerStatus(String healthCheckerId); @Override HealthCheckStatus getSimpleHealthCheckerStatus(String healthCheckerId); @Override void updateTrafficPolicy(String trafficPolicyName, int version); @Override int getTrafficPolicyVersion(String trafficPolicyName); String getR53PolicyId(String policyId); @Override void updateHealthCheckRegions(String healthCheckId, List<String> regions); @Override List<String> getHealthCheckRegions(String healthCheckId); @Override void updateHealthCheckToDefaultRegions(String healthCheckId); }
Route53RaiderImpl implements Route53Raider { @Override public List<String> getHealthCheckRegions(String healthCheckId) { return route53Delegator.getAmazonRoute53().getHealthCheck(new GetHealthCheckRequest().withHealthCheckId(healthCheckId)) .getHealthCheck() .getHealthCheckConfig() .getRegions(); } Route53RaiderImpl(); @Override List<HealthCheck> listHealthCheckers(); @Override List<HealthCheckObservation> getHealthCheckerStatus(String healthCheckerId); @Override HealthCheckStatus getSimpleHealthCheckerStatus(String healthCheckerId); @Override void updateTrafficPolicy(String trafficPolicyName, int version); @Override int getTrafficPolicyVersion(String trafficPolicyName); String getR53PolicyId(String policyId); @Override void updateHealthCheckRegions(String healthCheckId, List<String> regions); @Override List<String> getHealthCheckRegions(String healthCheckId); @Override void updateHealthCheckToDefaultRegions(String healthCheckId);  }