mirror of
https://github.com/Prominence/openweathermap-java-api.git
synced 2026-01-11 04:16:44 +03:00
Removed debug output. Fixed async result retrieving in tests.
This commit is contained in:
parent
aed72a5ab5
commit
1812a39108
@ -49,7 +49,6 @@ public class RequestUrlBuilder {
|
|||||||
.collect(Collectors.joining("&"));
|
.collect(Collectors.joining("&"));
|
||||||
builder.append('?');
|
builder.append('?');
|
||||||
builder.append(joinedParameters);
|
builder.append(joinedParameters);
|
||||||
System.out.println(builder.toString());
|
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,6 +32,7 @@ import org.junit.Test;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
import java.util.concurrent.ExecutionException;
|
||||||
|
|
||||||
public class CurrentWeatherIntegrationTest extends ApiTest {
|
public class CurrentWeatherIntegrationTest extends ApiTest {
|
||||||
|
|
||||||
@ -157,7 +158,7 @@ public class CurrentWeatherIntegrationTest extends ApiTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenGetAnySingleCurrentWeatherAsyncRequestAsXml_thenReturnNotNull() {
|
public void whenGetAnySingleCurrentWeatherAsyncRequestAsXml_thenReturnNotNull() throws ExecutionException, InterruptedException {
|
||||||
final CompletableFuture<String> weatherXmlFuture = getClient()
|
final CompletableFuture<String> weatherXmlFuture = getClient()
|
||||||
.currentWeather()
|
.currentWeather()
|
||||||
.single()
|
.single()
|
||||||
@ -168,11 +169,11 @@ public class CurrentWeatherIntegrationTest extends ApiTest {
|
|||||||
.asXML();
|
.asXML();
|
||||||
|
|
||||||
assert weatherXmlFuture != null;
|
assert weatherXmlFuture != null;
|
||||||
weatherXmlFuture.thenAccept(System.out::println);
|
System.out.println(weatherXmlFuture.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenGetAnySingleCurrentWeatherAsyncRequestAsJava_thenReturnNotNull() {
|
public void whenGetAnySingleCurrentWeatherAsyncRequestAsJava_thenReturnNotNull() throws ExecutionException, InterruptedException {
|
||||||
final CompletableFuture<Weather> weatherFuture = getClient()
|
final CompletableFuture<Weather> weatherFuture = getClient()
|
||||||
.currentWeather()
|
.currentWeather()
|
||||||
.single()
|
.single()
|
||||||
@ -183,7 +184,7 @@ public class CurrentWeatherIntegrationTest extends ApiTest {
|
|||||||
.asJava();
|
.asJava();
|
||||||
|
|
||||||
assert weatherFuture != null;
|
assert weatherFuture != null;
|
||||||
weatherFuture.thenAccept(System.out::println);
|
System.out.println(weatherFuture.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -298,7 +299,7 @@ public class CurrentWeatherIntegrationTest extends ApiTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenGetMultipleCurrentWeatherByCoordinateAndServerClusteringAsyncRequestAsJava_thenReturnNotNull() {
|
public void whenGetMultipleCurrentWeatherByCoordinateAndServerClusteringAsyncRequestAsJava_thenReturnNotNull() throws ExecutionException, InterruptedException {
|
||||||
final CompletableFuture<List<Weather>> weatherListFuture = getClient()
|
final CompletableFuture<List<Weather>> weatherListFuture = getClient()
|
||||||
.currentWeather()
|
.currentWeather()
|
||||||
.multiple()
|
.multiple()
|
||||||
@ -309,14 +310,13 @@ public class CurrentWeatherIntegrationTest extends ApiTest {
|
|||||||
.asJava();
|
.asJava();
|
||||||
|
|
||||||
assert weatherListFuture != null;
|
assert weatherListFuture != null;
|
||||||
weatherListFuture.thenAccept(result -> {
|
List<Weather> weatherList = weatherListFuture.get();
|
||||||
assert result.size() > 0;
|
assert weatherList.size() > 0;
|
||||||
System.out.println(result);
|
System.out.println(weatherList);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenGetMultipleCurrentWeatherByCoordinateAndServerClusteringAsyncRequestAsXml_thenReturnNotNull() {
|
public void whenGetMultipleCurrentWeatherByCoordinateAndServerClusteringAsyncRequestAsXml_thenReturnNotNull() throws ExecutionException, InterruptedException {
|
||||||
final CompletableFuture<String> weatherFuture = getClient()
|
final CompletableFuture<String> weatherFuture = getClient()
|
||||||
.currentWeather()
|
.currentWeather()
|
||||||
.multiple()
|
.multiple()
|
||||||
@ -327,6 +327,6 @@ public class CurrentWeatherIntegrationTest extends ApiTest {
|
|||||||
.asXML();
|
.asXML();
|
||||||
|
|
||||||
assert weatherFuture != null;
|
assert weatherFuture != null;
|
||||||
weatherFuture.thenAccept(System.out::println);
|
System.out.println(weatherFuture.get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user