### Question:
OpenWeatherMapSource extends HttpWeatherSource implements WeatherSource { JSONObject queryCurrentWeather(Location location) throws WeatherException { String url = getWeatherUrl(location); return queryJSON(url); } OpenWeatherMapSource(Context context); @Override Weather query(Location location); @Override Weather query(Location location, Locale locale);  }### Answer:
@Test public void testQueryOmskJSON() throws WeatherException, JSONException { OpenWeatherMapSource source = new OpenWeatherMapSource(context); Location location = new SimpleLocation("lat=54.96&lon=73.38", true); JSONObject json = source.queryCurrentWeather(location); assertNotNull(json); assertEquals("Omsk", json.getString("name")); }
@Test public void testQueryOmskNameJSON() throws WeatherException, JSONException { OpenWeatherMapSource source = new OpenWeatherMapSource(context); Location location = new SimpleLocation("q=omsk", false); JSONObject json = source.queryCurrentWeather(location); assertNotNull(json); assertEquals("Omsk", json.getString("name")); }