DataExchangeMasterResource extends AbstractDataResource { @Path("exchanges/{exchangeId}") public DataExchangeResource findExchange(@PathParam("exchangeId") String idStr) { ObjectId id = ObjectId.parse(idStr); return new DataExchangeResource(this, id); } DataExchangeMasterResource(final ExchangeMaster exchangeMaster); ExchangeMaster getExchangeMaster(); @GET Response getHateaos(@Context UriInfo uriInfo); @HEAD @Path("exchanges") Response status(); @POST @Path("exchangeSearches") Response search(ExchangeSearchRequest request); @POST @Path("exchanges") Response add(@Context UriInfo uriInfo, ExchangeDocument request); @Path("exchanges/{exchangeId}") DataExchangeResource findExchange(@PathParam("exchangeId") String idStr); static URI uriSearch(URI baseUri); static URI uriAdd(URI baseUri);  }
@Test public void testFindExchange() { DataExchangeResource test = _resource.findExchange("Test~A"); assertSame(_resource, test.getExchangesResource()); assertEquals(ObjectId.of("Test", "A"), test.getUrlId()); }