diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3SearchNoFtTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3SearchNoFtTest.java index 6e4c4861173..1020c0c79e1 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3SearchNoFtTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu3/FhirResourceDaoDstu3SearchNoFtTest.java @@ -3490,7 +3490,7 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test { } @Test - public void testNearSearchNear() { + public void testNearSearchApproximate() { Location loc = new Location(); double latitude = 1000.0; double longitude = 2000.0; diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/searchparam/MatchUrlServiceTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/searchparam/MatchUrlServiceTest.java index f324a0541a8..9e5e3215560 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/searchparam/MatchUrlServiceTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/searchparam/MatchUrlServiceTest.java @@ -53,8 +53,8 @@ public class MatchUrlServiceTest extends BaseJpaTest { } @Test - public void testPullOutNearDistance() { - Double kmDistance = 123.4; + public void testParseNearDistance() { + double kmDistance = 123.4; SearchParameterMap map = myMatchUrlService.translateMatchUrl( "Location?" + @@ -63,8 +63,9 @@ public class MatchUrlServiceTest extends BaseJpaTest { Location.SP_NEAR_DISTANCE + "=" + kmDistance + "|http://unitsofmeasure.org|km", ourCtx.getResourceDefinition("Location")); QuantityParam nearDistanceParam = map.getNearDistanceParam(); + assertEquals(1, map.size()); assertNotNull(nearDistanceParam); - // FIXME KHS assert + assertEquals(kmDistance, nearDistanceParam.getValue().doubleValue(), 0.0); } @Override diff --git a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/SearchParameterMap.java b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/SearchParameterMap.java index 316a42415e0..27b7aca145a 100644 --- a/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/SearchParameterMap.java +++ b/hapi-fhir-jpaserver-searchparam/src/main/java/ca/uhn/fhir/jpa/searchparam/SearchParameterMap.java @@ -655,4 +655,8 @@ public class SearchParameterMap implements Serializable { public List> remove(String theName) { return mySearchParameterMap.remove(theName); } + + public int size() { + return mySearchParameterMap.size(); + } }