@Test
public void testConversionWhereLocationFound() {
OperatingSystem operatingSystem = new OperatingSystem(OsFamily.UBUNTU, "My Test OS", "My Test Version", "x86",
"My Test OS", true);
DatasetInDatacenterToImage converter = new DatasetInDatacenterToImage(constant(operatingSystem), locationIndex);
DatasetInDatacenter datasetInZoneToConvert = new DatasetInDatacenter(datasetToConvert, "us-sw-1");
org.jclouds.compute.domain.Image convertedImage = converter.apply(datasetInZoneToConvert);
assertEquals(convertedImage.getId(), "us-sw-1/" + datasetToConvert.getUrn());
assertEquals(convertedImage.getProviderId(), datasetToConvert.getUrn());
assertEquals(convertedImage.getLocation(), locationIndex.get().get("us-sw-1"));