Stanislav Ovchar
Stanislav Ovchar
Duplicates #51 #142 #141
@msabastian You can try to use `groovy.mock.interceptor.MockFor` see https://www.groovy-lang.org/testing.html#_mocking_and_stubbing ``` //Jenkinsfile def job_cfg = new URL("https://jenkins.example.com/job/test/api?json").getText() echo job_cfg ``` ``` //TestCase import groovy.mock.interceptor.MockFor import com.lesfurets.jenkins.unit.BasePipelineTest import org.junit.Before import org.junit.Test class...
See also #141.
Hey, you forgot some lines in the pipeline ``` @Library('le_library') import package.path.Util ``` Take a look on this one https://github.com/headcrabmeat/pipeline-sharedlib-testharness
Hi, I read it again =). I think that you missed a reference to pipeline object in your `getBuildProperties()` That it is why the mock works with the pipeline but...
@timbrown5, You can try `this` instead of `helper` ```groovy def exampleClass = new ExampleClass(this) ``` But I'm not sure if it will work. If you're testing a shared library please...
@timbrown5, could you please also share your `build.gradle`
@timbrown5, cool, this is a great starting point to a create wiki.
hi, @jgsogo I don't use "regression" feature, so i'm not sure how to help, however your workaround looks good to me. If you would like to submit a PR I'll...
I belive the issue is with this line ``` def library = ... ... .retriever(ThisRepository.thisProject()) ``` Please use whether `localSources` retriver https://github.com/jenkinsci/JenkinsPipelineUnit/blob/912fb118a1cd27feb59d7e12feee40888f7c1006/src/test/groovy/com/lesfurets/jenkins/TestSharedLibraryWithLocalSourceRetriever.groovy#L67 or `projectSource` retriver https://github.com/jenkinsci/JenkinsPipelineUnit/blob/912fb118a1cd27feb59d7e12feee40888f7c1006/src/test/groovy/com/lesfurets/jenkins/TestSharedLibraryWithProjectSourceRetriever.groovy#L70 Please reopen if you...