From b7873cf81430e1c8aaefa9a32a04496d73cbf160 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 22 May 2022 07:48:42 +0200 Subject: [PATCH] Fixed an issue with the matching of the URIs for `actions` --- .../test/java/de/juplo/demos/pact/ContractTest.java | 4 ++-- .../pacts/SpringConsumer-SirenOrderProvider.json | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/spring-consumer/src/test/java/de/juplo/demos/pact/ContractTest.java b/spring-consumer/src/test/java/de/juplo/demos/pact/ContractTest.java index 6fa8b5a..b5c41a3 100644 --- a/spring-consumer/src/test/java/de/juplo/demos/pact/ContractTest.java +++ b/spring-consumer/src/test/java/de/juplo/demos/pact/ContractTest.java @@ -68,13 +68,13 @@ public class ContractTest { object.stringValue("name","update"); object.stringValue("method", "PUT"); - object.matchUrl2("href", "orders", Matchers.regexp("\\d+", "1234").getValue()); + object.matchUrl2("href", "orders", Matchers.regexp("\\d+", "1234").getMatcher()); }); actionsArray.object(object -> { object.stringValue("name","delete"); object.stringValue("method", "DELETE"); - object.matchUrl2("href", "orders", Matchers.regexp("\\d+", "1234").getValue()); + object.matchUrl2("href", "orders", Matchers.regexp("\\d+", "1234").getMatcher()); }); }); entities.array("class", classArray -> diff --git a/spring-consumer/target/pacts/SpringConsumer-SirenOrderProvider.json b/spring-consumer/target/pacts/SpringConsumer-SirenOrderProvider.json index 27ff970..a8f8b03 100644 --- a/spring-consumer/target/pacts/SpringConsumer-SirenOrderProvider.json +++ b/spring-consumer/target/pacts/SpringConsumer-SirenOrderProvider.json @@ -86,12 +86,12 @@ }, "$.entities[*][0].href": { "example": "http://localhost:8080/orders/1234", - "regex": ".*\\/(\\Qorders\\E\\/\\Q1234\\E)$", + "regex": ".*\\/(\\Qorders\\E\\/\\d+)$", "type": "MockServerURL" }, "$.entities[*][1].href": { "example": "http://localhost:8080/orders/1234", - "regex": ".*\\/(\\Qorders\\E\\/\\Q1234\\E)$", + "regex": ".*\\/(\\Qorders\\E\\/\\d+)$", "type": "MockServerURL" }, "$.links[0].href": { @@ -124,7 +124,7 @@ "generators": { "$.href": { "example": "http://localhost:8080/orders/1234", - "regex": ".*\\/(\\Qorders\\E\\/\\Q1234\\E)$", + "regex": ".*\\/(\\Qorders\\E\\/\\d+)$", "type": "MockServerURL" } }, @@ -135,7 +135,7 @@ "matchers": [ { "match": "regex", - "regex": ".*\\/(\\Qorders\\E\\/\\Q1234\\E)$" + "regex": ".*\\/(\\Qorders\\E\\/\\d+)$" } ] } @@ -145,7 +145,7 @@ "generators": { "$.href": { "example": "http://localhost:8080/orders/1234", - "regex": ".*\\/(\\Qorders\\E\\/\\Q1234\\E)$", + "regex": ".*\\/(\\Qorders\\E\\/\\d+)$", "type": "MockServerURL" } }, @@ -156,7 +156,7 @@ "matchers": [ { "match": "regex", - "regex": ".*\\/(\\Qorders\\E\\/\\Q1234\\E)$" + "regex": ".*\\/(\\Qorders\\E\\/\\d+)$" } ] } -- 2.20.1