DataPositionMasterResource extends AbstractDataResource { @Path("trades/{tradeId}") public DataTradeResource findTrade(@PathParam("tradeId") String idStr) { ObjectId id = ObjectId.parse(idStr); return new DataTradeResource(this, id); } DataPositionMasterResource(final PositionMaster positionMaster); PositionMaster getPositionMaster(); @GET Response getHateaos(@Context UriInfo uriInfo); @HEAD @Path("positions") Response status(); @POST @Path("positionSearches") Response search(PositionSearchRequest request); @POST @Path("positions") Response add(@Context UriInfo uriInfo, PositionDocument request); @Path("positions/{positionId}") DataPositionResource findPosition(@PathParam("positionId") String idStr); @Path("trades/{tradeId}") DataTradeResource findTrade(@PathParam("tradeId") String idStr); static URI uriSearch(URI baseUri); static URI uriAdd(URI baseUri);  }
@Test public void testFindTrade() { DataTradeResource test = _resource.findTrade("Test~B"); assertSame(_resource, test.getParentResource()); assertEquals(ObjectId.of("Test", "B"), test.getUrlTradeId()); }