JenkinsPipelineUnit
JenkinsPipelineUnit copied to clipboard
MissingMethodException calling other groovy file as method
From a.groovy i try to call b.grooy as b("firstVar","secondVar")
import helper.SomeClass
def call(String firstVar, String secondVar) {
}
This syntax works in actual jenkins pipeline and is documented on https://www.jenkins.io/doc/book/pipeline/shared-libraries/#defining-custom-steps
In this case it throws an exception: groovy.lang.MissingMethodException: No signature of method: a.b() is applicable for argument types: ( java.lang.String, java.lang.String) values: [firstVar, secondVar]
(I modified the names and classes)
The actual @Library is in the script in the jenkins job. From there it calls a().
I could workaround by loading the script and adding an allowed method, but id like to see this work without