Skip to content

Commit

Permalink
fix: unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Nov 16, 2024
1 parent 583d575 commit 0abb0b4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,14 @@ private List<UpdateRow> getPlaces(String table) {


public List<PhotonDoc> getByPlaceId(long placeId) {
String query = SELECT_COLS_PLACEX + " FROM placex WHERE place_id = ? and indexed_status = 0";
String query = SELECT_COLS_PLACEX;

if (useGeometryColumn) {
query += ", geometry";
}

query += " FROM placex WHERE place_id = ? and indexed_status = 0";

List<NominatimResult> result = template.query(
query,
placeToNominatimResult, placeId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private void addCommonParameters(Request webRequest, PhotonRequestBase request)

if (webRequest.queryParams("polygon") != null) {
request.setPolygonRequest(true);
request.setReturnPolygon(parseBoolean(webRequest, webRequest.queryParams("polygon")));
request.setReturnPolygon(parseBoolean(webRequest, "polygon"));
}
}

Expand Down Expand Up @@ -157,11 +157,7 @@ private Boolean parseBoolean(Request webRequest, String param) throws BadRequest
String value = webRequest.queryParams(param);

if (value != null && !value.isEmpty()) {
try {
booleanVal = Boolean.valueOf(value);
} catch (NumberFormatException e) {
throw new BadRequestException(400, String.format("Invalid parameter '%s': must be a boolean", param));
}
booleanVal = Boolean.valueOf(value);
}

return booleanVal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void setup() {
.build();


connector = new NominatimUpdater(null, 0, null, null, null, new H2DataAdapter(), true);
connector = new NominatimUpdater(null, 0, null, null, null, new H2DataAdapter(), false);
updater = new CollectingUpdater();
connector.setUpdater(updater);

Expand Down

0 comments on commit 0abb0b4

Please sign in to comment.