Skip to content

Commit ae519e1

Browse files
committed
add assertions
1 parent fa4bd82 commit ae519e1

23 files changed

+97
-45
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
import com.amadeus.exceptions.ResponseException;
1414
import com.amadeus.resources.Destination;
1515
import com.github.tomakehurst.wiremock.WireMockServer;
16+
17+
import static org.junit.jupiter.api.Assertions.assertEquals;
18+
import static org.junit.jupiter.api.Assertions.assertNotEquals;
19+
1620
import org.junit.jupiter.api.AfterEach;
1721
import org.junit.jupiter.api.BeforeEach;
1822
import org.junit.jupiter.api.Test;
@@ -71,7 +75,7 @@ public void given_client_when_call_airline_destinations_with_mandatory_params_th
7175
);
7276

7377
//Then
74-
then(result.length).isNotEqualTo(0);
78+
assertNotEquals(0, result.length);
7579
}
7680

7781
@Test
@@ -94,7 +98,7 @@ public void given_client_when_call_airline_destinations_with_optional_params_the
9498
);
9599

96100
//Then
97-
then(result.length).isEqualTo(2);
101+
assertEquals(2, result.length);
98102
}
99103

100104
//TODO Review with the team to upgrade the behaviour.

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import static com.github.tomakehurst.wiremock.client.WireMock.post;
55
import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
66
import static org.assertj.core.api.BDDAssertions.then;
7+
import static org.junit.jupiter.api.Assertions.assertNotNull;
78

89
import com.amadeus.Amadeus;
910
import com.amadeus.exceptions.ResponseException;
@@ -100,7 +101,7 @@ public void given_client_when_call_flight_offers_with_params_then_ok()
100101
FlightOrder result = amadeus.booking.flightOrders.post(flightPricing, travelerArray);
101102

102103
//Then
103-
then(result).isNotNull();
104+
assertNotNull(result);
104105
}
105106

106107
private Traveler[] getTravelerData() {
@@ -161,7 +162,7 @@ public void given_client_when_call_flight_offers_with_params_alternative_2_then_
161162
FlightOrder result = amadeus.booking.flightOrders.post(flightOffersSearches, travellers);
162163

163164
//Then
164-
then(result).isNotNull();
165+
assertNotNull(result);
165166
}
166167

167168
@Test
@@ -191,7 +192,7 @@ public void given_client_when_call_flight_offers_with_params_alternative_3_then_
191192
FlightOrder result = amadeus.booking.flightOrders.post(flightOffersSearches[0], travellers);
192193

193194
//Then
194-
then(result).isNotNull();
195+
assertNotNull(result);
195196
}
196197

197198
@Test
@@ -211,7 +212,7 @@ public void given_client_when_call_flight_offers_with_params_alternative_4_then_
211212
FlightOrder result = amadeus.booking.flightOrders.post(request);
212213

213214
//Then
214-
then(result).isNotNull();
215+
assertNotNull(result);
215216
}
216217

217218
private JsonObject getRequestFromResources(String jsonFile) throws IOException {

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
import com.amadeus.exceptions.ResponseException;
1414
import com.amadeus.resources.DiseaseReport;
1515
import com.github.tomakehurst.wiremock.WireMockServer;
16+
17+
import static org.junit.jupiter.api.Assertions.assertNotNull;
18+
1619
import org.junit.jupiter.api.AfterEach;
1720
import org.junit.jupiter.api.BeforeEach;
1821
import org.junit.jupiter.api.Test;
@@ -71,7 +74,7 @@ public void given_client_when_call_travel_restrictions_v2_with_params_then_ok()
7174
);
7275

7376
//Then
74-
then(result).isNotNull();
77+
assertNotNull(result);
7578
}
7679

7780
//TODO Review with the team to upgrade the behaviour.

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
import com.amadeus.exceptions.ResponseException;
1414
import com.amadeus.resources.City;
1515
import com.github.tomakehurst.wiremock.WireMockServer;
16+
17+
import static org.junit.jupiter.api.Assertions.assertNotEquals;
18+
1619
import org.junit.jupiter.api.AfterEach;
1720
import org.junit.jupiter.api.BeforeEach;
1821
import org.junit.jupiter.api.Test;
@@ -70,7 +73,7 @@ public void given_client_when_call_city_search_with_params_then_ok()
7073
City[] result = amadeus.referenceData.locations.cities.get(params);
7174

7275
//Then
73-
then(result.length).isNotEqualTo(0);
76+
assertNotEquals(0, result.length);
7477
}
7578

7679
@Test

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
import com.amadeus.resources.Hotel;
1313

1414
import com.github.tomakehurst.wiremock.WireMockServer;
15+
16+
import static org.junit.jupiter.api.Assertions.assertEquals;
17+
import static org.junit.jupiter.api.Assertions.assertNotNull;
18+
import static org.junit.jupiter.api.Assertions.assertTrue;
19+
1520
import org.junit.jupiter.api.AfterEach;
1621
import org.junit.jupiter.api.BeforeEach;
1722
import org.junit.jupiter.api.Disabled;
@@ -73,8 +78,8 @@ public void given_client_when_call_hotel_with_mandatory_parameters_then_returns_
7378
Hotel[] result = amadeus.referenceData.locations.hotel.get(params);
7479

7580
//Then
76-
then(result).isNotNull();
77-
then(result.length).isGreaterThan(1);
81+
assertNotNull(result);
82+
assertTrue(result.length > 1);
7883
}
7984

8085
@Test
@@ -98,8 +103,8 @@ public void given_client_when_call_hotel_then_returns_single_hotel_response_ok()
98103
Hotel[] result = amadeus.referenceData.locations.hotel.get(params);
99104

100105
//Then
101-
then(result).isNotNull();
102-
then(result.length).isEqualTo(1);
106+
assertNotNull(result);
107+
assertEquals(1, result.length);
103108
}
104109

105110
@Test
@@ -123,8 +128,8 @@ public void given_client_when_call_hotel_then_returns_multiple_hotel_response_ok
123128
Hotel[] result = amadeus.referenceData.locations.hotel.get(params);
124129

125130
//Then
126-
then(result).isNotNull();
127-
then(result.length).isEqualTo(5);
131+
assertNotNull(result);
132+
assertEquals(5, result.length);
128133
}
129134

130135
@Test
@@ -150,7 +155,6 @@ public void given_client_when_call_hotel_with_all_parameters_then_response_ok()
150155
Hotel[] result = amadeus.referenceData.locations.hotel.get(params);
151156

152157
//Then
153-
then(result).isNotNull();
154-
then(result.length).isGreaterThan(1);
158+
assertTrue(result.length > 1);
155159
}
156160
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
import com.amadeus.exceptions.ResponseException;
1111
import com.amadeus.resources.PointOfInterest;
1212
import com.github.tomakehurst.wiremock.WireMockServer;
13+
14+
import static org.junit.jupiter.api.Assertions.assertNotNull;
15+
1316
import org.junit.jupiter.api.AfterEach;
1417
import org.junit.jupiter.api.BeforeEach;
1518
import org.junit.jupiter.api.Test;
@@ -67,7 +70,7 @@ public void given_client_when_call_point_of_interest_by_id_then_ok()
6770
PointOfInterest result = amadeus.referenceData.locations.pointOfInterest(id).get();
6871

6972
//Then
70-
then(result).isNotNull();
73+
assertNotNull(result);
7174
}
7275

7376
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
import com.amadeus.exceptions.ResponseException;
1414
import com.amadeus.resources.Hotel;
1515
import com.github.tomakehurst.wiremock.WireMockServer;
16+
17+
import static org.junit.jupiter.api.Assertions.assertNotEquals;
18+
1619
import org.junit.jupiter.api.AfterEach;
1720
import org.junit.jupiter.api.BeforeEach;
1821
import org.junit.jupiter.api.Test;
@@ -71,7 +74,7 @@ public void given_client_when_call_hotels_by_city_with_params_then_ok()
7174
Hotel[] result = amadeus.referenceData.locations.hotels.byCity.get(params);
7275

7376
//Then
74-
then(result.length).isNotEqualTo(0);
77+
assertNotEquals(0, result.length);
7578
}
7679

7780
//TODO Review with the team to upgrade the behaviour.

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
import com.amadeus.exceptions.ResponseException;
1414
import com.amadeus.resources.Hotel;
1515
import com.github.tomakehurst.wiremock.WireMockServer;
16+
17+
import static org.junit.jupiter.api.Assertions.assertNotEquals;
18+
1619
import org.junit.jupiter.api.AfterEach;
1720
import org.junit.jupiter.api.BeforeEach;
1821
import org.junit.jupiter.api.Test;
@@ -77,7 +80,7 @@ public void given_client_when_call_hotels_by_geocode_with_params_then_ok()
7780
.hotels.byGeocode.get(params);
7881

7982
//Then
80-
then(result.length).isNotEqualTo(0);
83+
assertNotEquals(0, result.length);
8184
}
8285

8386
//TODO Review with the team to upgrade the behaviour.

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
import com.amadeus.exceptions.ResponseException;
1414
import com.amadeus.resources.Hotel;
1515
import com.github.tomakehurst.wiremock.WireMockServer;
16+
17+
import static org.junit.jupiter.api.Assertions.assertNotEquals;
18+
1619
import org.junit.jupiter.api.AfterEach;
1720
import org.junit.jupiter.api.BeforeEach;
1821
import org.junit.jupiter.api.Test;
@@ -73,7 +76,7 @@ public void given_client_when_call_hotels_by_hotels_with_params_then_ok()
7376
.hotels.byHotels.get(params);
7477

7578
//Then
76-
then(result.length).isNotEqualTo(0);
79+
assertNotEquals(0, result.length);
7780
}
7881

7982
//TODO Review with the team to upgrade the behaviour.

src/test/java/com/amadeus/referenceData/locations/pointsOfInterest/BySquareIT.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
import com.amadeus.exceptions.ResponseException;
1414
import com.amadeus.resources.PointOfInterest;
1515
import com.github.tomakehurst.wiremock.WireMockServer;
16+
17+
import static org.junit.jupiter.api.Assertions.assertNotEquals;
18+
1619
import org.junit.jupiter.api.AfterEach;
1720
import org.junit.jupiter.api.BeforeEach;
1821
import org.junit.jupiter.api.Test;
@@ -77,7 +80,7 @@ public void given_client_when_call_points_of_interest_by_square_with_params_then
7780
.pointsOfInterest.bySquare.get(params);
7881

7982
//Then
80-
then(result.length).isNotEqualTo(0);
83+
assertNotEquals(0, result.length);
8184
}
8285

8386
//TODO Review with the team to upgrade the behaviour.

0 commit comments

Comments
 (0)