added asserts
This commit is contained in:
parent
b463929c28
commit
3cb9a9f4a2
|
@ -3490,7 +3490,7 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNearSearchNear() {
|
public void testNearSearchApproximate() {
|
||||||
Location loc = new Location();
|
Location loc = new Location();
|
||||||
double latitude = 1000.0;
|
double latitude = 1000.0;
|
||||||
double longitude = 2000.0;
|
double longitude = 2000.0;
|
||||||
|
|
|
@ -53,8 +53,8 @@ public class MatchUrlServiceTest extends BaseJpaTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testPullOutNearDistance() {
|
public void testParseNearDistance() {
|
||||||
Double kmDistance = 123.4;
|
double kmDistance = 123.4;
|
||||||
|
|
||||||
SearchParameterMap map = myMatchUrlService.translateMatchUrl(
|
SearchParameterMap map = myMatchUrlService.translateMatchUrl(
|
||||||
"Location?" +
|
"Location?" +
|
||||||
|
@ -63,8 +63,9 @@ public class MatchUrlServiceTest extends BaseJpaTest {
|
||||||
Location.SP_NEAR_DISTANCE + "=" + kmDistance + "|http://unitsofmeasure.org|km", ourCtx.getResourceDefinition("Location"));
|
Location.SP_NEAR_DISTANCE + "=" + kmDistance + "|http://unitsofmeasure.org|km", ourCtx.getResourceDefinition("Location"));
|
||||||
|
|
||||||
QuantityParam nearDistanceParam = map.getNearDistanceParam();
|
QuantityParam nearDistanceParam = map.getNearDistanceParam();
|
||||||
|
assertEquals(1, map.size());
|
||||||
assertNotNull(nearDistanceParam);
|
assertNotNull(nearDistanceParam);
|
||||||
// FIXME KHS assert
|
assertEquals(kmDistance, nearDistanceParam.getValue().doubleValue(), 0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -655,4 +655,8 @@ public class SearchParameterMap implements Serializable {
|
||||||
public List<List<IQueryParameterType>> remove(String theName) {
|
public List<List<IQueryParameterType>> remove(String theName) {
|
||||||
return mySearchParameterMap.remove(theName);
|
return mySearchParameterMap.remove(theName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int size() {
|
||||||
|
return mySearchParameterMap.size();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue