Fixed an issue with the matching of the URIs for `actions`
authorKai Moritz <kai@juplo.de>
Sun, 22 May 2022 05:48:42 +0000 (07:48 +0200)
committerKai Moritz <kai@juplo.de>
Fri, 3 Jun 2022 11:49:15 +0000 (13:49 +0200)
spring-consumer/src/test/java/de/juplo/demos/pact/ContractTest.java
spring-consumer/target/pacts/SpringConsumer-SirenOrderProvider.json

index 6fa8b5a..b5c41a3 100644 (file)
@@ -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 ->
index 27ff970..a8f8b03 100644 (file)
             },
             "$.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": {
                       "generators": {
                         "$.href": {
                           "example": "http://localhost:8080/orders/1234",
-                          "regex": ".*\\/(\\Qorders\\E\\/\\Q1234\\E)$",
+                          "regex": ".*\\/(\\Qorders\\E\\/\\d+)$",
                           "type": "MockServerURL"
                         }
                       },
                           "matchers": [
                             {
                               "match": "regex",
-                              "regex": ".*\\/(\\Qorders\\E\\/\\Q1234\\E)$"
+                              "regex": ".*\\/(\\Qorders\\E\\/\\d+)$"
                             }
                           ]
                         }
                       "generators": {
                         "$.href": {
                           "example": "http://localhost:8080/orders/1234",
-                          "regex": ".*\\/(\\Qorders\\E\\/\\Q1234\\E)$",
+                          "regex": ".*\\/(\\Qorders\\E\\/\\d+)$",
                           "type": "MockServerURL"
                         }
                       },
                           "matchers": [
                             {
                               "match": "regex",
-                              "regex": ".*\\/(\\Qorders\\E\\/\\Q1234\\E)$"
+                              "regex": ".*\\/(\\Qorders\\E\\/\\d+)$"
                             }
                           ]
                         }