update
This commit is contained in:
@@ -38,6 +38,11 @@ public final class TestReservations {
|
||||
// 4. Request that Manager updates specific account’s files with data stored in
|
||||
// memory
|
||||
mgr.UpdateAccount(acct);
|
||||
|
||||
Account acct2 = mgr.newAccount("301-356-3890",
|
||||
new Address("30 Amstadam ave", "New York", "NY", "12010"),
|
||||
new EmailAddress("newbee952@aol.com"));
|
||||
mgr.AddAccount(acct2);
|
||||
// 5. Add draft lodging reservation to an account (if reservation object already
|
||||
// exists with the same reservation number, it is considered an error)
|
||||
|
||||
@@ -50,12 +55,22 @@ public final class TestReservations {
|
||||
hotel.setSquareFeet(450);
|
||||
hotel.setReservation_start_date(ZonedDateTime.of(2025, 07, 05, 10, 0, 0, 0, ZoneId.of("UTC")));
|
||||
hotel.setReservation_end_date(ZonedDateTime.of(2025, 11, 30, 22, 0, 0, 0, ZoneId.of("UTC")));
|
||||
boolean success1 = mgr.addReservation(acct, hotel);
|
||||
assert success1;
|
||||
mgr.addReservation(acct, hotel);
|
||||
|
||||
mgr.UpdateAccount(acct);
|
||||
|
||||
CabinReservation cabin = new CabinReservation(new Address("30 cabin ave", "Carnelian", "CA", "96140"));
|
||||
cabin.setMailing_address(new Address("30 cabin ave", "Carnelian Bay", "CA", "96140"));
|
||||
cabin.setNumberOfBeds(4);
|
||||
cabin.setNumberOfFloors(2);
|
||||
cabin.setNumberOfBedRooms(3);
|
||||
cabin.setSquareFeet(806);
|
||||
cabin.setReservation_start_date(ZonedDateTime.of(2025, 9, 05, 10, 0, 0, 0, ZoneId.of("UTC")));
|
||||
cabin.setReservation_end_date(ZonedDateTime.of(2025, 11, 30, 22, 0, 0, 0, ZoneId.of("UTC")));
|
||||
mgr.addReservation(acct2, cabin);
|
||||
mgr.UpdateAccount(acct2);
|
||||
|
||||
cabin = new CabinReservation(new Address("40 cabin ave", "Carnelian", "CA", "96140"));
|
||||
cabin.setMailing_address(new Address("40 cabin ave", "Carnelian Bay", "CA", "96140"));
|
||||
cabin.setNumberOfBeds(4);
|
||||
cabin.setNumberOfFloors(2);
|
||||
@@ -63,8 +78,7 @@ public final class TestReservations {
|
||||
cabin.setSquareFeet(806);
|
||||
cabin.setReservation_start_date(ZonedDateTime.of(2025, 9, 05, 10, 0, 0, 0, ZoneId.of("UTC")));
|
||||
cabin.setReservation_end_date(ZonedDateTime.of(2025, 11, 30, 22, 0, 0, 0, ZoneId.of("UTC")));
|
||||
boolean success2 = mgr.addReservation(acct, cabin);
|
||||
assert success2;
|
||||
mgr.addReservation(acct, cabin);
|
||||
|
||||
mgr.UpdateAccount(acct);
|
||||
|
||||
@@ -77,8 +91,7 @@ public final class TestReservations {
|
||||
house.setSquareFeet(1400);
|
||||
house.setReservation_start_date(ZonedDateTime.of(2025, 9, 5, 10, 0, 0, 0, ZoneId.of("UTC")));
|
||||
house.setReservation_end_date(ZonedDateTime.of(2025, 11, 30, 22, 0, 0, 0, ZoneId.of("UTC")));
|
||||
boolean success3 = mgr.addReservation(acct, house);
|
||||
assert success3;
|
||||
mgr.addReservation(acct, house);
|
||||
|
||||
mgr.UpdateAccount(acct);
|
||||
|
||||
|
||||
26
src/resources/acc-A2074212339.json
Normal file
26
src/resources/acc-A2074212339.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"Account": {
|
||||
"account_number": "A2074212339",
|
||||
"phone_number": "301-356-3890",
|
||||
"mailing_address": {
|
||||
"Address": {
|
||||
"street": "30 Amstadam ave",
|
||||
"city": "New York",
|
||||
"state": "NY",
|
||||
"zip": "12010"
|
||||
}
|
||||
},
|
||||
"email_address": {
|
||||
"EmailAddress": {
|
||||
"email": "newbee952@aol.com"
|
||||
}
|
||||
},
|
||||
"reservation_list": [
|
||||
{
|
||||
"CabinReservation": {
|
||||
"reservation_number": "R2042828431"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
32
src/resources/rsv-R0535276622.json
Normal file
32
src/resources/rsv-R0535276622.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"CabinReservation": {
|
||||
"reservation_type": "CabinReservation",
|
||||
"reservation_number": "R0535276622",
|
||||
"reservation_status": "Draft",
|
||||
"reservation_start_date": "2025-09-05T10:00Z[UTC]",
|
||||
"reservation_end_date": "2025-11-30T22:00Z[UTC]",
|
||||
"physical_address": {
|
||||
"Address": {
|
||||
"street": "40 cabin ave",
|
||||
"city": "Carnelian",
|
||||
"state": "CA",
|
||||
"zip": "96140"
|
||||
}
|
||||
},
|
||||
"mailing_address": {
|
||||
"Address": {
|
||||
"street": "40 cabin ave",
|
||||
"city": "Carnelian Bay",
|
||||
"state": "CA",
|
||||
"zip": "96140"
|
||||
}
|
||||
},
|
||||
"kitchen": "Kitchenette",
|
||||
"numberOfBeds": "4",
|
||||
"numberOfBedRooms": "3",
|
||||
"numberOfBathRooms": "1",
|
||||
"numberOfFloors": "2",
|
||||
"squareFeet": "806",
|
||||
"price": "120.0"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user