Use input parameter with mock

@SpringBean
MyClass myClass = Stub {
    method(_) >> {
        Integer id -> map.get(id)
    }
}

-------- or --------

@SpringBean
MyClass myClass = Mock()

given:
myClass.method(_) >> {
        Integer id -> map.get(id)
}

0 Responses to " ":