### Question:
DefaultSetsProvider extends SolrBasedProvider implements SetsProvider { @Override public ListSets listSets(Date from, Date until) throws OaiPmhException { QueryResponse response = executeQuery(SolrQueryBuilder.listSets(setsPerPage, from, until, 0)); FieldStatsInfo info = response.getFieldStatsInfo().get(DATASET_NAME); if (info == null) { throw new InternalServerErrorException("An error occurred while retrieving information from the index."); } return responseToListSets(response, 0, info.getCountDistinct()); }  @Override ListSets listSets(Date from, Date until); @Override ListSets listSets(ResumptionToken resumptionToken);  }### Answer:
@Test public void listSets() throws IOException, SolrServerException, OaiPmhException { QueryResponse response = getResponse(LIST_SETS); Mockito.when(solrClient.query(Mockito.any(SolrParams.class))).thenReturn(response); ListSets result = setsProvider.listSets(null, null); assertResults(result); }
@Test public void listSetsFrom() throws IOException, SolrServerException, OaiPmhException { QueryResponse response = getResponse(LIST_SETS_FROM); Mockito.when(solrClient.query(Mockito.any(SolrParams.class))).thenReturn(response); Date from = DateConverter.fromIsoDateTime(DATE_1); ListSets result = setsProvider.listSets(from, null); assertResults(result); }
@Test public void listSetsWithResumptionToken() throws IOException, SolrServerException, OaiPmhException { QueryResponse response = getResponse(LIST_SETS_WITH_RESUMPTION_TOKEN_SECOND_PAGE); Mockito.when(solrClient.query(Mockito.any(SolrParams.class))).thenReturn(response); ResumptionToken token = ResumptionTokenHelper.createResumptionToken(new Date(System.currentTimeMillis() + RESUMPTION_TOKEN_TTL), COMPLETE_LIST_SIZE, 0); ListSets result = setsProvider.listSets(token); assertResults(result); }