Skip to content

Commit 1c3f16d

Browse files
authored
Merge pull request #236 from amadeus4dev/update-integration-test-names
Update method names to camelcase
2 parents 2420946 + 66f8e1c commit 1c3f16d

24 files changed

+97
-172
lines changed

src/test/java/com/amadeus/HTTPClientThreadSafeIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public void run() {
118118
* @throws InterruptedException A possible error with the Executor
119119
*/
120120
@Test
121-
public void given_client_when_call_in_parallel_multiple_times_then_thread_safety()
121+
public void givenClienWhenCallInParallelMultipleTimesThenThreadSafety()
122122
throws InterruptedException {
123123

124124
//Given
@@ -165,7 +165,7 @@ public void given_client_when_call_in_parallel_multiple_times_then_thread_safety
165165
* @throws InterruptedException A possible error with CompletableFuture
166166
*/
167167
@Test
168-
public void given_client_when_call_in_parallel_multiple_times_then_thread_safety2()
168+
public void givenClientWhenCallInParallelMultipleTimesThenThreadSafety2()
169169
throws InterruptedException {
170170

171171
//Given

src/test/java/com/amadeus/airline/DestinationsIT.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void teardown() {
5454
}
5555

5656
@Test
57-
public void given_client_when_call_airline_destinations_with_mandatory_params_then_ok()
57+
public void givenClientWhenCallAirlineDestinationsWithMandatoryParamsThenOk()
5858
throws ResponseException {
5959

6060
//Given
@@ -75,7 +75,7 @@ public void given_client_when_call_airline_destinations_with_mandatory_params_th
7575
}
7676

7777
@Test
78-
public void given_client_when_call_airline_destinations_with_optional_params_then_ok()
78+
public void givenClientWhenCallAirlineDestinationsWithOptionalParamsThenOK()
7979
throws ResponseException {
8080

8181
//Given
@@ -99,7 +99,7 @@ public void given_client_when_call_airline_destinations_with_optional_params_the
9999

100100
//TODO Review with the team to upgrade the behaviour.
101101
@Test
102-
public void given_client_when_call_airline_destinations_without_params_then_ok() {
102+
public void givenClientWhenCallAirlineDestinationsWithoutParamsThenOK() {
103103

104104
//Given
105105
String address = "/v1/airline/destinations";

src/test/java/com/amadeus/booking/FlightOrdersIT.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public void teardown() {
6464
}
6565

6666
@Test
67-
public void given_client_when_call_flight_offers_with_params_then_ok()
67+
public void givenClientWhenCallFlightOffersWithParamsThenOK()
6868
throws ResponseException, IOException {
6969

7070
//Given
@@ -135,7 +135,7 @@ private Traveler[] getTravelerData() {
135135
}
136136

137137
@Test
138-
public void given_client_when_call_flight_offers_with_params_alternative_2_then_ok()
138+
public void givenClientWhenCallFlightOffersWithParamsAlternative2ThenOK()
139139
throws ResponseException, IOException {
140140

141141
//Given
@@ -165,7 +165,7 @@ public void given_client_when_call_flight_offers_with_params_alternative_2_then_
165165
}
166166

167167
@Test
168-
public void given_client_when_call_flight_offers_with_params_alternative_3_then_ok()
168+
public void givenClientWhenCallFlightOffersWithParamsAlternative3ThenOK()
169169
throws ResponseException, IOException {
170170

171171
//Given
@@ -195,7 +195,7 @@ public void given_client_when_call_flight_offers_with_params_alternative_3_then_
195195
}
196196

197197
@Test
198-
public void given_client_when_call_flight_offers_with_params_alternative_4_then_ok()
198+
public void givenClientWhenCallFlightOffersWithParamsAlternative4ThenOK()
199199
throws ResponseException, IOException {
200200

201201
//Given

src/test/java/com/amadeus/dutyOfCare/diseases/Covid19ReportIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void teardown() {
5454
}
5555

5656
@Test
57-
public void given_client_when_call_travel_restrictions_v2_with_params_then_ok()
57+
public void givenClientWhenCallTravelRestrictionsV2WithParamsThenOK()
5858
throws ResponseException {
5959

6060
//Given
@@ -76,7 +76,7 @@ public void given_client_when_call_travel_restrictions_v2_with_params_then_ok()
7676

7777
//TODO Review with the team to upgrade the behaviour.
7878
@Test
79-
public void given_client_when_call_travel_restrictions_v2_without_params_then_ok() {
79+
public void givenClientWhenCallTravelRestrictionsV2WithoutParamsThenOK() {
8080

8181
//Given
8282
String address = "/v2/duty-of-care/diseases/covid19-area-report";

src/test/java/com/amadeus/referenceData/locations/CitiesIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void teardown() {
5454
}
5555

5656
@Test
57-
public void given_client_when_call_city_search_with_params_then_ok()
57+
public void givenClientWhenCallCitySearchWithParamsThenOK()
5858
throws ResponseException {
5959

6060
//Given
@@ -74,7 +74,7 @@ public void given_client_when_call_city_search_with_params_then_ok()
7474
}
7575

7676
@Test
77-
public void given_client_when_call_city_search_without_params_then_ok()
77+
public void givenClientWhenCallCitySearchWithoutParamsThenOK()
7878
throws ResponseException {
7979

8080
//Given

src/test/java/com/amadeus/referenceData/locations/HotelIT.java

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@
1010
import com.amadeus.Params;
1111
import com.amadeus.exceptions.ResponseException;
1212
import com.amadeus.resources.Hotel;
13-
13+
import com.amadeus.resources.HotelOfferSearch;
1414
import com.github.tomakehurst.wiremock.WireMockServer;
15+
import java.io.IOException;
16+
import java.net.URLEncoder;
17+
import java.util.ArrayList;
18+
import java.util.List;
1519
import org.junit.jupiter.api.AfterEach;
1620
import org.junit.jupiter.api.BeforeEach;
17-
import org.junit.jupiter.api.Disabled;
1821
import org.junit.jupiter.api.Test;
1922

2023
public class HotelIT {
@@ -54,7 +57,7 @@ public void teardown() {
5457
}
5558

5659
@Test
57-
public void given_client_when_call_hotel_with_mandatory_parameters_then_returns_ok()
60+
public void givenClientWhenCallHotelWithMandatoryParametersThenReturnsOK()
5861
throws ResponseException {
5962

6063
//Given
@@ -78,7 +81,7 @@ public void given_client_when_call_hotel_with_mandatory_parameters_then_returns_
7881
}
7982

8083
@Test
81-
public void given_client_when_call_hotel_then_returns_single_hotel_response_ok()
84+
public void givenClientWhenCallHotelThenReturnsSingleHotelResponseOK()
8285
throws ResponseException {
8386

8487
//Given
@@ -103,7 +106,7 @@ public void given_client_when_call_hotel_then_returns_single_hotel_response_ok()
103106
}
104107

105108
@Test
106-
public void given_client_when_call_hotel_then_returns_multiple_hotel_response_ok()
109+
public void givenClientWhenCallHotelThenReturnsMultipleHotelResponseOK()
107110
throws ResponseException {
108111

109112
//Given
@@ -128,7 +131,7 @@ public void given_client_when_call_hotel_then_returns_multiple_hotel_response_ok
128131
}
129132

130133
@Test
131-
public void given_client_when_call_hotel_with_all_parameters_then_response_ok()
134+
public void givenClientWhenCallHotelWithAllParametersThenResponseOK()
132135
throws ResponseException {
133136

134137
//Given
@@ -153,4 +156,43 @@ public void given_client_when_call_hotel_with_all_parameters_then_response_ok()
153156
then(result).isNotNull();
154157
then(result.length).isGreaterThan(1);
155158
}
159+
160+
@Test
161+
public void givenClientWhenCallHotelOffersSearchWithParamsThenOK()
162+
throws ResponseException, IOException {
163+
164+
//Given
165+
String input = URLEncoder.encode("MCLONGHM,WIMAD079", "UTF-8");
166+
String address = "/v3/shopping/hotel-offers"
167+
+ "?hotelIds=" + input
168+
+ "&roomQuantity=1"
169+
+ "&adults=1"
170+
+ "&checkInDate=2022-11-22"
171+
+ "&paymentPolicy=NONE"
172+
+ "&bestRateOnly=true";
173+
wireMockServer.stubFor(get(urlEqualTo(address))
174+
.willReturn(aResponse().withHeader("Content-Type", "application/json")
175+
.withStatus(200)
176+
.withBodyFile("hotel_offers_search_response_ok.json")));
177+
178+
// ***** HERE *****
179+
List<String> ids = new ArrayList<String>();
180+
ids.add("MCLONGHM");
181+
ids.add("WIMAD079");
182+
String idsToStr1 = String.join(",", ids);
183+
// String idsToStr2 = ids.stream().map(String::valueOf).collect(Collectors.joining(","));
184+
185+
//When
186+
HotelOfferSearch[] result = amadeus.shopping.hotelOffersSearch.get(
187+
Params.with("hotelIds", idsToStr1) // ***** HERE *****
188+
.and("adults", 1)
189+
.and("checkInDate", "2022-11-22")
190+
.and("roomQuantity", 1)
191+
.and("paymentPolicy", "NONE")
192+
.and("bestRateOnly", true)
193+
);
194+
195+
//Then
196+
then(result.length).isNotEqualTo(0);
197+
}
156198
}

src/test/java/com/amadeus/referenceData/locations/PointOfInterestIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void teardown() {
5151
}
5252

5353
@Test
54-
public void given_client_when_call_point_of_interest_by_id_then_ok()
54+
public void givenClientWhenCallPointOfInterestByIdThenOK()
5555
throws ResponseException {
5656

5757
//Given

src/test/java/com/amadeus/referenceData/locations/hotels/ByCityIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void teardown() {
5454
}
5555

5656
@Test
57-
public void given_client_when_call_hotels_by_city_with_params_then_ok()
57+
public void givenClientWhenCallHotelsByCityWithParamsThenOK()
5858
throws ResponseException {
5959

6060
//Given
@@ -76,7 +76,7 @@ public void given_client_when_call_hotels_by_city_with_params_then_ok()
7676

7777
//TODO Review with the team to upgrade the behaviour.
7878
@Test
79-
public void given_client_when_call_hotels_by_city_without_params_then_ok()
79+
public void givenClientWhenCallHotelsByCityWithoutParamsThenOK()
8080
throws ResponseException {
8181

8282
//Given

src/test/java/com/amadeus/referenceData/locations/hotels/ByGeocodeIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void teardown() {
5454
}
5555

5656
@Test
57-
public void given_client_when_call_hotels_by_geocode_with_params_then_ok()
57+
public void givenClientWhenCallHotelsByGeocodeWithParamsThenOK()
5858
throws ResponseException {
5959

6060
//Given
@@ -82,7 +82,7 @@ public void given_client_when_call_hotels_by_geocode_with_params_then_ok()
8282

8383
//TODO Review with the team to upgrade the behaviour.
8484
@Test
85-
public void given_client_when_call_hotels_by_geocode_without_params_then_ok()
85+
public void givenClientWhenCallHotelsByGeocodeWithoutParamsThenOK()
8686
throws ResponseException {
8787

8888
//Given

src/test/java/com/amadeus/referenceData/locations/hotels/ByHotelsIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void teardown() {
5454
}
5555

5656
@Test
57-
public void given_client_when_call_hotels_by_hotels_with_params_then_ok()
57+
public void givenClientWhenCallHotelsByHotelsWithParamsThenOK()
5858
throws ResponseException {
5959

6060
//Given
@@ -78,7 +78,7 @@ public void given_client_when_call_hotels_by_hotels_with_params_then_ok()
7878

7979
//TODO Review with the team to upgrade the behaviour.
8080
@Test
81-
public void given_client_when_call_hotels_by_hotels_without_params_then_ok()
81+
public void givenClientWhenCallHotelsByHotelsWithoutParamsThenOK()
8282
throws ResponseException {
8383

8484
//Given

0 commit comments

Comments
 (0)