Refactor response generation and xmls

This commit is contained in:
Dominik Adam Przybysz 2014-12-13 21:49:24 +01:00
parent ba63d36fa0
commit 0bfa0d91b4
8 changed files with 50 additions and 36 deletions

View file

@ -29,10 +29,10 @@ class ServerMockPT extends Specification {
int port = 9000 + (current % 7)
controlServerClient.addMock(new AddMockRequestData(
name: "testRest$current",
path: "/testEndpoint$endpointNumber",
path: "testEndpoint$endpointNumber",
port: port,
predicate: """{xml -> xml.name() == 'request$current'}""",
response: """{xml -> "<goodResponse$current/>"}"""
predicate: """{req -> req.xml.name() == 'request$current'}""",
response: """{req -> "<goodResponse$current/>"}"""
))
HttpPost restPost = new HttpPost("http://localhost:$port/testEndpoint$endpointNumber")
restPost.entity = new StringEntity("<request$current/>", ContentType.create("text/xml", "UTF-8"))