WeatherService { @Cacheable("forecast") public WeatherForecast getWeatherForecast(String country, String city) { logger.info("Requesting weather forecast for {}/{}", country, city); URI url = new UriTemplate(FORECAST_URL).expand(city, country, this.apiKey); return invoke(url, WeatherForecast.class); } WeatherService(RestTemplateBuilder restTemplateBuilder,
			WeatherAppProperties properties); @Cacheable("weather") Weather getWeather(String country, String city); @Cacheable("forecast") WeatherForecast getWeatherForecast(String country, String city);  }
@Test public void getWeatherForecast() { this.server.expect( requestTo(URL + "forecast?q=barcelona,es&APPID=test-ABC")) .andRespond(withSuccess( new ClassPathResource("forecast-barcelona.json", getClass()), MediaType.APPLICATION_JSON)); this.weatherService.getWeatherForecast("es", "barcelona"); this.server.verify(); }