public class RegionToLocationTest {
@Test
public void testConvertRegion() {
DigitalOceanProviderMetadata metadata = new DigitalOceanProviderMetadata();
JustProvider locationsSupplier = new JustProvider(metadata.getId(), Suppliers.<URI> ofInstance(URI
.create(metadata.getEndpoint())), ImmutableSet.<String> of());
Region region = new Region(1, "Region 1", "reg1");
Location expected = new LocationBuilder().id("reg1").description("1/Region 1")
.parent(getOnlyElement(locationsSupplier.get())).scope(LocationScope.REGION).build();
RegionToLocation function = new RegionToLocation(locationsSupplier);
assertEquals(function.apply(region), expected);
}