How to use database methods in grails spock specification tests?
I am going to test some classes test using specification test with spock
.
Some methods uses Domain.list()
and it not available via light specification test.
Of course I could replace Domain.list()
with mock grobal replace.
But it disables other Domain static methods. How to change only one static domain method and stay others?
How to mock HttpClient using Spock-framework
The following method is providing instances of java.net.http.HttpClient:
Spock Mock not updating the fields
Suppose we have a class that we want to mock.