Skip to content

Commit 4055365

Browse files
author
Thomas Darimont
committed
DATAMONGO-1127 - Add support for geoNear queries with distance information.
Made unit tests more robust to small differences in distance calculations between MongoDB versions.
1 parent db7f782 commit 4055365

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/AggregationTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ public void shouldSupportGeoNearQueriesForAggregationWithDistanceField() {
10431043

10441044
DBObject firstResult = result.getMappedResults().get(0);
10451045
assertThat(firstResult.containsField("distance"), is(true));
1046-
assertThat(firstResult.get("distance"), is((Object) 117.620092203928));
1046+
assertThat((Double) firstResult.get("distance"), closeTo(117.620092203928, 0.00001));
10471047
}
10481048

10491049
private void assertLikeStats(LikeStats like, String id, long count) {

0 commit comments

Comments
 (0)