In Spock, how can I test for withTransaction
block?
For example, during the test for the code below, how can I make sure that the code inside MyLookup.withTransaction
gets executed?
then:
1 * MyLookup.findValue(item)
And here is service class:
class itemService {
static String lookUpInfo(String item){
MyLookup.withTransaction {
valInfo = MyLookup.findValue(item)
}
return valInfo
}
}