mirror of
https://github.com/Prominence/openweathermap-java-api.git
synced 2026-01-10 20:06:44 +03:00
Rechecked all tests. Fixed API customization possibilities.
This commit is contained in:
parent
ef138d3bfe
commit
a0e289cc2c
@ -29,8 +29,8 @@ public interface MultipleLocationsCurrentWeatherRequester {
|
|||||||
|
|
||||||
MultipleResultCurrentWeatherRequestCustomizer byRectangle(CoordinateRectangle rectangle, int zoom);
|
MultipleResultCurrentWeatherRequestCustomizer byRectangle(CoordinateRectangle rectangle, int zoom);
|
||||||
|
|
||||||
MultipleResultCurrentWeatherRequestCustomizer byCitiesInCycle(Coordinate point);
|
MultipleResultCitiesInCircleCurrentWeatherRequestCustomizer byCitiesInCycle(Coordinate point);
|
||||||
|
|
||||||
MultipleResultCurrentWeatherRequestCustomizer byCitiesInCycle(Coordinate point, int citiesCount);
|
MultipleResultCitiesInCircleCurrentWeatherRequestCustomizer byCitiesInCycle(Coordinate point, int citiesCount);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,21 +44,21 @@ public class MultipleLocationsCurrentWeatherRequesterImpl implements MultipleLoc
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MultipleResultCurrentWeatherRequestCustomizer byCitiesInCycle(Coordinate point, int citiesCount) {
|
public MultipleResultCitiesInCircleCurrentWeatherRequestCustomizer byCitiesInCycle(Coordinate point, int citiesCount) {
|
||||||
urlBuilder.append("find");
|
urlBuilder.append("find");
|
||||||
urlBuilder.addRequestParameter("lat", Double.toString(point.getLatitude()));
|
urlBuilder.addRequestParameter("lat", Double.toString(point.getLatitude()));
|
||||||
urlBuilder.addRequestParameter("lon", Double.toString(point.getLongitude()));
|
urlBuilder.addRequestParameter("lon", Double.toString(point.getLongitude()));
|
||||||
urlBuilder.addRequestParameter("cnt", Integer.toString(citiesCount));
|
urlBuilder.addRequestParameter("cnt", Integer.toString(citiesCount));
|
||||||
|
|
||||||
return new MultipleResultCurrentWeatherRequestCustomizerImpl(urlBuilder);
|
return new MultipleResultCitiesInCircleCurrentWeatherRequestCustomizerImpl(urlBuilder);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public MultipleResultCurrentWeatherRequestCustomizer byCitiesInCycle(Coordinate point) {
|
public MultipleResultCitiesInCircleCurrentWeatherRequestCustomizer byCitiesInCycle(Coordinate point) {
|
||||||
urlBuilder.append("find");
|
urlBuilder.append("find");
|
||||||
urlBuilder.addRequestParameter("lat", Double.toString(point.getLatitude()));
|
urlBuilder.addRequestParameter("lat", Double.toString(point.getLatitude()));
|
||||||
urlBuilder.addRequestParameter("lon", Double.toString(point.getLongitude()));
|
urlBuilder.addRequestParameter("lon", Double.toString(point.getLongitude()));
|
||||||
|
|
||||||
return new MultipleResultCurrentWeatherRequestCustomizerImpl(urlBuilder);
|
return new MultipleResultCitiesInCircleCurrentWeatherRequestCustomizerImpl(urlBuilder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2021 Alexey Zinchenko
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.github.prominence.openweathermap.api.request.weather.multiple;
|
||||||
|
|
||||||
|
import com.github.prominence.openweathermap.api.model.weather.Weather;
|
||||||
|
import com.github.prominence.openweathermap.api.request.AsyncRequestTerminator;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
public interface MultipleResultCitiesInCircleCurrentWeatherAsyncRequestTerminator extends AsyncRequestTerminator<List<Weather>, String> {
|
||||||
|
CompletableFuture<String> asXML();
|
||||||
|
}
|
||||||
@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2021 Alexey Zinchenko
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.github.prominence.openweathermap.api.request.weather.multiple;
|
||||||
|
|
||||||
|
import com.github.prominence.openweathermap.api.enums.UnitSystem;
|
||||||
|
import com.github.prominence.openweathermap.api.model.weather.Weather;
|
||||||
|
import com.github.prominence.openweathermap.api.request.RequestUrlBuilder;
|
||||||
|
import com.github.prominence.openweathermap.api.request.weather.CurrentWeatherResponseMapper;
|
||||||
|
import com.github.prominence.openweathermap.api.utils.RequestUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
|
public class MultipleResultCitiesInCircleCurrentWeatherAsyncRequestTerminatorImpl implements MultipleResultCitiesInCircleCurrentWeatherAsyncRequestTerminator {
|
||||||
|
|
||||||
|
private final RequestUrlBuilder urlBuilder;
|
||||||
|
private final UnitSystem unitSystem;
|
||||||
|
|
||||||
|
MultipleResultCitiesInCircleCurrentWeatherAsyncRequestTerminatorImpl(RequestUrlBuilder urlBuilder, UnitSystem unitSystem) {
|
||||||
|
this.urlBuilder = urlBuilder;
|
||||||
|
this.unitSystem = unitSystem;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CompletableFuture<List<Weather>> asJava() {
|
||||||
|
return CompletableFuture.supplyAsync(() -> new CurrentWeatherResponseMapper(unitSystem).getList(getRawResponse()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CompletableFuture<String> asJSON() {
|
||||||
|
return CompletableFuture.supplyAsync(this::getRawResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CompletableFuture<String> asXML() {
|
||||||
|
urlBuilder.addRequestParameter("mode", "xml");
|
||||||
|
return CompletableFuture.supplyAsync(this::getRawResponse);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getRawResponse() {
|
||||||
|
return RequestUtils.getResponse(urlBuilder.buildUrl());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2021 Alexey Zinchenko
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.github.prominence.openweathermap.api.request.weather.multiple;
|
||||||
|
|
||||||
|
import com.github.prominence.openweathermap.api.request.RequestCustomizer;
|
||||||
|
|
||||||
|
public interface MultipleResultCitiesInCircleCurrentWeatherRequestCustomizer extends RequestCustomizer<MultipleResultCitiesInCircleCurrentWeatherRequestCustomizer> {
|
||||||
|
|
||||||
|
MultipleResultCitiesInCircleCurrentWeatherRequestTerminator retrieve();
|
||||||
|
|
||||||
|
MultipleResultCitiesInCircleCurrentWeatherAsyncRequestTerminator retrieveAsync();
|
||||||
|
}
|
||||||
@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2021 Alexey Zinchenko
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.github.prominence.openweathermap.api.request.weather.multiple;
|
||||||
|
|
||||||
|
import com.github.prominence.openweathermap.api.enums.Language;
|
||||||
|
import com.github.prominence.openweathermap.api.enums.UnitSystem;
|
||||||
|
import com.github.prominence.openweathermap.api.request.RequestUrlBuilder;
|
||||||
|
|
||||||
|
public class MultipleResultCitiesInCircleCurrentWeatherRequestCustomizerImpl implements MultipleResultCitiesInCircleCurrentWeatherRequestCustomizer {
|
||||||
|
|
||||||
|
private final RequestUrlBuilder urlBuilder;
|
||||||
|
|
||||||
|
private Language language;
|
||||||
|
private UnitSystem unitSystem = UnitSystem.STANDARD;
|
||||||
|
|
||||||
|
MultipleResultCitiesInCircleCurrentWeatherRequestCustomizerImpl(RequestUrlBuilder urlBuilder) {
|
||||||
|
this.urlBuilder = urlBuilder;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MultipleResultCitiesInCircleCurrentWeatherRequestTerminator retrieve() {
|
||||||
|
urlBuilder.applyCustomization(language, unitSystem);
|
||||||
|
return new MultipleResultCitiesInCircleCurrentWeatherRequestTerminatorImpl(urlBuilder, unitSystem);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MultipleResultCitiesInCircleCurrentWeatherAsyncRequestTerminator retrieveAsync() {
|
||||||
|
urlBuilder.applyCustomization(language, unitSystem);
|
||||||
|
return new MultipleResultCitiesInCircleCurrentWeatherAsyncRequestTerminatorImpl(urlBuilder, unitSystem);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MultipleResultCitiesInCircleCurrentWeatherRequestCustomizer language(Language language) {
|
||||||
|
this.language = language;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MultipleResultCitiesInCircleCurrentWeatherRequestCustomizer unitSystem(UnitSystem unitSystem) {
|
||||||
|
this.unitSystem = unitSystem;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -20,13 +20,13 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.github.prominence.openweathermap.api.request.weather;
|
package com.github.prominence.openweathermap.api.request.weather.multiple;
|
||||||
|
|
||||||
|
import com.github.prominence.openweathermap.api.model.weather.Weather;
|
||||||
import com.github.prominence.openweathermap.api.request.RequestTerminator;
|
import com.github.prominence.openweathermap.api.request.RequestTerminator;
|
||||||
|
|
||||||
public interface CurrentWeatherRequestTerminator<T, S> extends RequestTerminator<T, S> {
|
import java.util.List;
|
||||||
|
|
||||||
S asXML();
|
public interface MultipleResultCitiesInCircleCurrentWeatherRequestTerminator extends RequestTerminator<List<Weather>, String> {
|
||||||
|
String asXML();
|
||||||
S asHTML();
|
|
||||||
}
|
}
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2021 Alexey Zinchenko
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
* in the Software without restriction, including without limitation the rights
|
||||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
* copies of the Software, and to permit persons to whom the Software is
|
||||||
|
* furnished to do so, subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all
|
||||||
|
* copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
* SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.github.prominence.openweathermap.api.request.weather.multiple;
|
||||||
|
|
||||||
|
import com.github.prominence.openweathermap.api.enums.UnitSystem;
|
||||||
|
import com.github.prominence.openweathermap.api.model.weather.Weather;
|
||||||
|
import com.github.prominence.openweathermap.api.request.RequestUrlBuilder;
|
||||||
|
import com.github.prominence.openweathermap.api.request.weather.CurrentWeatherResponseMapper;
|
||||||
|
import com.github.prominence.openweathermap.api.utils.RequestUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class MultipleResultCitiesInCircleCurrentWeatherRequestTerminatorImpl implements MultipleResultCitiesInCircleCurrentWeatherRequestTerminator {
|
||||||
|
|
||||||
|
private final RequestUrlBuilder urlBuilder;
|
||||||
|
private final UnitSystem unitSystem;
|
||||||
|
|
||||||
|
MultipleResultCitiesInCircleCurrentWeatherRequestTerminatorImpl(RequestUrlBuilder urlBuilder, UnitSystem unitSystem) {
|
||||||
|
this.urlBuilder = urlBuilder;
|
||||||
|
this.unitSystem = unitSystem;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Weather> asJava() {
|
||||||
|
return new CurrentWeatherResponseMapper(unitSystem).getList(getRawResponse());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String asJSON() {
|
||||||
|
return getRawResponse();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String asXML() {
|
||||||
|
urlBuilder.addRequestParameter("mode", "xml");
|
||||||
|
return getRawResponse();
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getRawResponse() {
|
||||||
|
return RequestUtils.getResponse(urlBuilder.buildUrl());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -23,10 +23,9 @@
|
|||||||
package com.github.prominence.openweathermap.api.request.weather.multiple;
|
package com.github.prominence.openweathermap.api.request.weather.multiple;
|
||||||
|
|
||||||
import com.github.prominence.openweathermap.api.model.weather.Weather;
|
import com.github.prominence.openweathermap.api.model.weather.Weather;
|
||||||
import com.github.prominence.openweathermap.api.request.weather.CurrentWeatherRequestTerminator;
|
import com.github.prominence.openweathermap.api.request.AsyncRequestTerminator;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CompletableFuture;
|
|
||||||
|
|
||||||
public interface MultipleResultCurrentWeatherAsyncRequestTerminator extends CurrentWeatherRequestTerminator<CompletableFuture<List<Weather>>, CompletableFuture<String>> {
|
public interface MultipleResultCurrentWeatherAsyncRequestTerminator extends AsyncRequestTerminator<List<Weather>, String> {
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,18 +51,6 @@ public class MultipleResultCurrentWeatherAsyncRequestTerminatorImpl implements M
|
|||||||
return CompletableFuture.supplyAsync(this::getRawResponse);
|
return CompletableFuture.supplyAsync(this::getRawResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public CompletableFuture<String> asXML() {
|
|
||||||
urlBuilder.addRequestParameter("mode", "xml");
|
|
||||||
return CompletableFuture.supplyAsync(this::getRawResponse);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public CompletableFuture<String> asHTML() {
|
|
||||||
urlBuilder.addRequestParameter("mode", "html");
|
|
||||||
return CompletableFuture.supplyAsync(this::getRawResponse);
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getRawResponse() {
|
private String getRawResponse() {
|
||||||
return RequestUtils.getResponse(urlBuilder.buildUrl());
|
return RequestUtils.getResponse(urlBuilder.buildUrl());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,9 +23,9 @@
|
|||||||
package com.github.prominence.openweathermap.api.request.weather.multiple;
|
package com.github.prominence.openweathermap.api.request.weather.multiple;
|
||||||
|
|
||||||
import com.github.prominence.openweathermap.api.model.weather.Weather;
|
import com.github.prominence.openweathermap.api.model.weather.Weather;
|
||||||
import com.github.prominence.openweathermap.api.request.weather.CurrentWeatherRequestTerminator;
|
import com.github.prominence.openweathermap.api.request.RequestTerminator;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface MultipleResultCurrentWeatherRequestTerminator extends CurrentWeatherRequestTerminator<List<Weather>, String> {
|
public interface MultipleResultCurrentWeatherRequestTerminator extends RequestTerminator<List<Weather>, String> {
|
||||||
}
|
}
|
||||||
|
|||||||
@ -50,18 +50,6 @@ public class MultipleResultCurrentWeatherRequestTerminatorImpl implements Multip
|
|||||||
return getRawResponse();
|
return getRawResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String asXML() {
|
|
||||||
urlBuilder.addRequestParameter("mode", "xml");
|
|
||||||
return getRawResponse();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String asHTML() {
|
|
||||||
urlBuilder.addRequestParameter("mode", "html");
|
|
||||||
return getRawResponse();
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getRawResponse() {
|
private String getRawResponse() {
|
||||||
return RequestUtils.getResponse(urlBuilder.buildUrl());
|
return RequestUtils.getResponse(urlBuilder.buildUrl());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,9 +30,13 @@ public interface SingleLocationCurrentWeatherRequester {
|
|||||||
|
|
||||||
SingleResultCurrentWeatherRequestCustomizer byCityName(String cityName, String countryCode);
|
SingleResultCurrentWeatherRequestCustomizer byCityName(String cityName, String countryCode);
|
||||||
|
|
||||||
|
SingleResultCurrentWeatherRequestCustomizer byCityName(String cityName, String stateCode, String countryCode);
|
||||||
|
|
||||||
SingleResultCurrentWeatherRequestCustomizer byCityId(long cityId);
|
SingleResultCurrentWeatherRequestCustomizer byCityId(long cityId);
|
||||||
|
|
||||||
SingleResultCurrentWeatherRequestCustomizer byCoordinate(Coordinate coordinate);
|
SingleResultCurrentWeatherRequestCustomizer byCoordinate(Coordinate coordinate);
|
||||||
|
|
||||||
SingleResultCurrentWeatherRequestCustomizer byZipCodeAndCountry(String zipCode, String countryCode);
|
SingleResultCurrentWeatherRequestCustomizer byZipCodeAndCountry(String zipCode, String countryCode);
|
||||||
|
|
||||||
|
SingleResultCurrentWeatherRequestCustomizer byZipCodeInUSA(String zipCode);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,6 +44,12 @@ public class SingleLocationCurrentWeatherRequesterImpl implements SingleLocation
|
|||||||
return new SingleResultCurrentWeatherRequestCustomizerImpl(urlBuilder);
|
return new SingleResultCurrentWeatherRequestCustomizerImpl(urlBuilder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SingleResultCurrentWeatherRequestCustomizer byCityName(String cityName, String stateCode, String countryCode) {
|
||||||
|
urlBuilder.addRequestParameter("q", cityName + "," + stateCode + "," + countryCode);
|
||||||
|
return new SingleResultCurrentWeatherRequestCustomizerImpl(urlBuilder);
|
||||||
|
}
|
||||||
|
|
||||||
public SingleResultCurrentWeatherRequestCustomizer byCityId(long cityId) {
|
public SingleResultCurrentWeatherRequestCustomizer byCityId(long cityId) {
|
||||||
urlBuilder.addRequestParameter("id", cityId);
|
urlBuilder.addRequestParameter("id", cityId);
|
||||||
return new SingleResultCurrentWeatherRequestCustomizerImpl(urlBuilder);
|
return new SingleResultCurrentWeatherRequestCustomizerImpl(urlBuilder);
|
||||||
@ -59,4 +65,10 @@ public class SingleLocationCurrentWeatherRequesterImpl implements SingleLocation
|
|||||||
urlBuilder.addRequestParameter("zip", zipCode + "," + countryCode);
|
urlBuilder.addRequestParameter("zip", zipCode + "," + countryCode);
|
||||||
return new SingleResultCurrentWeatherRequestCustomizerImpl(urlBuilder);
|
return new SingleResultCurrentWeatherRequestCustomizerImpl(urlBuilder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SingleResultCurrentWeatherRequestCustomizer byZipCodeInUSA(String zipCode) {
|
||||||
|
urlBuilder.addRequestParameter("zip", zipCode);
|
||||||
|
return new SingleResultCurrentWeatherRequestCustomizerImpl(urlBuilder);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,9 +23,12 @@
|
|||||||
package com.github.prominence.openweathermap.api.request.weather.single;
|
package com.github.prominence.openweathermap.api.request.weather.single;
|
||||||
|
|
||||||
import com.github.prominence.openweathermap.api.model.weather.Weather;
|
import com.github.prominence.openweathermap.api.model.weather.Weather;
|
||||||
import com.github.prominence.openweathermap.api.request.weather.CurrentWeatherRequestTerminator;
|
import com.github.prominence.openweathermap.api.request.AsyncRequestTerminator;
|
||||||
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
|
|
||||||
public interface SingleResultCurrentWeatherAsyncRequestTerminator extends CurrentWeatherRequestTerminator<CompletableFuture<Weather>, CompletableFuture<String>> {
|
public interface SingleResultCurrentWeatherAsyncRequestTerminator extends AsyncRequestTerminator<Weather, String> {
|
||||||
|
CompletableFuture<String> asXML();
|
||||||
|
|
||||||
|
CompletableFuture<String> asHTML();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,10 @@
|
|||||||
package com.github.prominence.openweathermap.api.request.weather.single;
|
package com.github.prominence.openweathermap.api.request.weather.single;
|
||||||
|
|
||||||
import com.github.prominence.openweathermap.api.model.weather.Weather;
|
import com.github.prominence.openweathermap.api.model.weather.Weather;
|
||||||
import com.github.prominence.openweathermap.api.request.weather.CurrentWeatherRequestTerminator;
|
import com.github.prominence.openweathermap.api.request.RequestTerminator;
|
||||||
|
|
||||||
public interface SingleResultCurrentWeatherRequestTerminator extends CurrentWeatherRequestTerminator<Weather, String> {
|
public interface SingleResultCurrentWeatherRequestTerminator extends RequestTerminator<Weather, String> {
|
||||||
|
String asXML();
|
||||||
|
|
||||||
|
String asHTML();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,9 +39,8 @@ import java.util.concurrent.CompletableFuture;
|
|||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
|
|
||||||
public class MultipleResultCurrentWeatherIntegrationTest extends ApiTest {
|
public class MultipleResultCurrentWeatherIntegrationTest extends ApiTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenGetMultipleCurrentWeatherByCoordinateRequestAsJava_thenReturnNotNull() {
|
public void whenGetMultipleCurrentWeatherByCoordinateRectangleRequestAsJava_thenReturnNotNull() {
|
||||||
final List<Weather> weatherList = getClient()
|
final List<Weather> weatherList = getClient()
|
||||||
.currentWeather()
|
.currentWeather()
|
||||||
.multiple()
|
.multiple()
|
||||||
@ -52,40 +51,31 @@ public class MultipleResultCurrentWeatherIntegrationTest extends ApiTest {
|
|||||||
.asJava();
|
.asJava();
|
||||||
|
|
||||||
Assert.assertNotNull(weatherList);
|
Assert.assertNotNull(weatherList);
|
||||||
Assert.assertTrue(weatherList.size() > 0);
|
for (Weather weather : weatherList) {
|
||||||
System.out.println(weatherList);
|
Assert.assertNotNull(weather);
|
||||||
|
Assert.assertNotNull(weather.getState());
|
||||||
|
Assert.assertNotNull(weather.getDescription());
|
||||||
|
Assert.assertNotNull(weather.getRequestedOn());
|
||||||
|
Assert.assertNotNull(weather.getTemperature());
|
||||||
|
Assert.assertNotNull(weather.getLocation());
|
||||||
|
Assert.assertNotNull(weather.getAtmosphericPressure());
|
||||||
|
Assert.assertNotNull(weather.getHumidity());
|
||||||
|
Assert.assertNotNull(weather.getWind());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenGetMultipleCurrentWeatherByCoordinateAndServerClusteringRequestAsJava_thenReturnNotNull() {
|
public void whenGetMultipleCurrentWeatherByCoordinateRectangleRequestAsJSON_thenReturnNotNull() {
|
||||||
final List<Weather> weatherList = getClient()
|
final String weatherJson = getClient()
|
||||||
.currentWeather()
|
.currentWeather()
|
||||||
.multiple()
|
.multiple()
|
||||||
.byRectangle(CoordinateRectangle.forValues(12, 32, 15, 37), 10)
|
.byRectangle(CoordinateRectangle.forValues(12, 32, 15, 37), 10)
|
||||||
.language(Language.ROMANIAN)
|
.language(Language.ROMANIAN)
|
||||||
.unitSystem(UnitSystem.METRIC)
|
.unitSystem(UnitSystem.METRIC)
|
||||||
.retrieve()
|
.retrieve()
|
||||||
.asJava();
|
.asJSON();
|
||||||
|
|
||||||
Assert.assertNotNull(weatherList);
|
Assert.assertTrue(weatherJson.startsWith("{"));
|
||||||
Assert.assertTrue(weatherList.size() > 0);
|
|
||||||
System.out.println(weatherList);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void whenGetMultipleCurrentWeatherByCitiesInCycleAndCountRequestAsJava_thenReturnNotNull() {
|
|
||||||
final List<Weather> weatherList = getClient()
|
|
||||||
.currentWeather()
|
|
||||||
.multiple()
|
|
||||||
.byCitiesInCycle(Coordinate.forValues(55.5, 37.5), 10)
|
|
||||||
.language(Language.GERMAN)
|
|
||||||
.unitSystem(UnitSystem.IMPERIAL)
|
|
||||||
.retrieve()
|
|
||||||
.asJava();
|
|
||||||
|
|
||||||
Assert.assertNotNull(weatherList);
|
|
||||||
Assert.assertTrue(weatherList.size() > 0);
|
|
||||||
System.out.println(weatherList);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -100,13 +90,78 @@ public class MultipleResultCurrentWeatherIntegrationTest extends ApiTest {
|
|||||||
.asJava();
|
.asJava();
|
||||||
|
|
||||||
Assert.assertNotNull(weatherList);
|
Assert.assertNotNull(weatherList);
|
||||||
Assert.assertTrue(weatherList.size() > 0);
|
for (Weather weather : weatherList) {
|
||||||
System.out.println(weatherList);
|
System.out.println(weather);
|
||||||
|
Assert.assertNotNull(weather);
|
||||||
|
Assert.assertNotNull(weather.getState());
|
||||||
|
Assert.assertNotNull(weather.getDescription());
|
||||||
|
Assert.assertNotNull(weather.getRequestedOn());
|
||||||
|
Assert.assertNotNull(weather.getTemperature());
|
||||||
|
Assert.assertNotNull(weather.getLocation());
|
||||||
|
Assert.assertNotNull(weather.getAtmosphericPressure());
|
||||||
|
Assert.assertNotNull(weather.getHumidity());
|
||||||
|
Assert.assertNotNull(weather.getWind());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenGetMultipleCurrentWeatherByCitiesInCycleRequestAsJson_thenReturnNotNull() {
|
public void whenGetMultipleCurrentWeatherByCitiesInCycleRequestAsJSON_thenReturnNotNull() {
|
||||||
final String weather = getClient()
|
final String weatherJson = getClient()
|
||||||
|
.currentWeather()
|
||||||
|
.multiple()
|
||||||
|
.byCitiesInCycle(Coordinate.forValues(55.5, 37.5))
|
||||||
|
.language(Language.GERMAN)
|
||||||
|
.unitSystem(UnitSystem.IMPERIAL)
|
||||||
|
.retrieve()
|
||||||
|
.asJSON();
|
||||||
|
|
||||||
|
Assert.assertTrue(weatherJson.startsWith("{"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenGetMultipleCurrentWeatherByCitiesInCycleRequestAsXML_thenReturnNotNull() {
|
||||||
|
final String weatherXml = getClient()
|
||||||
|
.currentWeather()
|
||||||
|
.multiple()
|
||||||
|
.byCitiesInCycle(Coordinate.forValues(55.5, 37.5))
|
||||||
|
.language(Language.GERMAN)
|
||||||
|
.unitSystem(UnitSystem.IMPERIAL)
|
||||||
|
.retrieve()
|
||||||
|
.asXML();
|
||||||
|
|
||||||
|
Assert.assertTrue(weatherXml.startsWith("<"));
|
||||||
|
System.out.println(weatherXml);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenGetMultipleCurrentWeatherByCitiesInCycleAndCountRequestAsJava_thenReturnNotNull() {
|
||||||
|
final List<Weather> weatherList = getClient()
|
||||||
|
.currentWeather()
|
||||||
|
.multiple()
|
||||||
|
.byCitiesInCycle(Coordinate.forValues(55.5, 37.5), 10)
|
||||||
|
.language(Language.GERMAN)
|
||||||
|
.unitSystem(UnitSystem.IMPERIAL)
|
||||||
|
.retrieve()
|
||||||
|
.asJava();
|
||||||
|
|
||||||
|
Assert.assertNotNull(weatherList);
|
||||||
|
for (Weather weather : weatherList) {
|
||||||
|
System.out.println(weather);
|
||||||
|
Assert.assertNotNull(weather);
|
||||||
|
Assert.assertNotNull(weather.getState());
|
||||||
|
Assert.assertNotNull(weather.getDescription());
|
||||||
|
Assert.assertNotNull(weather.getRequestedOn());
|
||||||
|
Assert.assertNotNull(weather.getTemperature());
|
||||||
|
Assert.assertNotNull(weather.getLocation());
|
||||||
|
Assert.assertNotNull(weather.getAtmosphericPressure());
|
||||||
|
Assert.assertNotNull(weather.getHumidity());
|
||||||
|
Assert.assertNotNull(weather.getWind());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenGetMultipleCurrentWeatherByCitiesInCycleAndCountRequestAsJSON_thenReturnNotNull() {
|
||||||
|
final String weatherJson = getClient()
|
||||||
.currentWeather()
|
.currentWeather()
|
||||||
.multiple()
|
.multiple()
|
||||||
.byCitiesInCycle(Coordinate.forValues(55.5, 37.5), 10)
|
.byCitiesInCycle(Coordinate.forValues(55.5, 37.5), 10)
|
||||||
@ -115,13 +170,12 @@ public class MultipleResultCurrentWeatherIntegrationTest extends ApiTest {
|
|||||||
.retrieve()
|
.retrieve()
|
||||||
.asJSON();
|
.asJSON();
|
||||||
|
|
||||||
Assert.assertNotNull(weather);
|
Assert.assertTrue(weatherJson.startsWith("{"));
|
||||||
System.out.println(weather);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenGetMultipleCurrentWeatherByCitiesInCycleRequestAsXml_thenReturnNotNull() {
|
public void whenGetMultipleCurrentWeatherByCitiesInCycleAndCountRequestAsXML_thenReturnNotNull() {
|
||||||
final String weather = getClient()
|
final String weatherXml = getClient()
|
||||||
.currentWeather()
|
.currentWeather()
|
||||||
.multiple()
|
.multiple()
|
||||||
.byCitiesInCycle(Coordinate.forValues(55.5, 37.5), 10)
|
.byCitiesInCycle(Coordinate.forValues(55.5, 37.5), 10)
|
||||||
@ -130,27 +184,11 @@ public class MultipleResultCurrentWeatherIntegrationTest extends ApiTest {
|
|||||||
.retrieve()
|
.retrieve()
|
||||||
.asXML();
|
.asXML();
|
||||||
|
|
||||||
Assert.assertNotNull(weather);
|
Assert.assertTrue(weatherXml.startsWith("<"));
|
||||||
System.out.println(weather);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenGetMultipleCurrentWeatherByCitiesInCycleRequestAsHtml_thenReturnNotNull() {
|
public void whenGetMultipleCurrentWeatherByCoordinateAsyncRequestAsJava_thenReturnNotNull() throws ExecutionException, InterruptedException {
|
||||||
final String weather = getClient()
|
|
||||||
.currentWeather()
|
|
||||||
.multiple()
|
|
||||||
.byCitiesInCycle(Coordinate.forValues(55.5, 37.5), 10)
|
|
||||||
.language(Language.GERMAN)
|
|
||||||
.unitSystem(UnitSystem.IMPERIAL)
|
|
||||||
.retrieve()
|
|
||||||
.asHTML();
|
|
||||||
|
|
||||||
Assert.assertNotNull(weather);
|
|
||||||
System.out.println(weather);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void whenGetMultipleCurrentWeatherByCoordinateAndServerClusteringAsyncRequestAsJava_thenReturnNotNull() throws ExecutionException, InterruptedException {
|
|
||||||
final CompletableFuture<List<Weather>> weatherListFuture = getClient()
|
final CompletableFuture<List<Weather>> weatherListFuture = getClient()
|
||||||
.currentWeather()
|
.currentWeather()
|
||||||
.multiple()
|
.multiple()
|
||||||
@ -167,22 +205,7 @@ public class MultipleResultCurrentWeatherIntegrationTest extends ApiTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenGetMultipleCurrentWeatherByCoordinateAndServerClusteringAsyncRequestAsXml_thenReturnNotNull() throws ExecutionException, InterruptedException {
|
public void whenGetMultipleCurrentWeatherByCoordinateAsyncRequestAsJson_thenReturnNotNull() throws ExecutionException, InterruptedException {
|
||||||
final CompletableFuture<String> weatherFuture = getClient()
|
|
||||||
.currentWeather()
|
|
||||||
.multiple()
|
|
||||||
.byCitiesInCycle(Coordinate.forValues(55.5, 37.5), 10)
|
|
||||||
.language(Language.GERMAN)
|
|
||||||
.unitSystem(UnitSystem.IMPERIAL)
|
|
||||||
.retrieveAsync()
|
|
||||||
.asXML();
|
|
||||||
|
|
||||||
Assert.assertNotNull(weatherFuture);
|
|
||||||
System.out.println(weatherFuture.get());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void whenGetMultipleCurrentWeatherByCoordinateAndServerClusteringAsyncRequestAsJson_thenReturnNotNull() throws ExecutionException, InterruptedException {
|
|
||||||
final CompletableFuture<String> weatherFuture = getClient()
|
final CompletableFuture<String> weatherFuture = getClient()
|
||||||
.currentWeather()
|
.currentWeather()
|
||||||
.multiple()
|
.multiple()
|
||||||
@ -196,21 +219,6 @@ public class MultipleResultCurrentWeatherIntegrationTest extends ApiTest {
|
|||||||
System.out.println(weatherFuture.get());
|
System.out.println(weatherFuture.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void whenGetMultipleCurrentWeatherByCoordinateAndServerClusteringAsyncRequestAsHtml_thenReturnNotNull() throws ExecutionException, InterruptedException {
|
|
||||||
final CompletableFuture<String> weatherFuture = getClient()
|
|
||||||
.currentWeather()
|
|
||||||
.multiple()
|
|
||||||
.byCitiesInCycle(Coordinate.forValues(55.5, 37.5), 10)
|
|
||||||
.language(Language.GERMAN)
|
|
||||||
.unitSystem(UnitSystem.IMPERIAL)
|
|
||||||
.retrieveAsync()
|
|
||||||
.asHTML();
|
|
||||||
|
|
||||||
Assert.assertNotNull(weatherFuture);
|
|
||||||
System.out.println(weatherFuture.get());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test(expected = InvalidAuthTokenException.class)
|
@Test(expected = InvalidAuthTokenException.class)
|
||||||
public void whenRequestCurrentWeatherWithInvalidApiKey_thenThrowAnException() {
|
public void whenRequestCurrentWeatherWithInvalidApiKey_thenThrowAnException() {
|
||||||
OpenWeatherMapClient client = new OpenWeatherMapClient("invalidKey");
|
OpenWeatherMapClient client = new OpenWeatherMapClient("invalidKey");
|
||||||
|
|||||||
@ -37,21 +37,201 @@ import java.util.concurrent.CompletableFuture;
|
|||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
|
|
||||||
public class SingleResultCurrentWeatherIntegrationTest extends ApiTest {
|
public class SingleResultCurrentWeatherIntegrationTest extends ApiTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenGetSingleCurrentWeatherByCoordinateRequestAsJava_thenReturnNotNull() {
|
public void whenGetSingleCurrentWeatherByCityNameRequestAsJava_thenReturnNotNull() {
|
||||||
final Weather weather = getClient()
|
final Weather weather = getClient()
|
||||||
.currentWeather()
|
.currentWeather()
|
||||||
.single()
|
.single()
|
||||||
.byCoordinate(Coordinate.forValues(5, 5))
|
.byCityName("Minsk")
|
||||||
|
.language(Language.RUSSIAN)
|
||||||
.unitSystem(UnitSystem.METRIC)
|
.unitSystem(UnitSystem.METRIC)
|
||||||
.retrieve()
|
.retrieve()
|
||||||
.asJava();
|
.asJava();
|
||||||
|
|
||||||
Assert.assertNotNull(weather);
|
Assert.assertNotNull(weather);
|
||||||
|
Assert.assertNotNull(weather.getState());
|
||||||
|
Assert.assertNotNull(weather.getDescription());
|
||||||
|
Assert.assertNotNull(weather.getRequestedOn());
|
||||||
|
Assert.assertNotNull(weather.getTemperature());
|
||||||
|
Assert.assertNotNull(weather.getLocation());
|
||||||
|
Assert.assertNotNull(weather.getAtmosphericPressure());
|
||||||
|
Assert.assertNotNull(weather.getHumidity());
|
||||||
|
Assert.assertNotNull(weather.getWind());
|
||||||
System.out.println(weather);
|
System.out.println(weather);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenGetSingleCurrentWeatherByCityNameRequestAsJSON_thenReturnNotNull() {
|
||||||
|
final String weatherJson = getClient()
|
||||||
|
.currentWeather()
|
||||||
|
.single()
|
||||||
|
.byCityName("Minsk")
|
||||||
|
.language(Language.RUSSIAN)
|
||||||
|
.unitSystem(UnitSystem.IMPERIAL)
|
||||||
|
.retrieve()
|
||||||
|
.asJSON();
|
||||||
|
|
||||||
|
Assert.assertTrue(weatherJson.startsWith("{"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenGetSingleCurrentWeatherByCityNameRequestAsXML_thenReturnNotNull() {
|
||||||
|
final String weatherXml = getClient()
|
||||||
|
.currentWeather()
|
||||||
|
.single()
|
||||||
|
.byCityName("Minsk")
|
||||||
|
.language(Language.RUSSIAN)
|
||||||
|
.unitSystem(UnitSystem.STANDARD)
|
||||||
|
.retrieve()
|
||||||
|
.asXML();
|
||||||
|
|
||||||
|
Assert.assertTrue(weatherXml.startsWith("<"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenGetSingleCurrentWeatherByCityNameRequestAsHTML_thenReturnNotNull() {
|
||||||
|
final String weatherHtml = getClient()
|
||||||
|
.currentWeather()
|
||||||
|
.single()
|
||||||
|
.byCityName("Minsk")
|
||||||
|
.language(Language.RUSSIAN)
|
||||||
|
.unitSystem(UnitSystem.METRIC)
|
||||||
|
.retrieve()
|
||||||
|
.asHTML();
|
||||||
|
|
||||||
|
Assert.assertTrue(weatherHtml.startsWith("<"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenGetSingleCurrentWeatherByCityNameAndCountryCodeRequestAsJava_thenReturnNotNull() {
|
||||||
|
final Weather weather = getClient()
|
||||||
|
.currentWeather()
|
||||||
|
.single()
|
||||||
|
.byCityName("Minsk", "BY")
|
||||||
|
.language(Language.RUSSIAN)
|
||||||
|
.unitSystem(UnitSystem.METRIC)
|
||||||
|
.retrieve()
|
||||||
|
.asJava();
|
||||||
|
|
||||||
|
Assert.assertNotNull(weather);
|
||||||
|
Assert.assertNotNull(weather.getState());
|
||||||
|
Assert.assertNotNull(weather.getDescription());
|
||||||
|
Assert.assertNotNull(weather.getRequestedOn());
|
||||||
|
Assert.assertNotNull(weather.getTemperature());
|
||||||
|
Assert.assertNotNull(weather.getLocation());
|
||||||
|
Assert.assertNotNull(weather.getAtmosphericPressure());
|
||||||
|
Assert.assertNotNull(weather.getHumidity());
|
||||||
|
Assert.assertNotNull(weather.getWind());
|
||||||
|
System.out.println(weather);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenGetSingleCurrentWeatherByCityNameAndCountryCodeRequestAsJSON_thenReturnNotNull() {
|
||||||
|
final String weatherJson = getClient()
|
||||||
|
.currentWeather()
|
||||||
|
.single()
|
||||||
|
.byCityName("Minsk", "by")
|
||||||
|
.language(Language.RUSSIAN)
|
||||||
|
.unitSystem(UnitSystem.METRIC)
|
||||||
|
.retrieve()
|
||||||
|
.asJSON();
|
||||||
|
|
||||||
|
Assert.assertTrue(weatherJson.startsWith("{"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenGetSingleCurrentWeatherByCityNameAndCountryCodeRequestAsXML_thenReturnNotNull() {
|
||||||
|
final String weatherXml = getClient()
|
||||||
|
.currentWeather()
|
||||||
|
.single()
|
||||||
|
.byCityName("Minsk", "by")
|
||||||
|
.language(Language.RUSSIAN)
|
||||||
|
.unitSystem(UnitSystem.METRIC)
|
||||||
|
.retrieve()
|
||||||
|
.asXML();
|
||||||
|
|
||||||
|
Assert.assertTrue(weatherXml.startsWith("<"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenGetSingleCurrentWeatherByCityNameAndCountryCodeRequestAsHTML_thenReturnNotNull() {
|
||||||
|
final String weatherHtml = getClient()
|
||||||
|
.currentWeather()
|
||||||
|
.single()
|
||||||
|
.byCityName("Minsk", "by")
|
||||||
|
.language(Language.RUSSIAN)
|
||||||
|
.unitSystem(UnitSystem.STANDARD)
|
||||||
|
.retrieve()
|
||||||
|
.asHTML();
|
||||||
|
|
||||||
|
Assert.assertTrue(weatherHtml.startsWith("<"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenGetSingleCurrentWeatherByCityNameAndStateCodeAndCountryCodeRequestAsJava_thenReturnNotNull() {
|
||||||
|
final Weather weather = getClient()
|
||||||
|
.currentWeather()
|
||||||
|
.single()
|
||||||
|
.byCityName("New York", "ny", "us")
|
||||||
|
.language(Language.SLOVAK)
|
||||||
|
.unitSystem(UnitSystem.METRIC)
|
||||||
|
.retrieve()
|
||||||
|
.asJava();
|
||||||
|
|
||||||
|
Assert.assertNotNull(weather);
|
||||||
|
Assert.assertNotNull(weather.getState());
|
||||||
|
Assert.assertNotNull(weather.getDescription());
|
||||||
|
Assert.assertNotNull(weather.getRequestedOn());
|
||||||
|
Assert.assertNotNull(weather.getTemperature());
|
||||||
|
Assert.assertNotNull(weather.getLocation());
|
||||||
|
Assert.assertNotNull(weather.getAtmosphericPressure());
|
||||||
|
Assert.assertNotNull(weather.getHumidity());
|
||||||
|
Assert.assertNotNull(weather.getWind());
|
||||||
|
System.out.println(weather);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenGetSingleCurrentWeatherByCityNameAndStateCodeAndCountryCodeRequestAsJSON_thenReturnNotNull() {
|
||||||
|
final String weatherJson = getClient()
|
||||||
|
.currentWeather()
|
||||||
|
.single()
|
||||||
|
.byCityName("New York", "ny", "us")
|
||||||
|
.language(Language.HUNGARIAN)
|
||||||
|
.unitSystem(UnitSystem.IMPERIAL)
|
||||||
|
.retrieve()
|
||||||
|
.asJSON();
|
||||||
|
|
||||||
|
Assert.assertTrue(weatherJson.startsWith("{"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenGetSingleCurrentWeatherByCityNameAndStateCodeAndCountryCodeRequestAsXML_thenReturnNotNull() {
|
||||||
|
final String weatherXml = getClient()
|
||||||
|
.currentWeather()
|
||||||
|
.single()
|
||||||
|
.byCityName("New York", "ny", "us")
|
||||||
|
.language(Language.ROMANIAN)
|
||||||
|
.unitSystem(UnitSystem.METRIC)
|
||||||
|
.retrieve()
|
||||||
|
.asXML();
|
||||||
|
|
||||||
|
Assert.assertTrue(weatherXml.startsWith("<"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenGetSingleCurrentWeatherByCityNameAndStateCodeAndCountryCodeRequestAsHTML_thenReturnNotNull() {
|
||||||
|
final String weatherHtml = getClient()
|
||||||
|
.currentWeather()
|
||||||
|
.single()
|
||||||
|
.byCityName("New York", "ny", "us")
|
||||||
|
.language(Language.ARABIC)
|
||||||
|
.unitSystem(UnitSystem.METRIC)
|
||||||
|
.retrieve()
|
||||||
|
.asHTML();
|
||||||
|
|
||||||
|
Assert.assertTrue(weatherHtml.startsWith("<"));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenGetSingleCurrentWeatherByCityIdRequestAsJava_thenReturnNotNull() {
|
public void whenGetSingleCurrentWeatherByCityIdRequestAsJava_thenReturnNotNull() {
|
||||||
final Weather weather = getClient()
|
final Weather weather = getClient()
|
||||||
@ -63,37 +243,115 @@ public class SingleResultCurrentWeatherIntegrationTest extends ApiTest {
|
|||||||
.asJava();
|
.asJava();
|
||||||
|
|
||||||
Assert.assertNotNull(weather);
|
Assert.assertNotNull(weather);
|
||||||
|
Assert.assertNotNull(weather.getState());
|
||||||
|
Assert.assertNotNull(weather.getDescription());
|
||||||
|
Assert.assertNotNull(weather.getRequestedOn());
|
||||||
|
Assert.assertNotNull(weather.getTemperature());
|
||||||
|
Assert.assertNotNull(weather.getLocation());
|
||||||
|
Assert.assertNotNull(weather.getAtmosphericPressure());
|
||||||
|
Assert.assertNotNull(weather.getHumidity());
|
||||||
|
Assert.assertNotNull(weather.getWind());
|
||||||
System.out.println(weather);
|
System.out.println(weather);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenGetSingleCurrentWeatherByCityNameRequestAsJava_thenReturnNotNull() {
|
public void whenGetSingleCurrentWeatherByCityIdRequestAsJSON_thenReturnNotNull() {
|
||||||
|
final String weatherJson = getClient()
|
||||||
|
.currentWeather()
|
||||||
|
.single()
|
||||||
|
.byCityId(350001514)
|
||||||
|
.language(Language.GERMAN)
|
||||||
|
.retrieve()
|
||||||
|
.asJSON();
|
||||||
|
|
||||||
|
Assert.assertTrue(weatherJson.startsWith("{"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenGetSingleCurrentWeatherByCityIdRequestAsXML_thenReturnNotNull() {
|
||||||
|
final String weatherXml = getClient()
|
||||||
|
.currentWeather()
|
||||||
|
.single()
|
||||||
|
.byCityId(350001514)
|
||||||
|
.language(Language.GERMAN)
|
||||||
|
.retrieve()
|
||||||
|
.asXML();
|
||||||
|
|
||||||
|
Assert.assertTrue(weatherXml.startsWith("<"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenGetSingleCurrentWeatherByCityIdRequestAsHTML_thenReturnNotNull() {
|
||||||
|
final String weatherHtml = getClient()
|
||||||
|
.currentWeather()
|
||||||
|
.single()
|
||||||
|
.byCityId(350001514)
|
||||||
|
.language(Language.GERMAN)
|
||||||
|
.retrieve()
|
||||||
|
.asXML();
|
||||||
|
|
||||||
|
Assert.assertTrue(weatherHtml.startsWith("<"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenGetSingleCurrentWeatherByCoordinateRequestAsJava_thenReturnNotNull() {
|
||||||
final Weather weather = getClient()
|
final Weather weather = getClient()
|
||||||
.currentWeather()
|
.currentWeather()
|
||||||
.single()
|
.single()
|
||||||
.byCityName("Minsk")
|
.byCoordinate(Coordinate.forValues(5, 5))
|
||||||
.language(Language.RUSSIAN)
|
|
||||||
.unitSystem(UnitSystem.METRIC)
|
.unitSystem(UnitSystem.METRIC)
|
||||||
.retrieve()
|
.retrieve()
|
||||||
.asJava();
|
.asJava();
|
||||||
|
|
||||||
Assert.assertNotNull(weather);
|
Assert.assertNotNull(weather);
|
||||||
|
Assert.assertNotNull(weather.getState());
|
||||||
|
Assert.assertNotNull(weather.getDescription());
|
||||||
|
Assert.assertNotNull(weather.getRequestedOn());
|
||||||
|
Assert.assertNotNull(weather.getTemperature());
|
||||||
|
Assert.assertNotNull(weather.getLocation());
|
||||||
|
Assert.assertNotNull(weather.getAtmosphericPressure());
|
||||||
|
Assert.assertNotNull(weather.getHumidity());
|
||||||
|
Assert.assertNotNull(weather.getWind());
|
||||||
System.out.println(weather);
|
System.out.println(weather);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenGetSingleCurrentWeatherByCityNameAndCountryCodeRequestAsJava_thenReturnNotNull() {
|
public void whenGetSingleCurrentWeatherByCoordinateRequestAsJSON_thenReturnNotNull() {
|
||||||
final Weather weather = getClient()
|
final String weatherJson = getClient()
|
||||||
.currentWeather()
|
.currentWeather()
|
||||||
.single()
|
.single()
|
||||||
.byCityName("Moscow", "ru")
|
.byCoordinate(Coordinate.forValues(5, 5))
|
||||||
.language(Language.RUSSIAN)
|
|
||||||
.unitSystem(UnitSystem.METRIC)
|
.unitSystem(UnitSystem.METRIC)
|
||||||
.retrieve()
|
.retrieve()
|
||||||
.asJava();
|
.asJSON();
|
||||||
|
|
||||||
Assert.assertNotNull(weather);
|
Assert.assertTrue(weatherJson.startsWith("{"));
|
||||||
System.out.println(weather);
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenGetSingleCurrentWeatherByCoordinateRequestAsXML_thenReturnNotNull() {
|
||||||
|
final String weatherXml = getClient()
|
||||||
|
.currentWeather()
|
||||||
|
.single()
|
||||||
|
.byCoordinate(Coordinate.forValues(5, 5))
|
||||||
|
.unitSystem(UnitSystem.METRIC)
|
||||||
|
.retrieve()
|
||||||
|
.asXML();
|
||||||
|
|
||||||
|
Assert.assertTrue(weatherXml.startsWith("<"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenGetSingleCurrentWeatherByCoordinateRequestAsHTML_thenReturnNotNull() {
|
||||||
|
final String weatherHtml = getClient()
|
||||||
|
.currentWeather()
|
||||||
|
.single()
|
||||||
|
.byCoordinate(Coordinate.forValues(5, 5))
|
||||||
|
.unitSystem(UnitSystem.METRIC)
|
||||||
|
.retrieve()
|
||||||
|
.asHTML();
|
||||||
|
|
||||||
|
Assert.assertTrue(weatherHtml.startsWith("<"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -102,73 +360,128 @@ public class SingleResultCurrentWeatherIntegrationTest extends ApiTest {
|
|||||||
.currentWeather()
|
.currentWeather()
|
||||||
.single()
|
.single()
|
||||||
.byZipCodeAndCountry("220015", "by")
|
.byZipCodeAndCountry("220015", "by")
|
||||||
.language(Language.RUSSIAN)
|
.language(Language.ENGLISH)
|
||||||
.unitSystem(UnitSystem.METRIC)
|
.unitSystem(UnitSystem.METRIC)
|
||||||
.retrieve()
|
.retrieve()
|
||||||
.asJava();
|
.asJava();
|
||||||
|
|
||||||
Assert.assertNotNull(weather);
|
Assert.assertNotNull(weather);
|
||||||
|
Assert.assertNotNull(weather.getState());
|
||||||
|
Assert.assertNotNull(weather.getDescription());
|
||||||
|
Assert.assertNotNull(weather.getRequestedOn());
|
||||||
|
Assert.assertNotNull(weather.getTemperature());
|
||||||
|
Assert.assertNotNull(weather.getLocation());
|
||||||
|
Assert.assertNotNull(weather.getAtmosphericPressure());
|
||||||
|
Assert.assertNotNull(weather.getHumidity());
|
||||||
|
Assert.assertNotNull(weather.getWind());
|
||||||
System.out.println(weather);
|
System.out.println(weather);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenGetAnySingleCurrentRequestWeatherAsJson_thenReturnNotNull() {
|
public void whenGetSingleCurrentWeatherByZipCodeAndCountryRequestAsJSON_thenReturnNotNull() {
|
||||||
final String weatherJson = getClient()
|
final String weatherJson = getClient()
|
||||||
.currentWeather()
|
.currentWeather()
|
||||||
.single()
|
.single()
|
||||||
.byZipCodeAndCountry("220015", "by")
|
.byZipCodeAndCountry("220015", "by")
|
||||||
.language(Language.RUSSIAN)
|
.language(Language.ENGLISH)
|
||||||
.unitSystem(UnitSystem.METRIC)
|
.unitSystem(UnitSystem.METRIC)
|
||||||
.retrieve()
|
.retrieve()
|
||||||
.asJSON();
|
.asJSON();
|
||||||
|
|
||||||
Assert.assertNotNull(weatherJson);
|
Assert.assertTrue(weatherJson.startsWith("{"));
|
||||||
System.out.println(weatherJson);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenGetAnySingleCurrentRequestWeatherAsXml_thenReturnNotNull() {
|
public void whenGetSingleCurrentWeatherByZipCodeAndCountryRequestAsXML_thenReturnNotNull() {
|
||||||
final String weatherXml = getClient()
|
final String weatherXml = getClient()
|
||||||
.currentWeather()
|
.currentWeather()
|
||||||
.single()
|
.single()
|
||||||
.byZipCodeAndCountry("220015", "by")
|
.byZipCodeAndCountry("220015", "by")
|
||||||
.language(Language.RUSSIAN)
|
.language(Language.ENGLISH)
|
||||||
.unitSystem(UnitSystem.METRIC)
|
.unitSystem(UnitSystem.METRIC)
|
||||||
.retrieve()
|
.retrieve()
|
||||||
.asXML();
|
.asXML();
|
||||||
|
|
||||||
Assert.assertNotNull(weatherXml);
|
Assert.assertTrue(weatherXml.startsWith("<"));
|
||||||
System.out.println(weatherXml);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenGetAnySingleCurrentWeatherRequestAsHtml_thenReturnNotNull() {
|
public void whenGetSingleCurrentWeatherByZipCodeAndCountryRequestAsHTML_thenReturnNotNull() {
|
||||||
final String weatherHtml = getClient()
|
final String weatherHtml = getClient()
|
||||||
.currentWeather()
|
.currentWeather()
|
||||||
.single()
|
.single()
|
||||||
.byZipCodeAndCountry("220015", "by")
|
.byZipCodeAndCountry("220015", "by")
|
||||||
.language(Language.RUSSIAN)
|
.language(Language.ENGLISH)
|
||||||
.unitSystem(UnitSystem.METRIC)
|
.unitSystem(UnitSystem.METRIC)
|
||||||
.retrieve()
|
.retrieve()
|
||||||
.asHTML();
|
.asHTML();
|
||||||
|
|
||||||
Assert.assertNotNull(weatherHtml);
|
Assert.assertTrue(weatherHtml.startsWith("<"));
|
||||||
System.out.println(weatherHtml);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenGetAnySingleCurrentWeatherAsyncRequestAsXml_thenReturnNotNull() throws ExecutionException, InterruptedException {
|
public void whenGetSingleCurrentWeatherByZipCodeInUSARequestAsJava_thenReturnNotNull() {
|
||||||
final CompletableFuture<String> weatherXmlFuture = getClient()
|
final Weather weather = getClient()
|
||||||
.currentWeather()
|
.currentWeather()
|
||||||
.single()
|
.single()
|
||||||
.byZipCodeAndCountry("220015", "by")
|
.byZipCodeInUSA("10006")
|
||||||
.language(Language.RUSSIAN)
|
.language(Language.ENGLISH)
|
||||||
.unitSystem(UnitSystem.METRIC)
|
.unitSystem(UnitSystem.METRIC)
|
||||||
.retrieveAsync()
|
.retrieve()
|
||||||
|
.asJava();
|
||||||
|
|
||||||
|
Assert.assertNotNull(weather);
|
||||||
|
Assert.assertNotNull(weather.getState());
|
||||||
|
Assert.assertNotNull(weather.getDescription());
|
||||||
|
Assert.assertNotNull(weather.getRequestedOn());
|
||||||
|
Assert.assertNotNull(weather.getTemperature());
|
||||||
|
Assert.assertNotNull(weather.getLocation());
|
||||||
|
Assert.assertNotNull(weather.getAtmosphericPressure());
|
||||||
|
Assert.assertNotNull(weather.getHumidity());
|
||||||
|
Assert.assertNotNull(weather.getWind());
|
||||||
|
System.out.println(weather);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenGetSingleCurrentWeatherByZipCodeInUSARequestAsJSON_thenReturnNotNull() {
|
||||||
|
final String weatherJson = getClient()
|
||||||
|
.currentWeather()
|
||||||
|
.single()
|
||||||
|
.byZipCodeInUSA("10006")
|
||||||
|
.language(Language.ENGLISH)
|
||||||
|
.unitSystem(UnitSystem.METRIC)
|
||||||
|
.retrieve()
|
||||||
|
.asJSON();
|
||||||
|
|
||||||
|
Assert.assertTrue(weatherJson.startsWith("{"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenGetSingleCurrentWeatherByZipCodeInUSARequestAsXML_thenReturnNotNull() {
|
||||||
|
final String weatherXml = getClient()
|
||||||
|
.currentWeather()
|
||||||
|
.single()
|
||||||
|
.byZipCodeInUSA("10006")
|
||||||
|
.language(Language.ENGLISH)
|
||||||
|
.unitSystem(UnitSystem.METRIC)
|
||||||
|
.retrieve()
|
||||||
.asXML();
|
.asXML();
|
||||||
|
|
||||||
Assert.assertNotNull(weatherXmlFuture);
|
Assert.assertTrue(weatherXml.startsWith("<"));
|
||||||
System.out.println(weatherXmlFuture.get());
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenGetSingleCurrentWeatherByZipCodeInUSARequestAsHTML_thenReturnNotNull() {
|
||||||
|
final String weatherHtml = getClient()
|
||||||
|
.currentWeather()
|
||||||
|
.single()
|
||||||
|
.byZipCodeInUSA("10006")
|
||||||
|
.language(Language.ENGLISH)
|
||||||
|
.unitSystem(UnitSystem.METRIC)
|
||||||
|
.retrieve()
|
||||||
|
.asHTML();
|
||||||
|
|
||||||
|
Assert.assertTrue(weatherHtml.startsWith("<"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -201,6 +514,21 @@ public class SingleResultCurrentWeatherIntegrationTest extends ApiTest {
|
|||||||
System.out.println(weatherFuture.get());
|
System.out.println(weatherFuture.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenGetAnySingleCurrentWeatherAsyncRequestAsXml_thenReturnNotNull() throws ExecutionException, InterruptedException {
|
||||||
|
final CompletableFuture<String> weatherXmlFuture = getClient()
|
||||||
|
.currentWeather()
|
||||||
|
.single()
|
||||||
|
.byZipCodeAndCountry("220015", "by")
|
||||||
|
.language(Language.RUSSIAN)
|
||||||
|
.unitSystem(UnitSystem.METRIC)
|
||||||
|
.retrieveAsync()
|
||||||
|
.asXML();
|
||||||
|
|
||||||
|
Assert.assertNotNull(weatherXmlFuture);
|
||||||
|
System.out.println(weatherXmlFuture.get());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenGetAnySingleCurrentWeatherAsyncRequestAsHtml_thenReturnNotNull() throws ExecutionException, InterruptedException {
|
public void whenGetAnySingleCurrentWeatherAsyncRequestAsHtml_thenReturnNotNull() throws ExecutionException, InterruptedException {
|
||||||
final CompletableFuture<String> weatherFuture = getClient()
|
final CompletableFuture<String> weatherFuture = getClient()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user