Is there any way to do mock argument capturing in Spock
You can capture an argument as follows: // must be declared before when-block (or inside Specification.interaction {}) def captured when: … then: 1 * mock.doNetworkCall(…) >> { record, recordClass -> // save the argument captured = record … } // use the saved argument captured == … That said, often there is a simpler solution … Read more