From efd8db44f10758257ceb3e883dca9c8660af83e2 Mon Sep 17 00:00:00 2001 From: Anna Tsolakou Date: Tue, 9 Apr 2024 15:56:34 +0200 Subject: [PATCH 1/4] delete references to safe place api --- README.md | 16 -- src/main/java/com/amadeus/Amadeus.java | 7 - src/main/java/com/amadeus/Safety.java | 51 ------- .../java/com/amadeus/resources/SafePlace.java | 52 ------- .../amadeus/safety/SafetyRatedLocation.java | 64 -------- .../amadeus/safety/SafetyRatedLocations.java | 73 --------- .../safety/safetyRatedLocations/BySquare.java | 64 -------- .../java/com/amadeus/safety/SafetyIT.java | 138 ------------------ ...y_rate_location_by_square_response_ok.json | 87 ----------- .../safety_rated_location_id_response_ok.json | 32 ---- .../safety_rated_locations_response_ok.json | 87 ----------- 11 files changed, 671 deletions(-) delete mode 100644 src/main/java/com/amadeus/Safety.java delete mode 100644 src/main/java/com/amadeus/resources/SafePlace.java delete mode 100644 src/main/java/com/amadeus/safety/SafetyRatedLocation.java delete mode 100644 src/main/java/com/amadeus/safety/SafetyRatedLocations.java delete mode 100644 src/main/java/com/amadeus/safety/safetyRatedLocations/BySquare.java delete mode 100644 src/test/java/com/amadeus/safety/SafetyIT.java delete mode 100644 src/test/resources/__files/safety_rate_location_by_square_response_ok.json delete mode 100644 src/test/resources/__files/safety_rated_location_id_response_ok.json delete mode 100644 src/test/resources/__files/safety_rated_locations_response_ok.json diff --git a/README.md b/README.md index 818221b2..8cc8e365 100644 --- a/README.md +++ b/README.md @@ -284,22 +284,6 @@ PointOfInterest[] pointsOfInterest = amadeus.referenceData.locations.pointsOfInt // Returns a single Point of Interest from a given id PointOfInterest pointOfInterest = amadeus.referenceData.locations.pointOfInterest("9CB40CB5D0").get(); -// Safe Place -// How safe is Barcelona? (based a geo location and a radius) -SafePlace[] safetyScore = amadeus.safety.safetyRatedLocations.get(Params - .with("latitude", "41.39715") - .and("longitude", "2.160873")); - -// How safe is Barcelona? (based on a square) -SafePlace[] safetyScore = amadeus.safety.safetyRatedLocations.bySquare.get(Params - .with("north", "41.397158") - .and("west", "2.160873") - .and("south", "41.394582") - .and("east", "2.177181")); - -// What is the safety information of a location based on it's Id? -SafePlace safetyScore = amadeus.safety.safetyRatedLocation("Q930400801").get(); - // Tours and Activities // What are the popular activities in Barcelona (based a geo location and a radius) Activity[] activities = amadeus.shopping.activities.get(Params diff --git a/src/main/java/com/amadeus/Amadeus.java b/src/main/java/com/amadeus/Amadeus.java index ad804b4f..0efe48ab 100644 --- a/src/main/java/com/amadeus/Amadeus.java +++ b/src/main/java/com/amadeus/Amadeus.java @@ -68,13 +68,6 @@ public class Amadeus extends HTTPClient { */ public Booking booking; - /** - *

- * A namespaced client for the /v1/safety endpoints. - *

- */ - public Safety safety; - /** *

* A namespaced client for the /v2/schedule endpoints. diff --git a/src/main/java/com/amadeus/Safety.java b/src/main/java/com/amadeus/Safety.java deleted file mode 100644 index b7378f35..00000000 --- a/src/main/java/com/amadeus/Safety.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.amadeus; - -import com.amadeus.safety.SafetyRatedLocation; -import com.amadeus.safety.SafetyRatedLocations; - -/** - *

- * A namespaced client for the - * /v1/safety endpoints. - *

- * - *

- * Access via the Amadeus client object. - *

- * - *
- * Amadeus amadeus = Amadeus.builder("clientId", "secret").build();
- * amadeus.safety;
- * - * @hide - */ -public class Safety { - private Amadeus client; - - /** - *

- * A namespaced client for the - * /v1/safety/safety-rated-locations endpoints. - *

- */ - public SafetyRatedLocations safetyRatedLocations; - - /** - * Constructor. - * @hide - */ - public Safety(Amadeus client) { - this.client = client; - this.safetyRatedLocations = new SafetyRatedLocations(client); - } - - /** - *

- * A namespaced client for the - * /v1/safety/safety-rated-locations/:safetyRatedLocationId endpoints. - *

- */ - public SafetyRatedLocation safetyRatedLocation(String safetyRatedLocationId) { - return new SafetyRatedLocation(client, safetyRatedLocationId); - } -} \ No newline at end of file diff --git a/src/main/java/com/amadeus/resources/SafePlace.java b/src/main/java/com/amadeus/resources/SafePlace.java deleted file mode 100644 index c80bacba..00000000 --- a/src/main/java/com/amadeus/resources/SafePlace.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.amadeus.resources; - -import lombok.Getter; -import lombok.ToString; - -/** - * A SafePlace object as returned by the Safe Place API. - * @see com.amadeus.safety.safety_rated_locations.SafePlace#get() - */ -@ToString -public class SafePlace extends Resource { - private @Getter String type; - private @Getter String id; - private @Getter String subType; - private @Getter String name; - private @Getter GeoCode geoCode; - private @Getter SafetyScores safetyScores; - - protected SafePlace() {} - - - /** - * An SafePlace-related object as returned by the SafePlace API. - * @see com.amadeus.safety.safety_rated_locations.SafePlace#get() - */ - @ToString - public class GeoCode { - private @Getter double latitude; - private @Getter double longitude; - - protected GeoCode() {} - } - - /** - * An SafePlace-related object as returned by the SafePlace API. - * @see com.amadeus.safety.safety_rated_locations.SafePlace#get() - */ - @ToString - public class SafetyScores { - private @Getter int women; - private @Getter int physicalHarm; - private @Getter int theft; - private @Getter int politicalFreedom; - private @Getter int lgbtq; - private @Getter int medical; - private @Getter int overall; - - protected SafetyScores() {} - - } - -} diff --git a/src/main/java/com/amadeus/safety/SafetyRatedLocation.java b/src/main/java/com/amadeus/safety/SafetyRatedLocation.java deleted file mode 100644 index a2bb2c2b..00000000 --- a/src/main/java/com/amadeus/safety/SafetyRatedLocation.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.amadeus.safety; - -import com.amadeus.Amadeus; -import com.amadeus.Params; -import com.amadeus.Response; -import com.amadeus.exceptions.ResponseException; -import com.amadeus.resources.Resource; -import com.amadeus.resources.SafePlace; - -/** - *

- * A namespaced client for the - * /v1/safety/safety-rated-locations endpoints. - *

- * - *

- * Access via the Amadeus client object. - *

- * - *
- * Amadeus amadeus = Amadeus.builder("clientId", "secret").build();
- * amadeus.safety.safetyRatedLocations;
- */ -public class SafetyRatedLocation { - private Amadeus client; - private String safetyRatedLocationId; - - /** - * Constructor. - * @hide - */ - public SafetyRatedLocation(Amadeus client, String safetyRatedLocationId) { - this.client = client; - this.safetyRatedLocationId = safetyRatedLocationId; - } - - - /** - *

- * Returns safety information of a location based on it's Id. - *

- * - *
-   * amadeus.safety.safetyRatedLocation("Q930402719").get();
- * - * @param params the parameters to send to the API - * @return an API response object - * @throws ResponseException when an exception occurs - */ - public SafePlace get(Params params) throws ResponseException { - String path = String.format("/v1/safety/safety-rated-locations/%s", safetyRatedLocationId); - Response response = client.get(path, params); - return (SafePlace) Resource.fromObject( - response, SafePlace.class); - } - - /** - * Convenience method for calling get without any parameters. - * @see SafetyRatedLocation#get() - */ - public SafePlace get() throws ResponseException { - return get(null); - } -} diff --git a/src/main/java/com/amadeus/safety/SafetyRatedLocations.java b/src/main/java/com/amadeus/safety/SafetyRatedLocations.java deleted file mode 100644 index 3c391bee..00000000 --- a/src/main/java/com/amadeus/safety/SafetyRatedLocations.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.amadeus.safety; - -import com.amadeus.Amadeus; -import com.amadeus.Params; -import com.amadeus.Response; -import com.amadeus.exceptions.ResponseException; -import com.amadeus.resources.Resource; -import com.amadeus.resources.SafePlace; -import com.amadeus.safety.safetyratedlocations.BySquare; - -/** - *

- * A namespaced client for the - * /v1/safety/safety-rated-locations endpoints. - *

- * - *

- * Access via the Amadeus client object. - *

- * - *
- * Amadeus amadeus = Amadeus.builder("clientId", "secret").build();
- * amadeus.safety.safetyRatedLocations;
- */ -public class SafetyRatedLocations { - private Amadeus client; - - - /** - *

- * A namespaced client for the - * /v1/safety/safety-rated-locations/by-square endpoints. - *

- */ - public BySquare bySquare; - - /** - * Constructor. - * @hide - */ - public SafetyRatedLocations(Amadeus client) { - this.client = client; - this.bySquare = new BySquare(client); - } - - - /** - *

- * Returns a list of safety information near to a given point. - *

- * - *
-   * amadeus.safety.safetyRatedLocations.get(Params
-   *   .with("longitude", 2.160873)
-   *   .and("latitude", 41.397158));
- * - * @param params the parameters to send to the API - * @return an API response object - * @throws ResponseException when an exception occurs - */ - public SafePlace[] get(Params params) throws ResponseException { - Response response = client.get("/v1/safety/safety-rated-locations", params); - return (SafePlace[]) Resource.fromArray(response, SafePlace[].class); - } - - /** - * Convenience method for calling get without any parameters. - * @see SafetyRatedLocations#get() - */ - public SafePlace[] get() throws ResponseException { - return get(null); - } -} diff --git a/src/main/java/com/amadeus/safety/safetyRatedLocations/BySquare.java b/src/main/java/com/amadeus/safety/safetyRatedLocations/BySquare.java deleted file mode 100644 index 3c5b040d..00000000 --- a/src/main/java/com/amadeus/safety/safetyRatedLocations/BySquare.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.amadeus.safety.safetyratedlocations; - -import com.amadeus.Amadeus; -import com.amadeus.Params; -import com.amadeus.Response; -import com.amadeus.exceptions.ResponseException; -import com.amadeus.resources.Resource; -import com.amadeus.resources.SafePlace; - -/** - *

- * A namespaced client for the - * /v1/safety/safety-rated-locations/by-square endpoints. - *

- * - *

- * Access via the Amadeus client object. - *

- * - *
- * Amadeus amadeus = Amadeus.builder("clientId", "secret").build();
- * amadeus.safety.safetyRatedLocations.bySquare;
- */ -public class BySquare { - private Amadeus client; - - /** - * Constructor. - * @hide - */ - public BySquare(Amadeus client) { - this.client = client; - } - - /** - *

- * Returns a list of safety information within a square defined by - * cardinal points. - *

- * - *
-   * amadeus.safety.safetyRatedLocations.bySquare.get(Params
-   *   .with("north", 41.397158)
-   *   .and("west", 2.160873)
-   *   .and("south", 41.394582)
-   *   .and("east", 2.177181));
- * - * @param params the parameters to send to the API - * @return an API response object - * @throws ResponseException when an exception occurs - */ - public SafePlace[] get(Params params) throws ResponseException { - Response response = client.get("/v1/safety/safety-rated-locations/by-square", params); - return (SafePlace[]) Resource.fromArray(response, SafePlace[].class); - } - - /** - * Convenience method for calling get without any parameters. - * @see SafetyRatedLocations#get() - */ - public SafePlace[] get() throws ResponseException { - return get(null); - } -} diff --git a/src/test/java/com/amadeus/safety/SafetyIT.java b/src/test/java/com/amadeus/safety/SafetyIT.java deleted file mode 100644 index 0ad2cc7a..00000000 --- a/src/test/java/com/amadeus/safety/SafetyIT.java +++ /dev/null @@ -1,138 +0,0 @@ -package com.amadeus.safety; - -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.get; -import static com.github.tomakehurst.wiremock.client.WireMock.post; -import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo; -import static org.junit.jupiter.api.Assertions.assertNotEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; - -import com.amadeus.Amadeus; -import com.amadeus.Params; -import com.amadeus.exceptions.ResponseException; -import com.amadeus.resources.SafePlace; -import com.github.tomakehurst.wiremock.WireMockServer; - -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -//https://developers.amadeus.com/blog/announcing-safe-place-api-geosure -public class SafetyIT { - - WireMockServer wireMockServer; - - private Amadeus amadeus; - - /** - * In every tests, we will authenticate. - */ - @BeforeEach - public void setup() { - wireMockServer = new WireMockServer(8080); - wireMockServer.start(); - - // API at https://developers.amadeus.com/self-service/apis-docs/guides/authorization-262 - String address = "/v1/security/oauth2/token" - + "?grant_type=client_credentials&client_secret=DEMO&client_id=DEMO"; - wireMockServer.stubFor(post(urlEqualTo(address)) - .willReturn(aResponse().withHeader("Content-Type", "application/json") - .withStatus(200) - .withBodyFile("auth_ok.json"))); - - amadeus = Amadeus - .builder("DEMO", "DEMO") - .setHost("localhost") - .setPort(8080) - .setSsl(false) - .setLogLevel("debug") - .build(); - } - - @AfterEach - public void teardown() { - wireMockServer.stop(); - } - - @Test - public void givenClientWhenCallSafetyRateLocationBySquareWithParamsThenOK() - throws ResponseException { - - // Given - String address = "/v1/safety/safety-rated-locations/by-square" - + "?east=2.177181&south=41.394582&north=41.397158&west=2.160873"; - wireMockServer.stubFor(get(urlEqualTo(address)) - .willReturn(aResponse().withHeader("Content-Type", "application/json") - .withStatus(200) - .withBodyFile("safety_rate_location_by_square_response_ok.json"))); - - Params params = Params - .with("north", "41.397158") - .and("west", "2.160873") - .and("south", "41.394582") - .and("east", "2.177181"); - - // When - SafePlace[] result = amadeus.safety.safetyRatedLocations.bySquare.get(params); - - // Then - assertNotEquals(0, result.length); - } - - @Test - public void givenClientWhenCallSafetyRateLocationBySquareWithoutParamsThenOK() - throws ResponseException { - - // Given - wireMockServer.stubFor(get(urlEqualTo("/v1/safety/safety-rated-locations/by-square")) - .willReturn(aResponse().withHeader("Content-Type", "application/json") - .withStatus(200) - .withBodyFile("safety_rate_location_by_square_response_ok.json"))); - - // When - SafePlace[] result = amadeus.safety.safetyRatedLocations.bySquare.get(); - - // Then - assertNotEquals(0, result.length); - } - - @Test - public void givenClientWhenCallSafetyRateLocationThenOK() throws ResponseException { - - // Given - wireMockServer.stubFor(get(urlEqualTo("/v1/safety/safety-rated-locations" - + "?latitude=41.39715&longitude=2.160873")) - .willReturn(aResponse().withHeader("Content-Type", "application/json") - .withStatus(200) - .withBodyFile("safety_rate_location_by_square_response_ok.json"))); - - Params params = Params - .with("latitude", "41.39715") - .and("longitude", "2.160873"); - - // When - SafePlace[] result = amadeus.safety.safetyRatedLocations.get(params); - - // Then - assertNotEquals(0, result.length); - } - - @Test - public void givenClientWhenCallSafetyRateLocationByIdThenOK() throws ResponseException { - - // Given - wireMockServer.stubFor(get(urlEqualTo("/v1/safety/safety-rated-locations/Q930402719")) - .willReturn(aResponse().withHeader("Content-Type", "application/json") - .withStatus(200) - .withBodyFile("safety_rated_location_id_response_ok.json"))); - - String id = "Q930402719"; - - // When - SafePlace result = amadeus.safety.safetyRatedLocation(id).get(); - - // Then - assertNotNull(result); - } - -} diff --git a/src/test/resources/__files/safety_rate_location_by_square_response_ok.json b/src/test/resources/__files/safety_rate_location_by_square_response_ok.json deleted file mode 100644 index be941cdd..00000000 --- a/src/test/resources/__files/safety_rate_location_by_square_response_ok.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "meta": { - "count": 10, - "links": { - "self": "https://test.api.amadeus.com/v1/safety/safety-rated-locations/by-square?north=43.645218&west=7.182018&south=43.760768&east=7.323896&page[limit]=3", - "next": "https://test.api.amadeus.com/v1/safety/safety-rated-locations/by-square?north=43.645218&west=7.182018&south=43.760768&east=7.323896&page[offset]=4", - "last": "https://test.api.amadeus.com/v1/safety/safety-rated-locations/by-square?north=43.645218&west=7.182018&south=43.760768&east=7.323896&page[offset]=7" - } - }, - "data": [ - { - "type": "safety-rated-location", - "id": "Q930400801", - "self": { - "href": "http://test.api.amadeus.com/v1/safety/safety-rated-locations/Q930400801", - "methods": [ - "GET" - ] - }, - "subType": "CITY", - "name": "Nice", - "geoCode": { - "longitude": 7.265592, - "latitude": 43.696036 - }, - "safetyRating": { - "women": 20, - "physicalHarm": 20, - "theft": 20, - "politicalFreedom": 20, - "lgbtq": 20, - "medical": 20, - "overall": 20 - } - }, - { - "type": "safety-rated-location", - "id": "Q930400804", - "self": { - "href": "http://test.api.amadeus.com/v1/safety/safety-rated-locations/Q930400804", - "methods": [ - "GET" - ] - }, - "subType": "DISTRICT", - "name": "Nice - Aéroport Nice Côte d'Azur", - "geoCode": { - "longitude": 7.214737, - "latitude": 43.661416 - }, - "safetyRating": { - "women": 20, - "physicalHarm": 20, - "theft": 40, - "politicalFreedom": 20, - "lgbtq": 20, - "medical": 20, - "overall": 20 - } - }, - { - "type": "safety-rated-location", - "id": "Q930400805", - "self": { - "href": "http://test.api.amadeus.com/v1/safety/safety-rated-locations/Q930400805", - "methods": [ - "GET" - ] - }, - "subType": "DISTRICT", - "name": "Nice - Arénas", - "geoCode": { - "longitude": 7.2199887, - "latitude": 43.6695279 - }, - "safetyRating": { - "women": 20, - "physicalHarm": 40, - "theft": 40, - "politicalFreedom": 20, - "lgbtq": 20, - "medical": 20, - "overall": 20 - } - } - ] -} diff --git a/src/test/resources/__files/safety_rated_location_id_response_ok.json b/src/test/resources/__files/safety_rated_location_id_response_ok.json deleted file mode 100644 index 6e121ea1..00000000 --- a/src/test/resources/__files/safety_rated_location_id_response_ok.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "data":{ - "type":"safety-rated-location", - "id":"Q930402719", - "self":{ - "type":"https://test.api.amadeus.com/v1/safety/safety-rated-locations/Q930402719", - "methods":[ - "GET" - ] - }, - "subType":"CITY", - "name":"Barcelona", - "geoCode":{ - "latitude":41.385064, - "longitude":2.173404 - }, - "safetyScores":{ - "lgbtq":39, - "medical":69, - "overall":45, - "physicalHarm":36, - "politicalFreedom":50, - "theft":44, - "women":34 - } - }, - "meta":{ - "links":{ - "self":"https://test.api.amadeus.com/v1/safety/safety-rated-locations/Q930402719" - } - } -} diff --git a/src/test/resources/__files/safety_rated_locations_response_ok.json b/src/test/resources/__files/safety_rated_locations_response_ok.json deleted file mode 100644 index ead4d862..00000000 --- a/src/test/resources/__files/safety_rated_locations_response_ok.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "meta": { - "count": 10, - "links": { - "self": "https://test.api.amadeus.com/v1/safety/safety-rated-locations?latitude=41.397158&longitude=2.160873&radius=2&page[limit]=3", - "next": "https://test.api.amadeus.com/v1/safety/safety-rated-locations?latitude=41.397158&longitude=2.160873&radius=2&page[offset]=4", - "last": "https://test.api.amadeus.com/v1/safety/safety-rated-locations?latitude=41.397158&longitude=2.160873&radius=2&page[offset]=7" - } - }, - "data": [ - { - "type": "safety-rated-location", - "id": "Q930400801", - "self": { - "href": "http://test.api.amadeus.com/v1/safety/safety-rated-locations/Q930400801", - "methods": [ - "GET" - ] - }, - "subType": "CITY", - "name": "Nice", - "geoCode": { - "longitude": 7.265592, - "latitude": 43.696036 - }, - "safetyRating": { - "women": 20, - "physicalHarm": 20, - "theft": 20, - "politicalFreedom": 20, - "lgbtq": 20, - "medical": 20, - "overall": 20 - } - }, - { - "type": "safety-rated-location", - "id": "Q930400804", - "self": { - "href": "http://test.api.amadeus.com/v1/safety/safety-rated-locations/Q930400804", - "methods": [ - "GET" - ] - }, - "subType": "DISTRICT", - "name": "Nice - Aéroport Nice Côte d'Azur", - "geoCode": { - "longitude": 7.214737, - "latitude": 43.661416 - }, - "safetyRating": { - "women": 20, - "physicalHarm": 20, - "theft": 40, - "politicalFreedom": 20, - "lgbtq": 20, - "medical": 20, - "overall": 20 - } - }, - { - "type": "safety-rated-location", - "id": "Q930400805", - "self": { - "href": "http://test.api.amadeus.com/v1/safety/safety-rated-locations/Q930400805", - "methods": [ - "GET" - ] - }, - "subType": "DISTRICT", - "name": "Nice - Arénas", - "geoCode": { - "longitude": 7.2199887, - "latitude": 43.6695279 - }, - "safetyRating": { - "women": 20, - "physicalHarm": 40, - "theft": 40, - "politicalFreedom": 20, - "lgbtq": 20, - "medical": 20, - "overall": 20 - } - } - ] -} From 60817df270f467f8f6d181e0d62c578d2c65eedd Mon Sep 17 00:00:00 2001 From: Anna Tsolakou Date: Tue, 9 Apr 2024 16:05:28 +0200 Subject: [PATCH 2/4] remove references at unit tests --- src/test/java/com/amadeus/NamespaceTest.java | 48 -------------------- 1 file changed, 48 deletions(-) diff --git a/src/test/java/com/amadeus/NamespaceTest.java b/src/test/java/com/amadeus/NamespaceTest.java index bce0f468..903ff6da 100644 --- a/src/test/java/com/amadeus/NamespaceTest.java +++ b/src/test/java/com/amadeus/NamespaceTest.java @@ -28,7 +28,6 @@ import com.amadeus.referencedata.locations.hotels.ByHotels; import com.amadeus.referencedata.urls.CheckinLinks; import com.amadeus.resources.TransferCancellation; -import com.amadeus.safety.SafetyRatedLocations; import com.amadeus.schedule.Flights; import com.amadeus.shopping.Activities; import com.amadeus.shopping.FlightDates; @@ -240,53 +239,6 @@ public void testRecommendedLocations() throws ResponseException { assertEquals(destinations.get().length, 2); } - @Test - public void testSafetyRatedLocations() throws ResponseException { - // Testing Safe Place - Mockito.when(client.get("/v1/safety/safety-rated-locations", null)) - .thenReturn(multiResponse); - Mockito.when(client.get("/v1/safety/safety-rated-locations", params)) - .thenReturn(multiResponse); - SafetyRatedLocations safetyCoords = new SafetyRatedLocations(client); - assertNotNull(safetyCoords.get()); - assertNotNull(safetyCoords.get(params)); - assertEquals(safetyCoords.get().length, 2); - } - - @Test - public void testSafetyRatedLocationsBySquare() throws ResponseException { - // Testing Safe Place by square - Mockito.when(client.get("/v1/safety/safety-rated-locations", null)) - .thenReturn(multiResponse); - Mockito.when(client.get("/v1/safety/safety-rated-locations", params)) - .thenReturn(multiResponse); - Mockito.when(client.get("/v1/safety/safety-rated-locations/by-square", null)) - .thenReturn(multiResponse); - Mockito.when(client.get("/v1/safety/safety-rated-locations/by-square", params)) - .thenReturn(multiResponse); - SafetyRatedLocations safetySquare = new SafetyRatedLocations(client); - assertNotNull(safetySquare.get()); - assertNotNull(safetySquare.get(params)); - assertEquals(safetySquare.get().length, 2); - } - - @Test - public void testSafetyRatedLocationsById() throws ResponseException { - // Testing Safe Place by Id - Mockito.when(client.get("/v1/safety/safety-rated-locations", null)) - .thenReturn(multiResponse); - Mockito.when(client.get("/v1/safety/safety-rated-locations", params)) - .thenReturn(multiResponse); - Mockito.when(client.get("/v1/safety/safety-rated-locations/XXX", null)) - .thenReturn(multiResponse); - Mockito.when(client.get("/v1/safety/safety-rated-locations/XXX", params)) - .thenReturn(multiResponse); - SafetyRatedLocations safetyById = new SafetyRatedLocations(client); - assertNotNull(safetyById.get()); - assertNotNull(safetyById.get(params)); - assertEquals(safetyById.get().length, 2); - } - @Test public void testActivities() throws ResponseException { // Testing Tours and Activities From e23d9a88a8f376f217ed1fcff7cd5e17683b5706 Mon Sep 17 00:00:00 2001 From: Anna Tsolakou Date: Tue, 9 Apr 2024 16:06:57 +0200 Subject: [PATCH 3/4] remove references from Amadeus.java --- src/main/java/com/amadeus/Amadeus.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/amadeus/Amadeus.java b/src/main/java/com/amadeus/Amadeus.java index 0efe48ab..b58e3912 100644 --- a/src/main/java/com/amadeus/Amadeus.java +++ b/src/main/java/com/amadeus/Amadeus.java @@ -111,7 +111,6 @@ protected Amadeus(Configuration configuration) { this.ereputation = new EReputation(this); this.airport = new Airport(this); this.booking = new Booking(this); - this.safety = new Safety(this); this.schedule = new Schedule(this); this.analytics = new Analytics(this); this.location = new Location(this); From 1ac4ab5ce84ae4acc214568ef9da85bfc03a1ad9 Mon Sep 17 00:00:00 2001 From: Anna Tsolakou Date: Tue, 9 Apr 2024 16:09:32 +0200 Subject: [PATCH 4/4] remove references in unit tests namespace check --- src/test/java/com/amadeus/NamespaceTest.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/test/java/com/amadeus/NamespaceTest.java b/src/test/java/com/amadeus/NamespaceTest.java index 903ff6da..be526366 100644 --- a/src/test/java/com/amadeus/NamespaceTest.java +++ b/src/test/java/com/amadeus/NamespaceTest.java @@ -95,9 +95,6 @@ public class NamespaceTest { assertNotNull(client.airport.predictions.onTime); assertNotNull(client.booking.flightOrder("XXX")); assertNotNull(client.booking.hotelBookings); - assertNotNull(client.safety.safetyRatedLocations); - assertNotNull(client.safety.safetyRatedLocations.bySquare); - assertNotNull(client.safety.safetyRatedLocation("XXX")); assertNotNull(client.schedule.flights); assertNotNull(client.travel.tripParser); assertNotNull(client.airport.directDestinations);