Skip to content

Commit 1b6cf57

Browse files
committed
add tests
1 parent 76975cb commit 1b6cf57

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/test/java/com/amadeus/NamespaceTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public void testAllNamespacesExist() {
5050
TestCase.assertNotNull(client.referenceData.locations.airports);
5151
TestCase.assertNotNull(client.referenceData.locations.pointsOfInterest);
5252
TestCase.assertNotNull(client.referenceData.locations.pointsOfInterest.bySquare);
53+
TestCase.assertNotNull(client.referenceData.locations.pointOfInterest("XXX"));
5354
TestCase.assertNotNull(client.referenceData.location("123"));
5455
TestCase.assertNotNull(client.referenceData.airlines);
5556
TestCase.assertNotNull(client.travel.analytics.airTraffic.traveled);
@@ -147,6 +148,16 @@ public void testGetMethods() throws ResponseException {
147148
TestCase.assertNotNull(poisSquare.get(params));
148149
TestCase.assertEquals(poisSquare.get().length, 2);
149150

151+
// Testing retrieving point of interest
152+
Mockito.when(client.get("/v1/reference-data/locations/pois/XXX", null))
153+
.thenReturn(multiResponse);
154+
Mockito.when(client.get("/v1/reference-data/locations/pois/XXX", params))
155+
.thenReturn(multiResponse);
156+
PointsOfInterest poi = new PointsOfInterest(client);
157+
TestCase.assertNotNull(poi.get());
158+
TestCase.assertNotNull(poi.get(params));
159+
TestCase.assertEquals(poi.get().length, 2);
160+
150161
// Testing fetching a single location
151162
Mockito.when(client.get("/v1/reference-data/locations/ALHR", null))
152163
.thenReturn(singleResponse);

0 commit comments

Comments
 (0)