Hi,
I guess that configMap takes only config attributes, not the children.
Try this as first step of your test:
groovy("step.context.webClient.throwExceptionOnFailingStatusCode = false")
Cheers,
Marc.
--
Blog: http://mguillem.wordpress.com
Niko Schmuck wrote:
> When trying to test for a specific HTTP error response code with webtest
> from my grails app, I was hoping to be able to transfer the webtest
> ResponseCode extenstion step together with the necessary configuration
>
> <config ...>
> <option name="ThrowExceptionOnFailingStatusCode" value="false"/>
> </config>
>
> ... to something in my Groovy Webtest class like:
>
> def testUnknownUser() {
> configMap["ThrowExceptionOnFailingStatusCode"] = false
> webtest('REST API: try to retrieve a non-existant user ...') {
> // enable that the HTTP response code 404 does not lead to
> the end of this test
> invoke (method:'GET', url:"api/users/9999",
> username:username, password:password)
> storeResponseCode(description:"store response code",
> property:"status")
> verifyProperty(description:"should be error", name:"status",
> text:"404")
> }
> }
>
> But this fails with:
>
> [java] Caught: The <config> type doesn't support the
> "throwexceptiononfailingstatuscode" attribute.
> [java] at grails.util.WebTest.webtest(WebTest.groovy:17)
> [java] at UserRESTTest.testUnknownUser(UserRESTTest.groovy:74)
> [java] at UserRESTTest.suite(UserRESTTest.groovy:31)
> [java] at TestSuite.suite(TestSuite.groovy:42)
> [java] at grails.util.WebTest.runTests(WebTest.groovy:36)
> [java] at TestSuite.main(TestSuite.groovy:28)
>
> How has the configuration to look for accept error situations?
>
> TIA,
> Niko
> _______________________________________________
> WebTest mailing list
> [email protected]
> http://lists.canoo.com/mailman/listinfo/webtest
>
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest