Skip to main content
The SDK has two categories of tests: unit tests that run without any credentials, and integration tests that call the live Apple Maps Server API and require a valid token.

Unit tests

Unit tests have no external dependencies and do not require APPLE_MAPS_TOKEN. Run them with:
./gradlew test
Or using the Makefile shortcut:
make test
Unit test classes follow the naming convention *Test (for example, GeocodeInputTest).

Integration tests

Integration tests call the real Apple Maps Server API. They are skipped automatically when APPLE_MAPS_TOKEN is not set, so they never block a CI build that has no credentials configured. Integration test classes follow the naming convention *IT (for example, AppleMapsIT).

Setting up your token

Running the full integration suite

./gradlew testDetail --tests com.williamcallahan.applemaps.AppleMapsIT
Or with the Makefile shortcut:
make test-detail

Running a single integration test

./gradlew testDetail --tests com.williamcallahan.applemaps.AppleMapsIT.geocodeHandlesPartialAndFullAddresses
Replace geocodeHandlesPartialAndFullAddresses with the name of any test method in AppleMapsIT.

Naming conventions

ConventionExample
Unit test class ends with TestGeocodeInputTest
Integration test class ends with ITAppleMapsIT
Never commit a real APPLE_MAPS_TOKEN value to the repository. Use .env locally (which is listed in .gitignore) or CI secrets for pipeline runs.