Skip to content

Commit

Permalink
Merge pull request #221 from amadeus4dev/fix-device-type
Browse files Browse the repository at this point in the history
Fix device type
  • Loading branch information
tsolakoua authored Dec 21, 2022
2 parents 240b9a5 + 98f4067 commit aa73c8f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
15 changes: 8 additions & 7 deletions src/main/java/com/amadeus/resources/FlightOrder.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public static class Traveler {

private @Getter @Setter String id;
private @Getter @Setter String dateOfBirth;
private @Getter @Setter String gender;
private @Getter @Setter Name name;
private @Getter @Setter Contact contact;
private @Getter @Setter Document[] documents;
Expand All @@ -60,13 +61,6 @@ public static class Name {
public static class Contact {

private @Getter @Setter Phone[] phones;
private @Getter @Setter DeviceType deviceType;

public enum DeviceType {
MOBILE,
LANDLINE,
FAX
}
}

@AllArgsConstructor
Expand Down Expand Up @@ -97,6 +91,13 @@ public static class Phone {

private @Getter @Setter String countryCallingCode;
private @Getter @Setter String number;
private @Getter @Setter DeviceType deviceType;

public enum DeviceType {
MOBILE,
LANDLINE,
FAX
}
}

}
3 changes: 2 additions & 1 deletion src/test/java/com/amadeus/booking/FlightOrdersIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.amadeus.resources.FlightOrder.Document;
import com.amadeus.resources.FlightOrder.Name;
import com.amadeus.resources.FlightOrder.Phone;
import com.amadeus.resources.FlightOrder.Phone.DeviceType;
import com.amadeus.resources.FlightOrder.Traveler;
import com.amadeus.resources.FlightPrice;
import com.github.tomakehurst.wiremock.WireMockServer;
Expand Down Expand Up @@ -113,10 +114,10 @@ private Traveler[] getTravelerData() {
phone[0] = new Phone();
phone[0].setCountryCallingCode("33");
phone[0].setNumber("675426222");
phone[0].setDeviceType(DeviceType.MOBILE);

Contact contact = new Contact();
contact.setPhones(phone);
contact.setDeviceType(Contact.DeviceType.MOBILE);
traveler.setContact(contact);

Document[] document = new Document[1];
Expand Down

0 comments on commit aa73c8f

Please sign in to comment.