November 2024
Intermediate to advanced
300 pages
7h 12m
English
You’re testing an AddressRetriever. Given a latitude and longitude, its retrieve method returns an appropriately populated Address object.
| | import com.fasterxml.jackson.core.JsonProcessingException; |
| | import com.fasterxml.jackson.databind.DeserializationFeature; |
| | import com.fasterxml.jackson.databind.ObjectMapper; |
| | import com.langrsoft.util.HttpImpl; |
| | |
| | public class AddressRetriever { |
| | private static final String SERVER = |
| | "https://nominatim.openstreetmap.org"; |
| | |
| | public Address retrieve(double latitude, double longitude) { |
| | var locationParams = |
| | "lon=%.6f&lat=%.6f".formatted(latitude, longitude); |
| | |
Read now
Unlock full access