DataHistoricalTimeSeriesProviderResource extends AbstractDataResource { @POST @Path("htsGet") public Response getHistoricalTimeSeries(HistoricalTimeSeriesProviderGetRequest request) { HistoricalTimeSeriesProviderGetResult result = getHistoricalTimeSeriesProvider().getHistoricalTimeSeries(request); return responseOkObject(result); } DataHistoricalTimeSeriesProviderResource(final HistoricalTimeSeriesProvider htsProvider); HistoricalTimeSeriesProvider getHistoricalTimeSeriesProvider(); @GET Response getHateaos(@Context UriInfo uriInfo); @HEAD @Path("htsGet") Response status(); @POST // should be a get, but query is too large @Path("htsGet") Response getHistoricalTimeSeries(HistoricalTimeSeriesProviderGetRequest request); static URI uriGet(URI baseUri);  }
@Test public void testGet() { final HistoricalTimeSeriesProviderGetRequest request = HistoricalTimeSeriesProviderGetRequest.createGet( ExternalIdBundle.of("A", "B"), "S", "P", "F", LocalDateRange.ALL); final HistoricalTimeSeriesProviderGetResult result = new HistoricalTimeSeriesProviderGetResult(); when(_underlying.getHistoricalTimeSeries(same(request))).thenReturn(result); Response test = _resource.getHistoricalTimeSeries(request); assertEquals(Status.OK.getStatusCode(), test.getStatus()); assertSame(result, test.getEntity()); }