begin with failing test
This commit is contained in:
parent
eca21bec3e
commit
a961a7c022
|
@ -3484,6 +3484,25 @@ public class FhirResourceDaoDstu3SearchNoFtTest extends BaseJpaDstu3Test {
|
||||||
assertThat(ids, contains(locId));
|
assertThat(ids, contains(locId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testNearSearchNear() {
|
||||||
|
Location loc = new Location();
|
||||||
|
double latitude = 1000.0;
|
||||||
|
double longitude = 2000.0;
|
||||||
|
double offset = 50.0;
|
||||||
|
Location.LocationPositionComponent position = new Location.LocationPositionComponent().setLatitude(latitude).setLongitude(longitude);
|
||||||
|
loc.setPosition(position);
|
||||||
|
String locId = myLocationDao.create(loc).getId().toUnqualifiedVersionless().getValue();
|
||||||
|
|
||||||
|
SearchParameterMap map = new SearchParameterMap();
|
||||||
|
map.add(Location.SP_NEAR, new TokenParam((latitude + offset) + ":" + (longitude - offset)));
|
||||||
|
QuantityParam distance = new QuantityParam(ParamPrefixEnum.LESSTHAN_OR_EQUALS, offset * 2, "http://unitsofmeasure.org", "km");
|
||||||
|
map.add(Location.SP_NEAR_DISTANCE, distance);
|
||||||
|
|
||||||
|
List<String> ids = toUnqualifiedVersionlessIdValues(myLocationDao.search(map));
|
||||||
|
assertThat(ids, contains(locId));
|
||||||
|
}
|
||||||
|
|
||||||
private String toStringMultiline(List<?> theResults) {
|
private String toStringMultiline(List<?> theResults) {
|
||||||
StringBuilder b = new StringBuilder();
|
StringBuilder b = new StringBuilder();
|
||||||
for (Object next : theResults) {
|
for (Object next : theResults) {
|
||||||
|
|
Loading…
Reference in New Issue