Skip to content

Commit

Permalink
task-consumer-pact-done
Browse files Browse the repository at this point in the history
  • Loading branch information
yacekmm committed Dec 6, 2024
1 parent 48670b2 commit 824cfe9
Showing 1 changed file with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,29 @@ public RequestResponsePact applyPercentageDiscount(PactDslWithProvider builder)
.given("price for item exists", "itemId", "123")
.uponReceiving("a discount request")
.path("/api/v1/item/123/price-factor/percentage")
//TODO specify HTTP method, headers and request body
.method("POST")
.headers(Map.of("Content-Type", "application/json"))
.body("""
{
"percentage": 10
}
""")
.willRespondWith()
//TODO specify response status, headers and body
.status(200)
.headers(Map.of("Content-Type", "application/json"))
.body("""
[
{
"price": 9000,
"factors": [
{
"type": "PERCENTAGE",
"value": 10
}
]
}
]
""")
.toPact();
}

Expand Down

0 comments on commit 824cfe9

Please sign in to comment.