Grails 1.3.3: controller.redirectArgs.action not populated

Posted by Matthias Hryniszak on Stack Overflow See other posts from Stack Overflow or by Matthias Hryniszak
Published on 2010-07-28T11:47:14Z Indexed on 2010/12/30 10:54 UTC
Read the original article Hit count: 220

Does anyone knows what happened to controller.redirectArgs.action in the latest version of Grails (1.3.3)? It used to work properly but now I get NPE when I use it.

class FooController {
    def someRedirect = {
        redirect(action:"bar")
    }
}

class FooControllerTests extends grails.test.ControllerUnitTestCase {
    void testSomeRedirect() {
        controller.someRedirect()
        assertEquals "bar", controller.redirectArgs.action
    }
}

In this case controller.redirectArgs is already null...

© Stack Overflow or respective owner

Related posts about unit-testing

Related posts about grails