More tests were added.

This commit is contained in:
Alexey Zinchenko 2019-06-17 22:46:35 +03:00
parent 1101ec03db
commit dbc5b08f43

View File

@ -187,6 +187,36 @@ public class CurrentWeatherIntegrationTest extends ApiTest {
System.out.println(weatherFuture.get());
}
@Test
public void whenGetAnySingleCurrentWeatherAsyncRequestAsJson_thenReturnNotNull() throws ExecutionException, InterruptedException {
final CompletableFuture<String> 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<String> 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<Weather> 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<String> 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<String> 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());
}
}