Skip to content

Commit

Permalink
Updating SPaT index source
Browse files Browse the repository at this point in the history
  • Loading branch information
John-Wiens committed May 20, 2024
1 parent 71cd2c1 commit 09bf1da
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion jpo-conflictmonitor
Submodule jpo-conflictmonitor updated from f0c6e6 to b0c3bb
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
import com.fasterxml.jackson.databind.ObjectMapper;

import us.dot.its.jpo.geojsonconverter.DateJsonMapper;
import us.dot.its.jpo.geojsonconverter.pojos.geojson.map.ProcessedMap;
import us.dot.its.jpo.geojsonconverter.pojos.spat.ProcessedSpat;
import us.dot.its.jpo.ode.api.ConflictMonitorApiProperties;
import us.dot.its.jpo.ode.api.models.IDCount;
import org.springframework.data.domain.Sort;
import java.util.HashMap;
import java.util.Map;

Expand All @@ -29,9 +27,6 @@
import org.springframework.data.mongodb.core.aggregation.ConvertOperators;
import org.springframework.data.mongodb.core.aggregation.DateOperators;

import java.time.format.DateTimeFormatter;
import java.time.ZonedDateTime;

@Component
public class ProcessedSpatRepositoryImpl implements ProcessedSpatRepository {

Expand Down Expand Up @@ -62,7 +57,7 @@ public Query getQuery(Integer intersectionID, Long startTime, Long endTime) {
endTimeString = Instant.ofEpochMilli(endTime).toString();
}
query.limit(props.getMaximumResponseSize());
query.addCriteria(Criteria.where("odeReceivedAt").gte(startTimeString).lte(endTimeString));
query.addCriteria(Criteria.where("utcTimeStamp").gte(startTimeString).lte(endTimeString));
query.fields().exclude("recordGeneratedAt");
return query;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void testGetQuery() {


// Assert Start and End Time
Document queryTimeDocument = (Document)query.getQueryObject().get("odeReceivedAt");
Document queryTimeDocument = (Document)query.getQueryObject().get("utcTimeStamp");
assertThat(queryTimeDocument.getString("$gte")).isEqualTo(Instant.ofEpochMilli(startTime).toString());
assertThat(queryTimeDocument.getString("$lte")).isEqualTo(Instant.ofEpochMilli(endTime).toString());

Expand Down

0 comments on commit 09bf1da

Please sign in to comment.