Open PavelKa opened 2 years ago
You seem to be overriding the setter for f
with setF
method declaration, so f = "test2"
leads to setF
method invocation which doesn't assign a new value to the field. Doesn't look like an issue with this library.
You seem to be overriding the setter for
f
withsetF
method declaration, sof = "test2"
leads tosetF
method invocation which doesn't assign a new value to the field. Doesn't look like an issue with this library.
Even if I rename setF to echoF then test fails and echoF under test prints test instead of test2, althought skript works well in jenkins.
Hmm, true. Actually, I was wrong and setF
can't be used as a setter because it doesn't even accept a new value as a parameter :)
Doing the assignment directly inside call
(outside of node
and stage
blocks) works, so something weird is going on indeed.
Expected Behavior
The tested script correctly handles fields annotated @Field in all methods
Actual Behavior
Methods access the wrong instance of the field
Steps to Reproduce
define script : vars/testFiled.groovy
define test:
Test fails: Too many invocations for:
1 * getPipelineMock("echo")('test') (2 invocations)
Additional Information
Tested with Java 1.8 and 11 and jenkins-spock.version 2.1.5
Script works as expected in Jenkins