-
Website
http://jlorenzen.blogspot.com -
Original page
http://jlorenzen.blogspot.com/2009/01/testing-rest-services-with-groovy.html -
Subscribe
All Comments -
Community
-
Top Commenters
-
rollinsruss
1 comment · 1 points
-
spasco
1 comment · 1 points
-
seo company
1 comment · 1 points
-
jlorenzen
4 comments · 1 points
-
Royce Fullerton
1 comment · 1 points
-
-
Popular Threads
The cool thing about your approach here is that it is super simple to add in non-happy-path testing too. For example you want to ensure that a PUT to an invalid "id" returns the appropriate error - do so is quick and painless.
Unquotted string 'new Date(1200092400000)'
net.sf.json.JSONException: Unquotted string 'new Date(1200092400000)'
at net.sf.json.util.JSONTokener.nextValue(JSONTokener.java:445)
at net.sf.json.JSONObject._fromJSONTokener(JSONObject.java:1128)
at net.sf.json.JSONObject._fromString(JSONObject.java:1317)
at net.sf.json.JSONObject.fromObject(JSONObject.java:185)
at net.sf.json.JSONSerializer.toJSON(JSONSerializer.java:139)
at net.sf.json.JSONSerializer.toJSON(JSONSerializer.java:103)
at net.sf.json.groovy.JsonSlurper.parseText(JsonSlurper.java:78)
at groovyx.net.http.ParserRegistry.parseJSON(ParserRegistry.java:185)
Here's the json generated by the controller:
{"id":18,"class":"Kandidaat","aanbiedingenPerPost":false,"achternaam":"Willemsen","dossierNummer":"10","etage":"3","huisletter":"a","huisnummer":"12","inschrijfDatum":new Date(1200092400000),"kamerbehoefte":"4","postcode":"1234 ab","reacties":[],"redenAfvoer":null,"soort":"Geindiceerde","straatnaam":"Nieuwe stationsstraat","voorletters":"AB","voorvoegsel":"","woningNetNummer":"10","woonplaats":"Amsterdam"}
Any idea how to fix this?
http://dontmindthelanguage.wordpress.com/2009/0...