Skip to content

Commit

Permalink
Fixed unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Egense committed Oct 20, 2023
1 parent 368f7ac commit b9a1430
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,19 @@ public void getIDsStreaming() {
*/
@Test
public void timeProximity() {
String date="2019-04-15T12:31:51Z";
String dateExptected="2019-03-15T12:31:51Z";

List<SolrDocument> docs = SolrGenericStreaming.create(
SRequest.builder().
query("title:title_5").
fields("id", "crawl_date").
timeProximityDeduplication("2019-04-15T12:31:51Z", "url")).
timeProximityDeduplication(date, "url")).
stream().collect(Collectors.toList());
assertEquals("Single result expected",
1, docs.size());
SolrDocument doc = docs.get(0);
assertEquals("The returned crawl_date should be the nearest",
"Fri Mar 15 13:31:51 CET 2019", doc.get("crawl_date").toString());
assertEquals("Single result expected",1, docs.size());
SolrDocument doc = docs.get(0);
String solrDate = DateUtils.getSolrDate((Date) doc.get("crawl_date"));
assertEquals("The returned crawl_date should be the nearest",dateExptected, solrDate);
}

/**
Expand Down

0 comments on commit b9a1430

Please sign in to comment.