DataHistoricalTimeSeriesResource extends AbstractDocumentDataResource<HistoricalTimeSeriesInfoDocument> { @POST public Response update(@Context UriInfo uriInfo, HistoricalTimeSeriesInfoDocument request) { return super.update(uriInfo, request); } DataHistoricalTimeSeriesResource();  DataHistoricalTimeSeriesResource(final DataHistoricalTimeSeriesMasterResource htsResource, final ObjectId infoId); DataHistoricalTimeSeriesMasterResource getParentResource(); ObjectId getUrlId(); HistoricalTimeSeriesMaster getMaster(); @GET @Path("versions") Response history(@Context UriInfo uriInfo); @GET Response get(@QueryParam("versionAsOf") String versionAsOf, @QueryParam("correctedTo") String correctedTo); @POST Response update(@Context UriInfo uriInfo, HistoricalTimeSeriesInfoDocument request); @DELETE void remove(); @GET @Path("versions/{versionId}") Response getVersioned(@PathParam("versionId") String versionId); @PUT @Path("versions/{versionId}") Response replaceVersion(@PathParam("versionId") String versionId, List<HistoricalTimeSeriesInfoDocument> replacementDocuments); @PUT Response replaceVersions(List<HistoricalTimeSeriesInfoDocument> replacementDocuments); @PUT @Path("all") Response replaceAllVersions(List<HistoricalTimeSeriesInfoDocument> replacementDocuments);  }
@Test public void testUpdateHistoricalTimeSeries() { final ManageableHistoricalTimeSeriesInfo target = new ManageableHistoricalTimeSeriesInfo(); target.setDataField("DF"); target.setDataProvider("DP"); target.setDataSource("DS"); final HistoricalTimeSeriesInfoDocument request = new HistoricalTimeSeriesInfoDocument(target); request.setUniqueId(OID.atLatestVersion()); final HistoricalTimeSeriesInfoDocument result = new HistoricalTimeSeriesInfoDocument(target); result.setUniqueId(OID.atVersion("1")); when(_underlying.update(same(request))).thenReturn(result); Response test = _resource.update(_uriInfo, request); assertEquals(Status.CREATED.getStatusCode(), test.getStatus()); assertSame(result, test.getEntity()); }