Posted By

iure on 08/24/10


Tagged

test grails rest


Versions (?)

Test Rest Grails Controllers


 / Published in: Groovy
 

URL: http://blogs.infosupport.com/blogs/paul_bakker/archive/2009/08/20/testing-grails-rest-services.aspx

  1. void testListInXML() {
  2. controller.request.format = 'xml'
  3.  
  4. controller.list()
  5.  
  6. def contact = new XmlParser().parseText(controller.response.getContentAsString())
  7. assert contact.firstname.text() == 'Paul'
  8. assert contact.lastname.text() == 'Bakker'
  9.  
  10. }

Report this snippet  

You need to login to post a comment.