My problem was to figure out what signature the method node had. This was
caused by the fact, that I did not know, that node("<name>") {} is the
same as node("<name>", {}).
So for anyone wondering how to mock the closure methods, this is the way.
@kuperadrian
maybe you could include this in your article to help anyone who is in need of mocking a closure :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thank you for the reply.
Yes I'm using the Scripted Pipeline, but I use my SL to do some things on nodes. Anyway, I figured it out just now.
The following is my current code to mock
node("<name>") {}
:My problem was to figure out what signature the method node had. This was
caused by the fact, that I did not know, that
node("<name>") {}
is thesame as
node("<name>", {})
.So for anyone wondering how to mock the closure methods, this is the way.
@kuperadrian maybe you could include this in your article to help anyone who is in need of mocking a closure :)