Skip to content

Commit

Permalink
chore(test): change a product id
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed Dec 10, 2024
1 parent 45cf75f commit 0cb0167
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/test/java/com/example/products/ProductsPactTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public RequestResponsePact getProduct(PactDslWithProvider builder) {
PactDslJsonBody body = new PactDslJsonBody();
body.stringType("name", "product name");
body.stringType("type", "product series");
body.stringType("id", "5cc989d0-d800-434c-b4bb-b1268499e850");
body.stringType("id", "5cc989d1-d800-434c-b4bb-b1268499e850");

return builder
.given("a product with ID 10 exists")
Expand All @@ -46,7 +46,7 @@ public RequestResponsePact getProduct(PactDslWithProvider builder) {
public void testGetProduct(MockServer mockServer) throws IOException {
Product product = new ProductClient().setUrl(mockServer.getUrl()).getProduct("10");

assertThat(product.getId(), is("5cc989d0-d800-434c-b4bb-b1268499e850"));
assertThat(product.getId(), is("5cc989d1-d800-434c-b4bb-b1268499e850"));
}

@Pact(consumer="pactflow-example-consumer-java-junit")
Expand All @@ -61,7 +61,7 @@ public RequestResponsePact getProducts(PactDslWithProvider builder) {
.body(PactDslJsonArray.arrayEachLike()
.stringType("name", "product name")
.stringType("type", "product series")
.stringType("id", "5cc989d0-d800-434c-b4bb-b1268499e850")
.stringType("id", "5cc989d1-d800-434c-b4bb-b1268499e850")
.stringType("foo", "bar")
.closeObject())
.toPact();
Expand All @@ -72,6 +72,6 @@ public RequestResponsePact getProducts(PactDslWithProvider builder) {
public void testGetProducts(MockServer mockServer) throws IOException {
List<Product> products = new ProductClient().setUrl(mockServer.getUrl()).getProducts();

assertThat(products.get(0).getId(), is("5cc989d0-d800-434c-b4bb-b1268499e850"));
assertThat(products.get(0).getId(), is("5cc989d1-d800-434c-b4bb-b1268499e850"));
}
}

0 comments on commit 0cb0167

Please sign in to comment.