LocationResource extends AbstractBrooklynRestResource implements LocationApi { @Override public LocationSummary get(String locationId, String fullConfig) { return get(locationId, Boolean.valueOf(fullConfig)); }  @Override List<LocationSummary> list(); @Override Map<String,Map<String,Object>> getLocatedLocations(); @Override LocationSummary get(String locationId, String fullConfig); LocationSummary get(String locationId, boolean fullConfig); @Override Response create(LocationSpec locationSpec); @Override @Deprecated void delete(String locationId);  }
@Test @Deprecated public void testAddLegacyLocationDefinition() { Map<String, String> expectedConfig = ImmutableMap.of( "identity", "bob", "credential", "CR3dential"); Response response = client().path("/locations") .type(MediaType.APPLICATION_JSON_TYPE) .post(new org.apache.brooklyn.rest.domain.LocationSpec(legacyLocationName, "aws-ec2:us-east-1", expectedConfig)); URI addedLegacyLocationUri = response.getLocation(); log.info("added legacy, at: " + addedLegacyLocationUri); LocationSummary location = client().path(response.getLocation()).get(LocationSummary.class); log.info(" contents: " + location); assertEquals(location.getSpec(), "brooklyn.catalog:"+legacyLocationName+":"+BasicBrooklynCatalog.NO_VERSION); assertTrue(addedLegacyLocationUri.getPath().startsWith("/locations/")); JcloudsLocation l = (JcloudsLocation) getManagementContext().getLocationRegistry().getLocationManaged(legacyLocationName); Assert.assertEquals(l.getProvider(), "aws-ec2"); Assert.assertEquals(l.getRegion(), "us-east-1"); Assert.assertEquals(l.getIdentity(), "bob"); Assert.assertEquals(l.getCredential(), "CR3dential"); }