Mocking object on a Filter in a unit test (Grails)
<p>Given the following setup:</p>

<pre><code>class MockingFilters {
    def filters = {
        all(controller:"simple", action:"list") {
            before = {
                log.info "This needs asserting"
                return false
            }
        }
    }
}
</code></pre>

<p>Is there a way to assert that the <code>log.info</code> has fired? I am unsure how to get a handle on the Filter, and thus be able to interaction test the log object.</p>

<pre><code>void "test list action is filtered"() {
    when:
    withFilters(action:"list") {

        // Important bit
        // Not sure how to get a handle to the filter
        1 * log.info("This needs asserting")


        controller.list()
    }

    then:
        // Whatever here
}
</code></pre>

<p>There are also other objects on the Filter that I would like to test, but this example should be reflective of those too.</p>