Forum Discussion
tomlee2
11 years agoNew Contributor
Depends....what is your response type? Is it just one attribute or an array?
Single attribute is easy by using the assert command.
assuming your db.V1Project.findOne is working and also returns the same type as your response with single attribute
def response = context.expand( '${GET 1 Project#Response#$.PROJECT.UUID}' )
def tmp_uuid = db.V1Project.findOne('content.PROJECT.UUID': response)
assert response == tmp_uuid
However, if your response is complex type such as a json array... you many need to look into a json sluper to find the attribute that you want to check.
Good luck.