Skip to content

Commit 4ef91f5

Browse files
author
Ronald Holshausen
committed
chore: update readme
1 parent 1e1a257 commit 4ef91f5

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

README.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ In `consumer/src/test/java/au/com/dius/pactworkshop/consumer/ProductConsumerPact
509509
.path("/products")
510510
.willRespondWith()
511511
.status(200)
512-
.headers(Map.of("Content-Type", "application/json; charset=utf-8"))
512+
.headers(headers())
513513
.body("[]")
514514
.toPact();
515515
}
@@ -557,7 +557,15 @@ Notice that our new tests look almost identical to our previous tests, and only
557557
BUILD SUCCESSFUL in 1s
558558
```
559559

560-
What does our provider have to say about this new test. Again, copy the updated pact file into the provider's pact directory and run the command:
560+
What does our provider have to say about this new test. Again, copy the updated pact file into the provider's pact directory:
561+
562+
```console
563+
> ./gradlew consumer:copyPacts
564+
565+
BUILD SUCCESSFUL in 1s
566+
```
567+
568+
and run the command:
561569

562570
```console
563571
./gradlew provider:test --tests *Pact*Test
@@ -582,3 +590,5 @@ FAILURE: Build failed with an exception.
582590
We expected this failure, because the product we are requesting does in fact exist! What we want to test for, is what happens if there is a different *state* on the Provider. This is what is referred to as "Provider states", and how Pact gets around test ordering and related issues.
583591

584592
We could resolve this by updating our consumer test to use a known non-existent product, but it's worth understanding how Provider states work more generally.
593+
594+
Move on to [step 7](https://github.com/pact-foundation/pact-workshop-jvm-spring/tree/step7#step-7---adding-the-missing-states)

provider/src/main/java/au/com/dius/pactworkshop/provider/ProductRepository.java

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public List<Product> fetchAll() {
2121

2222
public Optional<Product> getById(String id) {
2323
initProducts();
24+
2425
return Optional.ofNullable(PRODUCTS.get(id));
2526
}
2627

0 commit comments

Comments
 (0)