blob: 3f6c648717539a520486b64234fe666b118ef3e8 [file] [log] [blame]
== Camel Quarkus Geocoder Integration Tests
By default the Geocoder integration tests use WireMock to stub the API interactions.
To run `camel-quarkus-geocoder` integration tests using google maps service, you will need a Google Cloud https://developers.google.com/maps/documentation/javascript/get-api-key[API key].
You must also ensure that the Geolocation API & Geocoding API services are enabled. You can do this from the developer console by navigating to `Google Maps -> APIs`. Since these are not free services,
your Google Cloud project must have an associated billing account.
Then set the following environment variable:
[source,shell]
----
GOOGLE_API_KEY=your-api-id
----
If the WireMock stub recordings need updating, then remove the existing files from `src/test/resources/mappings` and run tests with either:
System property `-Dwiremock.record=true`
Or
Set environment variable `WIREMOCK_RECORD=true`
Be sure to replace the occurrences of the Google API key in the mappings files with the fake API key "AIzaFakeKey".
The Nominatim tests do not use Wiremock, so the `*.json` files in `src/main/resources` will have to be updated by calling the Nominatim API directly.
If the address look-up has changed, the `nominatimSearch.json` file needs to be updated:
[source,shell]
----
$ curl "https://nominatim.openstreetmap.org/search?q=calle+marie+curie,+sevilla,+sevilla&format=jsonv2&addressdetails=1&limit=1" \
| jq > src/main/resources/nominatimSearch.json
----
If the lat/lon coordinates have changed, the `nominatimReverse.json` file needs to be updated. For example:
[source,shell]
----
$ curl "https://nominatim.openstreetmap.org/reverse?format=jsonv2&lat=37.8021028&lon=-122.41875" \
| jq > src/main/resources/nominatimReverse.json
----