Skip to content

Commit

Permalink
[Test Proxy] Maps Weather migration (Azure#35984)
Browse files Browse the repository at this point in the history
* Added exports statements to POM required for local testing.

* Changed test classes to use TestProxyTestBase and refactored tests to include the user of a user agent, retry logic and better HTTP logging.

* Updated test recordings.

* Migrated recordings to assets repo.

* Applied PR feedback.
  • Loading branch information
vcolin7 authored Jul 20, 2023
1 parent 046f8b1 commit 123fb96
Show file tree
Hide file tree
Showing 219 changed files with 192 additions and 6,468 deletions.
6 changes: 6 additions & 0 deletions sdk/maps/azure-maps-weather/assets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "java",
"TagPrefix": "java/maps/azure-maps-weather",
"Tag": "java/maps/azure-maps-weather_dd2d34f333"
}
25 changes: 15 additions & 10 deletions sdk/maps/azure-maps-weather/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,21 @@
</developers>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<legal><![CDATA[[INFO] Any downloads listed may be third party software. Microsoft grants you no rights for third party software.]]></legal>
<src.dir>src/main</src.dir>
<test.dir>src/test</test.dir>
<jacoco.min.linecoverage>0.2</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0.2</jacoco.min.branchcoverage>
<jacoco.skip>false</jacoco.skip>
<codesnippet.skip>false</codesnippet.skip>
<javadocDoclet></javadocDoclet>
<javadocDocletOptions></javadocDocletOptions>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<legal><![CDATA[[INFO] Any downloads listed may be third party software. Microsoft grants you no rights for third party software.]]></legal>
<!-- Configures the Java 9+ run to perform the required module exports, opens, and reads that are necessary for testing but shouldn't be part of the module-info. -->
<javaModulesSurefireArgLine>
--add-exports com.azure.core/com.azure.core.implementation.http=ALL-UNNAMED
--add-exports com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED
</javaModulesSurefireArgLine>
<src.dir>src/main</src.dir>
<test.dir>src/test</test.dir>
<jacoco.min.linecoverage>0.2</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0.2</jacoco.min.branchcoverage>
<jacoco.skip>false</jacoco.skip>
<codesnippet.skip>false</codesnippet.skip>
<javadocDoclet></javadocDoclet>
<javadocDocletOptions></javadocDocletOptions>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import com.azure.maps.weather.models.WeatherAlongRouteResult;
import com.azure.maps.weather.models.WeatherDataUnit;

/** Initializes a new instance of the synchronous WeatherClient type.
/** Initializes a new instance of the synchronous WeatherClient type.
* {@link WeatherClient} instances are created via the {@link WeatherClientBuilder}, as shown below.
* Creating a sync client using a {@link AzureKeyCredential}:
* <!-- src_embed com.azure.maps.weather.sync.builder.key.instantiation -->
Expand All @@ -64,7 +64,7 @@ public final class WeatherClient {
/**
* Initializes an instance of Weathers client.
*
* @param serviceClient the service client implementation.
* @param asyncClient the service client implementation.
*/
@Generated
WeatherClient(WeatherAsyncClient asyncClient) {
Expand All @@ -73,7 +73,7 @@ public final class WeatherClient {

/**
* **Get Hourly Forecast**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_hourly_forecast -->
* <pre>
* client.getHourlyForecast&#40;new GeoPosition&#40;-122.138874, 47.632346&#41;, null, 12, null&#41;;
Expand Down Expand Up @@ -116,7 +116,7 @@ public HourlyForecastResult getHourlyForecast(GeoPosition position, WeatherDataU

/**
* **Get Hourly Forecast**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_hourly_forecast -->
* <pre>
* client.getHourlyForecast&#40;new GeoPosition&#40;-122.138874, 47.632346&#41;, null, 12, null&#41;;
Expand Down Expand Up @@ -160,7 +160,7 @@ public Response<HourlyForecastResult> getHourlyForecastWithResponse(GeoPosition

/**
* **Get Minute Forecast**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_minute_forecast -->
* <pre>
* client.getMinuteForecast&#40;new GeoPosition&#40;-122.138874, 47.632346&#41;, 15, null&#41;;
Expand Down Expand Up @@ -197,7 +197,7 @@ public MinuteForecastResult getMinuteForecast(GeoPosition position, Integer inte

/**
* **Get Minute Forecast**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_minute_forecast -->
* <pre>
* client.getMinuteForecast&#40;new GeoPosition&#40;-122.138874, 47.632346&#41;, 15, null&#41;;
Expand Down Expand Up @@ -236,7 +236,7 @@ public Response<MinuteForecastResult> getMinuteForecastWithResponse(GeoPosition

/**
* **Get Quarter-Day Forecast**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_quarter_day_forecast -->
* <pre>
* client.getQuarterDayForecast&#40;new GeoPosition&#40;-122.138874, 47.632346&#41;, null, 1, null&#41;;
Expand Down Expand Up @@ -275,7 +275,7 @@ public QuarterDayForecastResult getQuarterDayForecast(GeoPosition position, Weat

/**
* **Get Quarter-Day Forecast**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_quarter_day_forecast -->
* <pre>
* client.getQuarterDayForecast&#40;new GeoPosition&#40;-122.138874, 47.632346&#41;, null, 1, null&#41;;
Expand Down Expand Up @@ -315,7 +315,7 @@ public Response<QuarterDayForecastResult> getQuarterDayForecastWithResponse(GeoP

/**
* **Get Current Conditions**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_current_conditions -->
* <pre>
* client.getCurrentConditions&#40;new GeoPosition&#40;-122.125679, 47.641268&#41;,
Expand Down Expand Up @@ -361,7 +361,7 @@ public CurrentConditionsResult getCurrentConditions(GeoPosition position, Weathe

/**
* **Get Current Conditions**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_current_conditions -->
* <pre>
* client.getCurrentConditions&#40;new GeoPosition&#40;-122.125679, 47.641268&#41;,
Expand Down Expand Up @@ -408,7 +408,7 @@ public Response<CurrentConditionsResult> getCurrentConditionsWithResponse(GeoPos

/**
* **Get Daily Forecast**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_daily_forecast -->
* <pre>
* client.getDailyForecast&#40;new GeoPosition&#40;30.0734812, 62.6490341&#41;, null, 5, null&#41;;
Expand Down Expand Up @@ -449,7 +449,7 @@ public DailyForecastResult getDailyForecast(GeoPosition position, WeatherDataUni

/**
* **Get Daily Forecast**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_daily_forecast -->
* <pre>
* client.getDailyForecast&#40;new GeoPosition&#40;30.0734812, 62.6490341&#41;, null, 5, null&#41;;
Expand Down Expand Up @@ -492,7 +492,7 @@ public Response<DailyForecastResult> getDailyForecastWithResponse(GeoPosition po

/**
* **Get Weather along route**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_weather_along_route -->
* <pre>
* List&lt;Waypoint&gt; waypoints = Arrays.asList&#40;
Expand Down Expand Up @@ -564,7 +564,7 @@ public WeatherAlongRouteResult getWeatherAlongRoute(List<Waypoint> waypoints, St

/**
* **Get Weather along route**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_weather_along_route -->
* <pre>
* List&lt;Waypoint&gt; waypoints = Arrays.asList&#40;
Expand Down Expand Up @@ -638,7 +638,7 @@ public Response<WeatherAlongRouteResult> getWeatherAlongRouteWithResponse(List<W

/**
* **Get Severe Weather Alerts**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_severe_weather_alerts -->
* <pre>
* client.getSevereWeatherAlerts&#40;new GeoPosition&#40;-85.06431274043842, 30.324604968788467&#41;, null, true&#41;;
Expand Down Expand Up @@ -679,7 +679,7 @@ public SevereWeatherAlertsResult getSevereWeatherAlerts(GeoPosition position, St

/**
* **Get Severe Weather Alerts**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_severe_weather_alerts -->
* <pre>
* client.getSevereWeatherAlerts&#40;new GeoPosition&#40;-85.06431274043842, 30.324604968788467&#41;, null, true&#41;;
Expand Down Expand Up @@ -722,7 +722,7 @@ public Response<SevereWeatherAlertsResult> getSevereWeatherAlertsWithResponse(Ge

/**
* **Get Daily Indices**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_daily_indices -->
* <pre>
* client.getDailyIndices&#40;new GeoPosition&#40;-79.37849, 43.84745&#41;, null, null, null, 11&#41;;
Expand Down Expand Up @@ -772,7 +772,7 @@ public DailyIndicesResult getDailyIndices(GeoPosition position, String language,

/**
* **Get Daily Indices**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_daily_indices -->
* <pre>
* client.getDailyIndices&#40;new GeoPosition&#40;-79.37849, 43.84745&#41;, null, null, null, 11&#41;;
Expand Down Expand Up @@ -824,7 +824,7 @@ public Response<DailyIndicesResult> getDailyIndicesWithResponse(GeoPosition posi

/**
* **Get Tropical Storm Active**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_tropical_storm_active -->
* <pre>
* client.getTropicalStormActive&#40;&#41;;
Expand All @@ -849,7 +849,7 @@ public ActiveStormResult getTropicalStormActive() {

/**
* **Get Tropical Storm Active**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_tropical_storm_active -->
* <pre>
* client.getTropicalStormActive&#40;&#41;;
Expand All @@ -875,7 +875,7 @@ public Response<ActiveStormResult> getTropicalStormActiveWithResponse(Context co

/**
* **Get Tropical Storm Search**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_tropical_storm_search -->
* <pre>
* ActiveStormResult result = client.getTropicalStormActive&#40;&#41;;
Expand Down Expand Up @@ -917,7 +917,7 @@ public StormSearchResult searchTropicalStorm(Integer year, BasinId basinId, Inte
* &#125;
* </pre>
* <!-- end com.azure.maps.weather.sync.get_tropical_storm_search -->
*
*
* <p>**Applies to**: see pricing [tiers](https://aka.ms/AzureMapsPricingTier).
*
* <p>Search government-issued tropical storms by year, basin ID, and government ID. Information about the tropical
Expand All @@ -941,7 +941,7 @@ public Response<StormSearchResult> searchTropicalStormWithResponse(Integer year,

/**
* **Get Tropical Storm Forecasts**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_tropical_storm_forecast -->
* <pre>
* ActiveStormResult result = client.getTropicalStormActive&#40;&#41;;
Expand Down Expand Up @@ -974,7 +974,7 @@ public StormForecastResult getTropicalStormForecast(TropicalStormForecastOptions

/**
* **Get Tropical Storm Forecasts**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_tropical_storm_forecast -->
* <pre>
* ActiveStormResult result = client.getTropicalStormActive&#40;&#41;;
Expand Down Expand Up @@ -1009,7 +1009,7 @@ public Response<StormForecastResult> getTropicalStormForecastWithResponse(Tropic

/**
* **Get Tropical Storm Locations**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_tropical_storm_locations -->
* <pre>
* ActiveStormResult result = client.getTropicalStormActive&#40;&#41;;
Expand Down Expand Up @@ -1041,7 +1041,7 @@ public StormLocationsResult getTropicalStormLocations(TropicalStormLocationOptio

/**
* **Get Tropical Storm Locations**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_tropical_storm_locations -->
* <pre>
* ActiveStormResult result = client.getTropicalStormActive&#40;&#41;;
Expand Down Expand Up @@ -1075,7 +1075,7 @@ public Response<StormLocationsResult> getTropicalStormLocationsWithResponse(Trop

/**
* **Get Current Air Quality**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_current_air_quality -->
* <pre>
* client.getCurrentAirQuality&#40;
Expand Down Expand Up @@ -1111,7 +1111,7 @@ public AirQualityResult getCurrentAirQuality(GeoPosition position, String langua

/**
* **Get Current Air Quality**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_current_air_quality -->
* <pre>
* client.getCurrentAirQuality&#40;
Expand Down Expand Up @@ -1150,7 +1150,7 @@ public Response<AirQualityResult> getCurrentAirQualityWithResponse(GeoPosition p

/**
* **Get Air Quality Daily Forecasts**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_air_quality_daily_forecasts -->
* <pre>
* client.getAirQualityDailyForecasts&#40;
Expand Down Expand Up @@ -1188,7 +1188,7 @@ public DailyAirQualityForecastResult getAirQualityDailyForecasts(GeoPosition pos

/**
* **Get Air Quality Daily Forecasts**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_air_quality_daily_forecasts -->
* <pre>
* client.getAirQualityDailyForecasts&#40;
Expand Down Expand Up @@ -1227,7 +1227,7 @@ public Response<DailyAirQualityForecastResult> getAirQualityDailyForecastsWithRe

/**
* **Get Air Quality Hourly Forecasts**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_air_quality_hourly_forecasts -->
* <pre>
* client.getAirQualityHourlyForecasts&#40;
Expand Down Expand Up @@ -1267,7 +1267,7 @@ public AirQualityResult getAirQualityHourlyForecasts(GeoPosition position, Strin

/**
* **Get Air Quality Hourly Forecasts**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_air_quality_hourly_forecasts -->
* <pre>
* client.getAirQualityHourlyForecasts&#40;
Expand Down Expand Up @@ -1309,7 +1309,7 @@ public Response<AirQualityResult> getAirQualityHourlyForecastsWithResponse(GeoPo

/**
* **Get Daily Historical Actuals**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_daily_historical_actuals -->
* <pre>
* LocalDate before = LocalDate.now&#40;&#41;.minusDays&#40;30&#41;;
Expand Down Expand Up @@ -1348,7 +1348,7 @@ public DailyHistoricalActualsResult getDailyHistoricalActuals(GeoPosition positi

/**
* **Get Daily Historical Actuals**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_daily_historical_actuals -->
* <pre>
* LocalDate before = LocalDate.now&#40;&#41;.minusDays&#40;30&#41;;
Expand All @@ -1363,7 +1363,7 @@ public DailyHistoricalActualsResult getDailyHistoricalActuals(GeoPosition positi
* precipitation, snowfall, snow depth and cooling/heating degree day information, for the day at a given coordinate
* location. The data is requested for a specified date range, up to 31 days in a single API request. Generally,
* historical data may be available as far back as the last 5 to 40+ years, depending on the location.
*
*
* @param position The applicable query specified as a comma separated string composed by longitude followed by
* latitude e.g. "-122.125679,47.641268".
* @param startDate Start date in ISO 8601 format, for example, 2019-10-27. The date range supported is 1 to 31
Expand All @@ -1388,7 +1388,7 @@ public Response<DailyHistoricalActualsResult> getDailyHistoricalActualsWithRespo

/**
* **Get Daily Historical Records**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_daily_historical_records -->
* <pre>
* LocalDate before = LocalDate.now&#40;&#41;.minusDays&#40;30&#41;;
Expand Down Expand Up @@ -1426,7 +1426,7 @@ public DailyHistoricalRecordsResult getDailyHistoricalRecords(GeoPosition positi

/**
* **Get Daily Historical Records**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_daily_historical_records -->
* <pre>
* LocalDate before = LocalDate.now&#40;&#41;.minusDays&#40;30&#41;;
Expand Down Expand Up @@ -1466,7 +1466,7 @@ public Response<DailyHistoricalRecordsResult> getDailyHistoricalRecordsWithRespo

/**
* **Get Daily Historical Normals**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_daily_historical_normals -->
* <pre>
* LocalDate before = LocalDate.now&#40;&#41;.minusDays&#40;30&#41;;
Expand Down Expand Up @@ -1507,7 +1507,7 @@ public DailyHistoricalNormalsResult getDailyHistoricalNormals(GeoPosition positi

/**
* **Get Daily Historical Normals**
*
*
* <!-- src_embed com.azure.maps.weather.sync.get_daily_historical_normals -->
* <pre>
* LocalDate before = LocalDate.now&#40;&#41;.minusDays&#40;30&#41;;
Expand Down
Loading

0 comments on commit 123fb96

Please sign in to comment.