Created
August 12, 2021 22:01
-
-
Save colinbut/32fc3eead375cceb56ef251585483af8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.homeaway.devtools.jenkins.testing.JenkinsPipelineSpecification | |
import com.mycompany.colinbut.Git | |
class BuildJavaAppSpec extends JenkinsPipelineSpecification { | |
def buildJavaApp = null | |
def setup() { | |
buildJavaApp = loadPipelineScriptForTest("vars/buildJavaApp.groovy") | |
} | |
def "Test run BuildJavaApp pipeline"() { | |
setup: | |
def body = Mock(Closure) | |
def git = GroovyMock(Git.class, global: true) | |
new Git(buildJavaApp) >> git | |
when: | |
buildJavaApp repo: "http://github.com/colinbut/examplerepo.git", body | |
then: | |
1 * git.checkout("http://github.com/colinbut/examplerepo.git") | |
1 * getPipelineMock("sh")("./mvnw clean compile") | |
1 * getPipelineMock("sh")("./mvnw test") | |
1 * getPipelineMock("sh")("./mvnw verify") | |
1 * getPipelineMock("sh")("./mvnw package -DskipTests=true") | |
1 * body() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment