Open Derppening opened 4 years ago
Submitting a PUT /transaction with an invalid book is successful.
PUT /transaction
Assuming the database is setup according to the README and web server is running:
400 Bad Request
200 OK
curl -v -X PUT --data "{\"Transaction\": 2058, \"Book\": 1, \"Action\": \"return\"}" http://localhost:8081/BookManagementService/transaction\?token\=ccu6764 * Trying ::1:8081... * Connected to localhost (::1) port 8081 (#0) > PUT /BookManagementService/transaction?token=ccu6764 HTTP/1.1 > Host: localhost:8081 > User-Agent: curl/7.70.0 > Accept: */* > Content-Length: 52 > Content-Type: application/x-www-form-urlencoded > * upload completely sent off: 52 out of 52 bytes * Mark bundle as not supporting multiuse < HTTP/1.1 200 OK < Date: Sun, 31 May 2020 14:25:14 GMT < Server: Apache-HttpCore-NIO/1.1 < Content-Length: 0 < * Connection #0 to host localhost left intact
the push operation does not check the validity of books, and in fact, the transaction never guarantees its successful execution. If the operation is valid itself, it is correct to respond 200.
Issue description
Submitting a
PUT /transaction
with an invalid book is successful.Steps to reproduce this issue
Assuming the database is setup according to the README and web server is running:
PUT /transaction
request to the server with any book IDWhat's the expected result?
400 Bad Request
What's the actual result?
200 OK