DataRegionMasterResource extends AbstractDataResource { @Path("regions/{regionId}") public DataRegionResource findRegion(@PathParam("regionId") String idStr) { ObjectId id = ObjectId.parse(idStr); return new DataRegionResource(this, id); } DataRegionMasterResource(final RegionMaster regionMaster); RegionMaster getRegionMaster(); @GET Response getHateaos(@Context UriInfo uriInfo); @HEAD @Path("regions") Response status(); @POST @Path("regionSearches") Response search(RegionSearchRequest request); @POST @Path("regions") Response add(@Context UriInfo uriInfo, RegionDocument request); @Path("regions/{regionId}") DataRegionResource findRegion(@PathParam("regionId") String idStr); static URI uriSearch(URI baseUri); static URI uriAdd(URI baseUri);  }
@Test public void testFindRegion() { DataRegionResource test = _resource.findRegion("Test~A"); assertSame(_resource, test.getRegionsResource()); assertEquals(ObjectId.of("Test", "A"), test.getUrlId()); }