DataConventionSourceResource extends AbstractDataResource { @GET @Path("conventions") public Response search( @QueryParam("versionAsOf") String versionAsOf, @QueryParam("correctedTo") String correctedTo, @QueryParam("id") List<String> externalIdStrs) { final VersionCorrection vc = VersionCorrection.parse(versionAsOf, correctedTo); final ExternalIdBundle bundle = ExternalIdBundle.parse(externalIdStrs); Collection<? extends Convention> result = getConventionSource().get(bundle, vc); return responseOkObject(FudgeListWrapper.of(result)); } DataConventionSourceResource(final ConventionSource conventionSource); ConventionSource getConventionSource(); @GET Response getHateaos(@Context UriInfo uriInfo); @GET @Path("conventions") Response search(
      @QueryParam("versionAsOf") String versionAsOf,
      @QueryParam("correctedTo") String correctedTo,
      @QueryParam("id") List<String> externalIdStrs); @GET @Path("conventions/{conventionId}") Response get(
      @PathParam("conventionId") String idStr,
      @QueryParam("version") String version,
      @QueryParam("versionAsOf") String versionAsOf,
      @QueryParam("correctedTo") String correctedTo); @GET @Path("conventionSearches/bulk") Response getBulk(
      @QueryParam("id") List<String> uniqueIdStrs); static URI uriSearch(URI baseUri, VersionCorrection vc, ExternalIdBundle bundle); static URI uriGet(URI baseUri, UniqueId uniqueId); static URI uriGet(URI baseUri, ObjectId objectId, VersionCorrection vc); static URI uriBulk(URI baseUri, Iterable<UniqueId> uniqueIds); @GET @Path("conventionSearches/list") Response searchList(@QueryParam("id") List<String> externalIdStrs); @GET @Path("conventionSearches/single") Response searchSingle(
      @QueryParam("id") List<String> externalIdStrs,
      @QueryParam("versionAsOf") String versionAsOf,
      @QueryParam("correctedTo") String correctedTo,
      @QueryParam("type") String typeStr); static URI uriSearchList(URI baseUri, ExternalIdBundle bundle); static URI uriSearchSingle(URI baseUri, ExternalIdBundle bundle, VersionCorrection vc); static URI uriSearchSingle(URI baseUri, ExternalIdBundle bundle, VersionCorrection vc, Class<?> type); @GET @Path("debugInfo") FudgeMsgEnvelope getDebugInfo();  }
@SuppressWarnings({"rawtypes", "unchecked" }) @Test public void testSearch() { final MockConvention target = new MockConvention("TEST"); target.setExternalIdBundle(BUNDLE); target.setName("Test"); Collection targetColl = ImmutableList.<Convention>of(target); when(_underlying.get(eq(BUNDLE), eq(VC))).thenReturn(targetColl); Response test = _resource.search(VC.getVersionAsOfString(), VC.getCorrectedToString(), BUNDLE.toStringList()); assertEquals(Status.OK.getStatusCode(), test.getStatus()); assertEquals(FudgeListWrapper.of(targetColl), test.getEntity()); }