Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
# wait a minute for all services to be up
- run: sleep 30 && hurl --very-verbose tests/*.hurl
shell: bash
- run: hurl --very-verbose tests/flows/*.hurl
shell: bash
unit-tests:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
gradle/
build/
target/
bin/
gradlew.bat
gradlew

.idea/
.vscode/

postgres-data/
.db/
Expand Down
2 changes: 1 addition & 1 deletion customer-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ EXPOSE 8081
## Use this if you want to just copy the executable
COPY customer-service/build/libs/customer-service.jar app.jar
COPY customer-service/build/resources resources
CMD java -jar app.jar
CMD java -jar app.jar --debug

# Use this if you want to build in docker
#WORKDIR /app
Expand Down
2 changes: 1 addition & 1 deletion inventory-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ EXPOSE 8087
## Use this if you want to just copy the executable
COPY inventory-service/build/libs/inventory-service.jar app.jar
COPY inventory-service/build/resources resources
CMD java -jar app.jar
CMD java -jar app.jar --debug

# Use this if you want to build in docker
#WORKDIR /app
Expand Down
2 changes: 1 addition & 1 deletion order-management-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ EXPOSE 8088
## Use this if you want to just copy the executable
COPY order-management-service/build/libs/order-management-service.jar app.jar
COPY order-management-service/build/resources resources
CMD java -jar app.jar
CMD java -jar app.jar --debug

# Use this if you want to build in docker
#WORKDIR /app
Expand Down
104 changes: 104 additions & 0 deletions tests/flows/1.hurl
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
### PRODUCT, INVENTORY & STAFF SET-UP ###
POST http://localhost:8080/api/Products
{
"category": "TODO-1",
"name": "Pizza",
"price": 1100
}
HTTP 201
[Captures]
product-id1: jsonpath "$.id"

POST http://localhost:8080/api/Products
{
"category": "TODO-1",
"name": "Blynai",
"price": 780
}
HTTP 201
[Captures]
product-id2: jsonpath "$.id"

POST http://localhost:8080/api/Products
{
"category": "TODO-2",
"name": "Alus",
"price": 320
}
HTTP 201
[Captures]
product-id3: jsonpath "$.id"

POST http://localhost:8080/api/Inventory
{
"product_id": {{product-id1}},
"stockQuantity": 100
}
HTTP 201

POST http://localhost:8080/api/Inventory
{
"product_id": {{product-id2}},
"stockQuantity": 50
}
HTTP 201

POST http://localhost:8080/api/Inventory
{
"product_id": {{product-id3}},
"stockQuantity": 5
}
HTTP 201

POST http://localhost:8080/api/Staff
{
"name": "Vardenis Pavardenis",
"email": "example@example.com",
"password": "password"
}
HTTP 201
[Captures]
staff-id: jsonpath "$.id"


### Create Order ###

#POST http://localhost:8080/api/OrderItem
#{
# "name": "Blynai",
# "quantity": 1,
# "priceOfUnit": 780
#}
#HTTP 201

#POST http://localhost:8080/api/OrderItem
#{
# "name": "Alus",
# "quantity": 2,
# "priceOfUnit": 320
#}

POST http://localhost:8080/api/Orders
{
"staffUserId": {{staff-id}},
"items": [
{
"name": "Alus",
"quantity": 2,
"priceOfUnit": 320
},
{
"name": "Blynai",
"quantity": 1,
"priceOfUnit": 780
}
],
"status": "ACTIVE"
}
HTTP 201

### ADD ITEMS TO THE ORDER ###

# TODO: implement add product
# TODO: implement remove product