From dbc5b08f43d03d291dca3df2de99086155513b19 Mon Sep 17 00:00:00 2001 From: Alexey Zinchenko Date: Mon, 17 Jun 2019 22:46:35 +0300 Subject: [PATCH] More tests were added. --- .../test/CurrentWeatherIntegrationTest.java | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/src/test/java/com/github/prominence/openweathermap/api/test/CurrentWeatherIntegrationTest.java b/src/test/java/com/github/prominence/openweathermap/api/test/CurrentWeatherIntegrationTest.java index ea7e6c1..3a0cc56 100644 --- a/src/test/java/com/github/prominence/openweathermap/api/test/CurrentWeatherIntegrationTest.java +++ b/src/test/java/com/github/prominence/openweathermap/api/test/CurrentWeatherIntegrationTest.java @@ -187,6 +187,36 @@ public class CurrentWeatherIntegrationTest extends ApiTest { System.out.println(weatherFuture.get()); } + @Test + public void whenGetAnySingleCurrentWeatherAsyncRequestAsJson_thenReturnNotNull() throws ExecutionException, InterruptedException { + final CompletableFuture weatherFuture = getClient() + .currentWeather() + .single() + .byZipCodeAndCountry("220015", "by") + .language(Language.RUSSIAN) + .unit(Unit.METRIC_SYSTEM) + .retrieveAsync() + .asJSON(); + + assert weatherFuture != null; + System.out.println(weatherFuture.get()); + } + + @Test + public void whenGetAnySingleCurrentWeatherAsyncRequestAsHtml_thenReturnNotNull() throws ExecutionException, InterruptedException { + final CompletableFuture weatherFuture = getClient() + .currentWeather() + .single() + .byZipCodeAndCountry("220015", "by") + .language(Language.RUSSIAN) + .unit(Unit.METRIC_SYSTEM) + .retrieveAsync() + .asHTML(); + + assert weatherFuture != null; + System.out.println(weatherFuture.get()); + } + @Test public void whenGetMultipleCurrentWeatherByCoordinateRequestAsJava_thenReturnNotNull() { final List weatherList = getClient() @@ -329,4 +359,34 @@ public class CurrentWeatherIntegrationTest extends ApiTest { assert weatherFuture != null; System.out.println(weatherFuture.get()); } + + @Test + public void whenGetMultipleCurrentWeatherByCoordinateAndServerClusteringAsyncRequestAsJson_thenReturnNotNull() throws ExecutionException, InterruptedException { + final CompletableFuture weatherFuture = getClient() + .currentWeather() + .multiple() + .byCitiesInCycle(new Coordinate(55.5, 37.5), 10, true) + .language(Language.GERMAN) + .unit(Unit.IMPERIAL_SYSTEM) + .retrieveAsync() + .asJSON(); + + assert weatherFuture != null; + System.out.println(weatherFuture.get()); + } + + @Test + public void whenGetMultipleCurrentWeatherByCoordinateAndServerClusteringAsyncRequestAsHtml_thenReturnNotNull() throws ExecutionException, InterruptedException { + final CompletableFuture weatherFuture = getClient() + .currentWeather() + .multiple() + .byCitiesInCycle(new Coordinate(55.5, 37.5), 10, true) + .language(Language.GERMAN) + .unit(Unit.IMPERIAL_SYSTEM) + .retrieveAsync() + .asHTML(); + + assert weatherFuture != null; + System.out.println(weatherFuture.get()); + } }