1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00

Merge branch 'master' into pr/removeMergeMethodFromConfigMerger

This commit is contained in:
Christopher Fenner 2018-09-10 15:02:58 +02:00 committed by GitHub
commit bb98ba71f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,9 +1,13 @@
#!groovy #!groovy
import org.junit.Before import org.junit.Before
import org.junit.Rule import org.junit.Rule
import org.junit.Test import org.junit.Test
import org.junit.rules.ExpectedException import org.junit.rules.ExpectedException
import org.junit.rules.RuleChain import org.junit.rules.RuleChain
import com.sap.piper.GitUtils
import util.BasePiperTest import util.BasePiperTest
import util.JenkinsDockerExecuteRule import util.JenkinsDockerExecuteRule
import util.JenkinsEnvironmentRule import util.JenkinsEnvironmentRule
@ -26,6 +30,16 @@ import static org.junit.Assert.assertEquals
class ArtifactSetVersionTest extends BasePiperTest { class ArtifactSetVersionTest extends BasePiperTest {
Map dockerParameters Map dockerParameters
def GitUtils gitUtils = new GitUtils() {
boolean insideWorkTree() {
return true
}
String getGitCommitIdOrNull() {
return 'testCommitId'
}
}
def sshAgentList = [] def sshAgentList = []
private ExpectedException thrown = ExpectedException.none() private ExpectedException thrown = ExpectedException.none()
@ -61,10 +75,8 @@ class ArtifactSetVersionTest extends BasePiperTest {
return closure() return closure()
}) })
jscr.setReturnValue('git rev-parse HEAD', 'testCommitId')
jscr.setReturnValue("date --universal +'%Y%m%d%H%M%S'", '20180101010203') jscr.setReturnValue("date --universal +'%Y%m%d%H%M%S'", '20180101010203')
jscr.setReturnValue('git diff --quiet HEAD', 0) jscr.setReturnValue('git diff --quiet HEAD', 0)
jscr.setReturnValue('git rev-parse --is-inside-work-tree 1>/dev/null 2>&1', 0)
helper.registerAllowedMethod('fileExists', [String.class], {true}) helper.registerAllowedMethod('fileExists', [String.class], {true})
} }