import org.springframework.web.client.RestTemplate;
import java.util.Map;
+import java.util.regex.Pattern;
import static org.assertj.core.api.Assertions.fail;
{
object.stringType("name","update");
object.stringType("method", "PUT");
+ object.matchUrl2("href", Matchers.regexp("\\d+", "1234"));
});
});
}).build())
"body": {
"actions": [
{
+ "href": "http://localhost:8080/RegexpMatcher(regex=\\d+, value=1234)",
"method": "PUT",
"name": "update"
}
]
},
+ "generators": {
+ "body": {
+ "$[0].href": {
+ "example": "http://localhost:8080/RegexpMatcher(regex=\\d+, value=1234)",
+ "regex": ".*\\/(\\QRegexpMatcher(regex=\\d+, value=1234)\\E)$",
+ "type": "MockServerURL"
+ }
+ }
+ },
"headers": {
"Content-Type": "application/vnd.siren+json"
},
"variants": [
{
"generators": {
-
+ "$.href": {
+ "example": "http://localhost:8080/RegexpMatcher(regex=\\d+, value=1234)",
+ "regex": ".*\\/(\\QRegexpMatcher(regex=\\d+, value=1234)\\E)$",
+ "type": "MockServerURL"
+ }
},
"index": 0,
"rules": {
+ "$.href": {
+ "combine": "AND",
+ "matchers": [
+ {
+ "match": "regex",
+ "regex": ".*\\/(\\QRegexpMatcher(regex=\\d+, value=1234)\\E)$"
+ }
+ ]
+ },
"$.method": {
"combine": "AND",
"matchers": [