North-Seattle-College / ad440-winter2020-thursday-repo

Repository for AD440 Thursday Class in Winter 2020
Apache License 2.0
10 stars 5 forks source link

TT2: GET, POST Key #266

Open UnTamedLaw opened 4 years ago

ChoiSojung commented 4 years ago

For POST key test only: I used this test link: https://api.2edusite.com/feature-sprint5/property/2/keybundle/ And the following for the body input: { "keybundle_id": 44409, "keybundle_status_id": 2, "keyholder_id": 1, "keybundle_checkout_date": "2020-01-01", "keybundle_due_date": "2020-01-02" }

I received a 200 OK for this test.

Error checking - I tried to create a keybundle with a property id that doesn't exist using this link: https://api.2edusite.com/feature-sprint5/property/100/keybundle/

I received a 500 Internal server error with the following message: errorMessage": "Server Error Error: ER_NO_REFERENCED_ROW_2: Cannot add or update a child row: a foreign key constraint fails (keymanagement.keybundle, CONSTRAINT keybundle_ibfk_1 FOREIGN KEY (property_id) REFERENCES property (property_id) ON DELETE NO ACTION)",

I also tried to create a keybundle with a keybundle id that already exists in the database and got a 500 Internal server error there as well with a duplicate id error message.

ChoiSojung commented 4 years ago

For GET Key test only: I used this test link: https://api.2edusite.com/feature-sprint5/keybundle/ And received a list of all keybundles in the database.