Skip to content

Commit

Permalink
Add test for docker agent with Closure param
Browse files Browse the repository at this point in the history
  • Loading branch information
Willem Borgesius authored and Willem Borgesius committed Oct 1, 2020
1 parent dff6f47 commit af51895
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.lesfurets.jenkins.unit.declarative

import org.junit.Before
import org.junit.Test

class TestDockerAgentInStep extends DeclarativePipelineTest {

@Before
@Override
void setUp() throws Exception {
super.setUp()
}

@Test
void test_example() {
runScript("src/test/jenkins/jenkinsfiles/Docker_agentInStep_JenkinsFile")
assertJobStatusSuccess()
}
}
11 changes: 11 additions & 0 deletions src/test/jenkins/jenkinsfiles/Docker_agentInStep_JenkinsFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pipeline {

stages {
stage('Maven Build') {
agent { docker { image 'maven' } }
steps {
sh 'mvn install'
}
}
}
}

0 comments on commit af51895

Please sign in to comment.