Route53RaiderImpl implements Route53Raider { @Override public List<HealthCheck> listHealthCheckers() { return route53Delegator.getAmazonRoute53().listHealthChecks().getHealthChecks(); } 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);  }
@Test public void testListHealthCheckers() { ListHealthChecksResult listHealthChecksResult = PowerMockito.mock(ListHealthChecksResult.class); Mockito.when(mockAmazonRoute53.listHealthChecks()).thenReturn(listHealthChecksResult); HealthCheck healthCheck = new HealthCheck(); healthCheck.setHealthCheckConfig(new HealthCheckConfig().withRegions("us-west-2","us-east-1")); Mockito.when(listHealthChecksResult.getHealthChecks()).thenReturn(Arrays.asList(healthCheck)); List<HealthCheck> healthChecks = route53RaiderUnderTest.listHealthCheckers(); Assert.assertNotNull(healthChecks); Assert.assertEquals(healthChecks.get(0).getHealthCheckConfig().getRegions(), healthCheck.getHealthCheckConfig().getRegions()); }