### Question:
LocationResource extends AbstractBrooklynRestResource implements LocationApi { public LocationSummary get(String locationId) { return get(locationId, false); }  @Override List<LocationSummary> list(); @Override Map<String,Map<String,Object>> getLocatedLocations(); LocationSummary get(String locationId); @Override LocationSummary get(String locationId, String fullConfig); LocationSummary get(String locationId, boolean fullConfig); @Override Response create(LocationSpec locationSpec); @Override @Deprecated void delete(String locationId);  }### Answer:
@Test @Deprecated public void testAddLegacyLocationDefinition() { Map<String, String> expectedConfig = ImmutableMap.of( "identity", "bob", "credential", "CR3dential"); ClientResponse response = client().resource("/v1/locations") .type(MediaType.APPLICATION_JSON_TYPE) .post(ClientResponse.class, 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().resource(response.getLocation()).get(LocationSummary.class); log.info(" contents: " + location); assertEquals(location.getSpec(), "brooklyn.catalog:"+legacyLocationName+":"+legacyLocationVersion); assertTrue(addedLegacyLocationUri.toString().startsWith("/v1/locations/")); JcloudsLocation l = (JcloudsLocation) getManagementContext().getLocationRegistry().resolve(legacyLocationName); Assert.assertEquals(l.getProvider(), "aws-ec2"); Assert.assertEquals(l.getRegion(), "us-east-1"); Assert.assertEquals(l.getIdentity(), "bob"); Assert.assertEquals(l.getCredential(), "CR3dential"); }