Files
cloud-cap-samples/packages/bookshop/tests/openSAP.http
2019-12-19 15:08:34 +01:00

48 lines
1.3 KiB
HTTP

##########################################
# Test bookstore
##########################################
@PORT = 4004
@HOST = localhost
#######
# List books
#######
GET http://{{HOST}}:{{PORT}}/browse/Books HTTP/1.1
### List Books with their current stocks via Browse service
### title containts "discount" info due to custom handler in cat-service.js
GET http://{{HOST}}:{{PORT}}/browse/Books?$select=ID,title,stock
### List Books with their current stocks via Admin service
### title DOES NOT containt "discount" info as there is no custom handler for admin service
# skip admin service
# GET http://{{HOST}}:{{PORT}}/admin/Books?$select=ID,title,stock
### List all Orders
GET http://{{HOST}}:{{PORT}}/admin/Orders?&$expand=Items
#######
# Create order
#######
# Sending this three times should result in a 409: 5 exceeds stock for book #201
POST http://{{HOST}}:{{PORT}}/browse/Orders HTTP/1.1
Content-Type: application/json;IEEE754Compatible=true
{ "OrderNo":"2019-09...", "Items":[
{ "book_ID":201, "amount":3 },
{ "book_ID":207, "amount":3 }
]}
#######
# Delete order not allowed due to annotation @insertonly in cat-service.cds
#######
DELETE http://{{HOST}}:{{PORT}}//browse/Orders/7e2f2640-6866-4dcf-8f4d-3027aa831cad HTTP/1.1
#######
# List order not allowed due to @insertonly
#######
GET http://{{HOST}}:{{PORT}}//browse/Orders HTTP/1.1