Skip to main content
The 2026 Annual Developer Survey is live— take the Survey today!

Question list filters

Filter by
Sorted by
Tagged with
Filter by Employee ID
Score of 1
1 answer
188 views

I use Spock to test Java-code. For example, I have the following Java-class: public class Github implements RemoteRepository { @Override public Boolean isBranchExist(String branch) { ...
Score of 0
1 answer
136 views

I'm currently writing tests using RestAssuredMockMvc together with Spring REST Docs. Setup In my global spec setup, I configure the headers like this: package com.animore.config import com.fasterxml....
Score of 2
1 answer
58 views

Due to some special need, I'd like to have test written in Spock be automatically logged in each sub-section. For example class FooSpecification extends MyBaseSpecification { def "A test"()...
Score of 0
0 answers
93 views

I have many Spock specifications like the next one, that act as "unit tests" for the resource classes of a project. This is an Open Liberty application and now there's a need to migrate it ...
Score of 1
1 answer
65 views

We have a large Spock test suite, across mulitple teams, each teams tests have an annotation on them such as @Team5. I would like to append - @Team5 dynamically to the end of each test methods name ...
Score of 2
1 answer
65 views

I have a mocked object userService = Mock() and a mocked interaction userService.test("test") >> "result" How can I define this interaction in another class/method ? Maybe &...
Score of 0
1 answer
60 views

I want to mock with Spock a method getEntity for the Spring ResTemplate Product getProducts(ProductSearch request) { Map<String, Object> queryParam = new HashMap<>(); queryParam.put(&...
Score of -1
1 answer
128 views

I have a problem with mocking in the spock, my variabla systemTaskOptional is null, test throwing an error. Here is my code of test, and part of code with biznes logic, where is null throwing. def ...
Score of 1
1 answer
436 views

I use Spock to test my java code,in detail to test method is MnsTemplate's sendMessage Method and unit test is in MnsTemplateTest, they are in below code. In this unit test, I mock MNSClient、...
Score of 2
1 answer
34 views

I'm getting this error in a Spock test after adding a new association to one of the domain objects that this service uses. I haven't found any Grails-related or GORM-related questions referencing this ...
Score of 0
1 answer
87 views

I am testing a Java method that uses Spring Boot WebClient to make a PUT request and returns void. The test is written in Groovy. This is the method I want to test: public void putProcessing(final ...
Score of 0
1 answer
53 views

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() ...
Score of 1
1 answer
98 views

I have following easy file random.groovy in "vars" folder and Im trying to test with groovy 2.4 and spock testframework 1.3-groovy-2.4. The file is basically about generating random ...
Score of 0
1 answer
223 views

I am setting up tests using Groovy and the Spock framework. My tests depend on the passage of time, and the services in question use new Date() for some rules. Because of this, I would like to modify ...
Score of 0
1 answer
74 views

I'm encountering an issue when making an HTTP request in the cleanupSpec() function of a Spock test. The same HTTP GET request works perfectly in both the test case and the cleanup() function, but ...

15 30 50 per page
1
2 3 4 5
161