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

TT6: PUT, DELETE Property #274

Open UnTamedLaw opened 4 years ago

miscdats commented 4 years ago

When attempting a PUT operation on this endpoint for property -a in the path for {property_id}, expected a 400 status code returned. actual: 400 Bad Request { "errorType": "string", "errorMessage": "Bad Request !", "trace": [] }

When attempting to do a PUT operation for property 9999999 in the path, expected a 404 status code. actual: 200 OK { "statusCode": 201, "body": { "property_id": 4, "property_name": "Main steet", "property_type_id": 2, "property_address": "999 Main ST", "property_city": "Seattle", "property_state": "WA", "property_zip": "98105", "property_country": "USA" }, "message": "Updated !" } Would like to see: path param to be checked against body param for property_id

In body:

{
    "property_id": 4,
    "property_name": "Main steet",
    "property_type_id": 2,
    "property_address": "999 Main ST",
    "property_city": "Seattle",
    "property_state": "WA",
    "property_zip": "98105",
    "property_country": "USA",
    "property_type": "Residential-SFH"
}

When attempting to do a PUT operation without this information in the body, or misshapen data, expected a 400 status code returned. actual: 400 Bad Request { "errorType": "string", "errorMessage": "Bad Request !", "trace": [] }

When a value for property_id is in path and the correctly formatted data is in the body (as above), expected a 200 status code return with successful operation message. actual: 200 OK { "statusCode": 201, "body": { "property_id": 4, "property_name": "Main steet", "property_type_id": 2, "property_address": "999 Main ST", "property_city": "Seattle", "property_state": "WA", "property_zip": "98105", "property_country": "USA" }, "message": "Updated !" }

When attempting DELETE method for this endpoint on property 51, expected a 200 status code and message of confirmation in return. Inputs are in path for {property_id}. actual return : 200 OK "Default property_id 51 deleted and 0 keybundles deleted" This is satisfactory for a successful operation.

When attempting DELETE for a property that does not exist, expecting a 404 status code return. actual: 404 Not Found { "errorType": "string", "errorMessage": "Not Found ", "trace": [] }

When attempting DELETE for a property -a, expecting a 400 status code return with message. actual : 400 Bad Request { "errorType": "string", "errorMessage": "Bad Request ", "trace": [] }