@Test public void testGetDocumentUrls() { Optional<DateRange> dateParam = Optional.empty(); List<String> urls = ImmutableList.of("http: "http: when(documentDAO.getUrlList(dateParam)).thenReturn(urls); Response response = documentsResource.getDocumentUrls(null); assertThat(response.getStatus()) .isEqualTo(Response.Status.OK.getStatusCode()); List<String> returnedUrl = (List<String>)response.getEntity(); assertThat(returnedUrl).containsAll(urls); }
@Override public Response getDocumentUrls( @QueryParam("dateRange") String dateRangeParam) { Optional<DateRange> dateParam = StringUtils.isBlank(dateRangeParam) ? Optional.empty() : Optional.of(DateRange.from(dateRangeParam)); List<String> urls = documentDAO.getUrlList(dateParam); return Response.ok().entity(urls).build(); }
DocumentsResourceImpl implements DocumentsResource { @Override public Response getDocumentUrls( @QueryParam("dateRange") String dateRangeParam) { Optional<DateRange> dateParam = StringUtils.isBlank(dateRangeParam) ? Optional.empty() : Optional.of(DateRange.from(dateRangeParam)); List<String> urls = documentDAO.getUrlList(dateParam); return Response.ok().entity(urls).build(); } }
DocumentsResourceImpl implements DocumentsResource { @Override public Response getDocumentUrls( @QueryParam("dateRange") String dateRangeParam) { Optional<DateRange> dateParam = StringUtils.isBlank(dateRangeParam) ? Optional.empty() : Optional.of(DateRange.from(dateRangeParam)); List<String> urls = documentDAO.getUrlList(dateParam); return Response.ok().entity(urls).build(); } @SuppressWarnings("unused")  DocumentsResourceImpl(); @Inject  DocumentsResourceImpl(DocumentDAO documentDAO); }
DocumentsResourceImpl implements DocumentsResource { @Override public Response getDocumentUrls( @QueryParam("dateRange") String dateRangeParam) { Optional<DateRange> dateParam = StringUtils.isBlank(dateRangeParam) ? Optional.empty() : Optional.of(DateRange.from(dateRangeParam)); List<String> urls = documentDAO.getUrlList(dateParam); return Response.ok().entity(urls).build(); } @SuppressWarnings("unused")  DocumentsResourceImpl(); @Inject  DocumentsResourceImpl(DocumentDAO documentDAO); @Override Response getDocumentUrls(
            @QueryParam("dateRange") String dateRangeParam); }
DocumentsResourceImpl implements DocumentsResource { @Override public Response getDocumentUrls( @QueryParam("dateRange") String dateRangeParam) { Optional<DateRange> dateParam = StringUtils.isBlank(dateRangeParam) ? Optional.empty() : Optional.of(DateRange.from(dateRangeParam)); List<String> urls = documentDAO.getUrlList(dateParam); return Response.ok().entity(urls).build(); } @SuppressWarnings("unused")  DocumentsResourceImpl(); @Inject  DocumentsResourceImpl(DocumentDAO documentDAO); @Override Response getDocumentUrls(
            @QueryParam("dateRange") String dateRangeParam);  }