diff --git a/endpoints/citrus-http/src/main/java/org/citrusframework/http/yaml/Http.java b/endpoints/citrus-http/src/main/java/org/citrusframework/http/yaml/Http.java index 418de9bc2f..cdbe416926 100644 --- a/endpoints/citrus-http/src/main/java/org/citrusframework/http/yaml/Http.java +++ b/endpoints/citrus-http/src/main/java/org/citrusframework/http/yaml/Http.java @@ -273,7 +273,7 @@ protected ReceiveMessageAction doBuild() { receive.setTimeout(request.timeout); } - request.getValidates().forEach(receive.getValidate()::add); + request.getValidate().forEach(receive.getValidate()::add); if (request.extract != null) { receive.setExtract(request.extract); @@ -503,7 +503,7 @@ public static class ServerRequest { protected Receive.Selector selector; - protected List validates; + protected List validate; protected Message.Extract extract; @@ -627,12 +627,16 @@ public void setSelector(Receive.Selector selector) { this.selector = selector; } - public List getValidates() { - if (validates == null) { - validates = new ArrayList<>(); + public List getValidate() { + if (validate == null) { + validate = new ArrayList<>(); } - return validates; + return validate; + } + + public void setValidate(List validate) { + this.validate = validate; } public Message.Extract getExtract() { @@ -754,6 +758,10 @@ public List getValidate() { return validate; } + public void setValidate(List validate) { + this.validate = validate; + } + public Message.Extract getExtract() { return extract; } diff --git a/endpoints/citrus-http/src/test/resources/org/citrusframework/http/yaml/http-client-test.yaml b/endpoints/citrus-http/src/test/resources/org/citrusframework/http/yaml/http-client-test.yaml index 348542410f..c36c54a909 100644 --- a/endpoints/citrus-http/src/test/resources/org/citrusframework/http/yaml/http-client-test.yaml +++ b/endpoints/citrus-http/src/test/resources/org/citrusframework/http/yaml/http-client-test.yaml @@ -41,6 +41,10 @@ actions: body: data: | ${id}foo + validate: + - xpath: + - expression: //order/item + value: foo extract: body: - variable: "orderId" diff --git a/endpoints/citrus-http/src/test/resources/org/citrusframework/http/yaml/http-server-test.yaml b/endpoints/citrus-http/src/test/resources/org/citrusframework/http/yaml/http-server-test.yaml index 1636c21375..7f8b012ab4 100644 --- a/endpoints/citrus-http/src/test/resources/org/citrusframework/http/yaml/http-server-test.yaml +++ b/endpoints/citrus-http/src/test/resources/org/citrusframework/http/yaml/http-server-test.yaml @@ -50,6 +50,10 @@ actions: body: data: | 1001new_user + validate: + - xpath: + - expression: //user/name + value: new_user extract: body: - variable: "userId"