DataMarketDataSnapshotSourceResource extends AbstractDataResource { @GET @Path("snapshots/{snapshotId}") public Response get( @PathParam("snapshotId") String idStr, @QueryParam("version") String version) { final ObjectId objectId = ObjectId.parse(idStr); final NamedSnapshot result = getMarketDataSnapshotSource().get(objectId.atVersion(version)); return responseOkObject(result); } DataMarketDataSnapshotSourceResource(final MarketDataSnapshotSource snapshotSource); MarketDataSnapshotSource getMarketDataSnapshotSource(); @GET Response getHateaos(@Context UriInfo uriInfo); @GET @Path("snapshots/{snapshotId}") Response get(
      @PathParam("snapshotId") String idStr,
      @QueryParam("version") String version); @GET @Path("snapshotSearches/single") Response getSingle(
      @QueryParam("name") String name,
      @QueryParam("type") String type,
      @QueryParam("versionCorrection") String vc); static URI uriGet(URI baseUri, UniqueId uniqueId); static URI uriGet(URI baseUri, ObjectId objectId); static URI uriGet(URI baseUri, ObjectId objectId, VersionCorrection vc); static URI uriSearchSingle(URI baseUri, Class<?> type, String name, VersionCorrection versionCorrection);  }
@Test public void testGetSnapshotByUid() { final StructuredMarketDataSnapshot target = new ManageableMarketDataSnapshot(); when(_underlying.get(eq(UID))).thenReturn(target); Response test = _resource.get(OID.toString(), UID.getVersion()); assertEquals(Status.OK.getStatusCode(), test.getStatus()); assertSame(target, test.getEntity()); }