expectedInventoryItemMetadata.put("targetProviderId", tConnectionProvider.getId());
expectedInventoryItemMetadata.put("targetProviderDisplayName", tConnectionProvider.getDisplayName());
expectedInventoryItemMetadata.put("targetProviderType", tConnectionProvider.getType());
if (tInventoryItem.getConnection().getProviderId().equals(ProviderIdConstants.AWS_PROVIDER_ID)) {
Location zone = inventoryService.getLocationByScope(tInventoryItem, LocationScope.ZONE);
Location region = inventoryService.getLocationByScope(tInventoryItem, LocationScope.REGION);
Set<String> iso3166Codes = zone != null ? zone.getIso3166Codes() : null;
String iso3166Code = iso3166Codes != null && iso3166Codes.size() >= 1 ?
iso3166Codes.iterator().next() :
null;
if (tInventoryItem.getType().equals(Constants.COMPUTE_INSTANCE_TYPE)) {
expectedObjectMetadata.put("targetIP",
inventoryService.getComputeInstanceIPAddress(tInventoryItem));
expectedObjectMetadata.put("targetOS",
inventoryService.getComputeInstanceOSName(tInventoryItem));
}
if (iso3166Code != null) {
expectedObjectMetadata.put("targetISO3166Code", iso3166Code);
}
if (zone != null) {
expectedObjectMetadata.put("targetZone", zone.getId());
}
if (region != null) {
expectedObjectMetadata.put("targetRegion", region.getId());
}
}
validateEventMetadata(eventMetadata, expectedInventoryItemMetadata, true);
} else if (expectedTarget instanceof Connection) {