### Question:
LocationLookupService { @Programmatic public Location lookup(final String description) { RequestConfig requestConfig = RequestConfig.custom() .setSocketTimeout(TIMEOUT_SECONDS * 1000) .setConnectTimeout(TIMEOUT_SECONDS * 1000) .build(); CloseableHttpClient httpClient = HttpClientBuilder.create() .setDefaultRequestConfig(requestConfig) .useSystemProperties() .build(); try { String uri = BASEURL + MODE + "?address=" + URLEncoder.encode(description, "UTF-8") + "&sensor=false"; HttpGet httpGet = new HttpGet(uri); CloseableHttpResponse response = httpClient.execute(httpGet); try { HttpEntity entity = response.getEntity(); return extractLocation(EntityUtils.toString(entity, "UTF-8")); } finally { response.close(); } } catch (Exception ex) { return null; } }  @Programmatic Location lookup(final String description);  }### Answer:
@Ignore @Test public void whenValid() { Location location = locationLookupService.lookup("10 Downing Street,London,UK"); assertThat(location, is(not(nullValue()))); assertEquals(51.503, location.getLatitude(), 0.01); assertEquals(-0.128, location.getLongitude(), 0.01); }
@Ignore @Test public void whenInvalid() { Location location = locationLookupService.lookup("$%$%^Y%^fgnsdlfk glfg"); assertThat(location, is(nullValue())); }