add negative test
This commit is contained in:
parent
02a95115a4
commit
5da2823553
|
@ -3520,6 +3520,7 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test {
|
||||||
loc.setPosition(position);
|
loc.setPosition(position);
|
||||||
String locId = myLocationDao.create(loc).getId().toUnqualifiedVersionless().getValue();
|
String locId = myLocationDao.create(loc).getId().toUnqualifiedVersionless().getValue();
|
||||||
|
|
||||||
|
{ // In the box
|
||||||
double offset = 50.0;
|
double offset = 50.0;
|
||||||
SearchParameterMap map = myMatchUrlService.translateMatchUrl(
|
SearchParameterMap map = myMatchUrlService.translateMatchUrl(
|
||||||
"Location?" +
|
"Location?" +
|
||||||
|
@ -3530,6 +3531,19 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test {
|
||||||
List<String> ids = toUnqualifiedVersionlessIdValues(myLocationDao.search(map));
|
List<String> ids = toUnqualifiedVersionlessIdValues(myLocationDao.search(map));
|
||||||
assertThat(ids, contains(locId));
|
assertThat(ids, contains(locId));
|
||||||
}
|
}
|
||||||
|
{ // Outside the box
|
||||||
|
double offset = 50.0;
|
||||||
|
SearchParameterMap map = myMatchUrlService.translateMatchUrl(
|
||||||
|
"Location?" +
|
||||||
|
Location.SP_NEAR + "=" + (latitude + offset) + ":" + (longitude - offset) +
|
||||||
|
"&" +
|
||||||
|
Location.SP_NEAR_DISTANCE + "=" + (offset / 2) + "|http://unitsofmeasure.org|km", myFhirCtx.getResourceDefinition("Location"));
|
||||||
|
|
||||||
|
List<String> ids = toUnqualifiedVersionlessIdValues(myLocationDao.search(map));
|
||||||
|
assertThat(ids.size(), is(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testBadCoordsFormat() {
|
public void testBadCoordsFormat() {
|
||||||
|
|
Loading…
Reference in New Issue