public void testNewServerWithoutHostIdSetsZoneAsLocation() {
Set<Image> images = ImmutableSet.<Image> of();
Set<Hardware> hardwares = ImmutableSet.<Hardware> of();
Server serverToConvert = expectedServer();
ServerInZone serverInZoneToConvert = new ServerInZone(serverToConvert, "az-1.region-a.geo-1");
ServerInZoneToNodeMetadata converter = new ServerInZoneToNodeMetadata(
NovaComputeServiceContextModule.toPortableNodeStatus, locationIndex, Suppliers
.<Set<? extends Image>> ofInstance(images), Suppliers
.<Set<? extends Hardware>> ofInstance(hardwares), namingConvention);
NodeMetadata convertedNodeMetadata = converter.apply(serverInZoneToConvert);
assertEquals(serverInZoneToConvert.slashEncode(), convertedNodeMetadata.getId());
assertEquals(serverToConvert.getId(), convertedNodeMetadata.getProviderId());
assertEquals(convertedNodeMetadata.getLocation(), zone);
URI expectedURI = URI.create("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v1.1/37936628937291/servers/71752");
assertEquals(convertedNodeMetadata.getUri(), expectedURI);