DataPortfolioMasterResource extends AbstractDataResource { @Path("portfolios/{portfolioId}") public DataPortfolioResource findPortfolio(@PathParam("portfolioId") String idStr) { ObjectId id = ObjectId.parse(idStr); return new DataPortfolioResource(this, id); } DataPortfolioMasterResource();  DataPortfolioMasterResource(final PortfolioMaster portfolioMaster); PortfolioMaster getPortfolioMaster(); @GET Response getHateaos(@Context UriInfo uriInfo); @HEAD @Path("portfolios") Response status(); @POST @Path("portfolioSearches") Response search(PortfolioSearchRequest request); @POST @Path("portfolios") Response add(@Context UriInfo uriInfo, PortfolioDocument request); @Path("nodes/{nodeId}") DataPortfolioNodeResource findPortfolioNode(@PathParam("nodeId") String idStr); @Path("portfolios/{portfolioId}") DataPortfolioResource findPortfolio(@PathParam("portfolioId") String idStr); @Path("portfolios/changeManager") DataChangeManagerResource getChangeManager(); static URI uriSearch(URI baseUri); static URI uriAdd(URI baseUri);  }
@Test public void testFindPortfolio() { DataPortfolioResource test = _resource.findPortfolio("Test~PortA"); assertSame(_resource, test.getPortfoliosResource()); assertEquals(ObjectId.of("Test", "PortA"), test.getUrlId()); }