WIP
[demos/example-siren] / spring-consumer / src / test / java / de / juplo / demos / pact / ContractTest.java
index 2e89474..0e62c48 100644 (file)
@@ -12,6 +12,7 @@ import org.springframework.boot.web.client.RestTemplateBuilder;
 import org.springframework.web.client.RestTemplate;
 
 import java.util.Map;
+import java.util.regex.Pattern;
 
 import static org.assertj.core.api.Assertions.fail;
 
@@ -32,6 +33,15 @@ public class ContractTest
             .headers(Map.of("Content-Type", "application/vnd.siren+json"))
             .body(LambdaDsl.newJsonBody(body ->
             {
+              body.arrayContaining("actions", actions ->
+              {
+                actions.object(object ->
+                {
+                  object.stringType("name","update");
+                  object.stringType("method", "PUT");
+                  object.matchUrl2("href", Matchers.regexp("\\d+", "1234"));
+                });
+              });
             }).build())
         .toPact();
   }