breaux
12 years agoContributor
Hierarchical "bean" property names in mock response?
Is there any way to use the ${variable} notation to put a single object on the context and reference individual sub-elements from it?
For instance, if I want my mock response to wrap back several request fields, I'd like to do something like
Then reference ${payload.name}, ${payload.city}, etc.
Instead, it seems like right now I'd have to explicitly put both name and city directly on the context.
For instance, if I want my mock response to wrap back several request fields, I'd like to do something like
def req = new XmlSlurper().parseText(mockRequest.requestContent)
context.payload = req.Body.SendRequest.payload
Then reference ${payload.name}, ${payload.city}, etc.
Instead, it seems like right now I'd have to explicitly put both name and city directly on the context.