public void testNotMappedAZ() throws Exception {
ConfigurationManager.getConfigInstance().setProperty("eureka.us-east-1.availabilityZones", "abc,def");
PropertyBasedAzToRegionMapper azToRegionMapper = new PropertyBasedAzToRegionMapper(new DefaultEurekaClientConfig());
InstanceRegionChecker checker = new InstanceRegionChecker(azToRegionMapper, "us-east-1");
azToRegionMapper.setRegionsToFetch(new String[] {"us-east-1"});
AmazonInfo dcInfo = AmazonInfo.Builder.newBuilder().addMetadata(AmazonInfo.MetaDataKey.availabilityZone,
"us-east-1x").build();
InstanceInfo instanceInfo = InstanceInfo.Builder.newBuilder().setAppName("abc").setDataCenterInfo(dcInfo) .build();
String instanceRegion = checker.getInstanceRegion(instanceInfo);
Assert.assertEquals("Invalid instance region.", "us-east-1", instanceRegion);