diff --git a/test/groovy/ArtifactSetVersionTest.groovy b/test/groovy/ArtifactSetVersionTest.groovy index 139a3d90e..8748a7035 100644 --- a/test/groovy/ArtifactSetVersionTest.groovy +++ b/test/groovy/ArtifactSetVersionTest.groovy @@ -51,7 +51,7 @@ class ArtifactSetVersionTest extends BasePiperTest { private JenkinsShellCallRule shellRule = new JenkinsShellCallRule(this) private JenkinsWriteFileRule jwfr = new JenkinsWriteFileRule(this) private JenkinsStepRule stepRule = new JenkinsStepRule(this) - private JenkinsEnvironmentRule jer = new JenkinsEnvironmentRule(this) + private JenkinsEnvironmentRule environmentRule = new JenkinsEnvironmentRule(this) @Rule public RuleChain ruleChain = Rules @@ -64,7 +64,7 @@ class ArtifactSetVersionTest extends BasePiperTest { .around(jwfr) .around(dockerExecuteRule) .around(stepRule) - .around(jer) + .around(environmentRule) @Before void init() throws Throwable { @@ -88,8 +88,8 @@ class ArtifactSetVersionTest extends BasePiperTest { void testVersioning() { stepRule.step.artifactSetVersion(script: stepRule.step, juStabGitUtils: gitUtils, buildTool: 'maven', gitSshUrl: 'myGitSshUrl') - assertEquals('1.2.3-20180101010203_testCommitId', jer.env.getArtifactVersion()) - assertEquals('testCommitId', jer.env.getGitCommitId()) + assertEquals('1.2.3-20180101010203_testCommitId', environmentRule.env.getArtifactVersion()) + assertEquals('testCommitId', environmentRule.env.getGitCommitId()) assertThat(shellRule.shell, hasItem("mvn --file 'pom.xml' --batch-mode -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn versions:set -DnewVersion=1.2.3-20180101010203_testCommitId -DgenerateBackupPoms=false")) assertThat(shellRule.shell.join(), stringContainsInOrder([ @@ -105,7 +105,7 @@ class ArtifactSetVersionTest extends BasePiperTest { void testVersioningWithoutCommit() { stepRule.step.artifactSetVersion(script: stepRule.step, juStabGitUtils: gitUtils, buildTool: 'maven', commitVersion: false) - assertEquals('1.2.3-20180101010203_testCommitId', jer.env.getArtifactVersion()) + assertEquals('1.2.3-20180101010203_testCommitId', environmentRule.env.getArtifactVersion()) assertThat(shellRule.shell, hasItem("mvn --file 'pom.xml' --batch-mode -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn versions:set -DnewVersion=1.2.3-20180101010203_testCommitId -DgenerateBackupPoms=false")) assertThat(shellRule.shell, not(hasItem(containsString('commit')))) } @@ -120,7 +120,7 @@ class ArtifactSetVersionTest extends BasePiperTest { @Test void testVersioningWithTimestamp() { stepRule.step.artifactSetVersion(script: stepRule.step, juStabGitUtils: gitUtils, buildTool: 'maven', timestamp: '2018') - assertEquals('1.2.3-2018_testCommitId', jer.env.getArtifactVersion()) + assertEquals('1.2.3-2018_testCommitId', environmentRule.env.getArtifactVersion()) } @Test @@ -133,15 +133,15 @@ class ArtifactSetVersionTest extends BasePiperTest { @Test void testVersioningWithCustomTemplate() { stepRule.step.artifactSetVersion(script: stepRule.step, juStabGitUtils: gitUtils, buildTool: 'maven', versioningTemplate: '${version}-xyz') - assertEquals('1.2.3-xyz', jer.env.getArtifactVersion()) + assertEquals('1.2.3-xyz', environmentRule.env.getArtifactVersion()) } @Test void testVersioningWithTypeAppContainer() { nullScript.commonPipelineEnvironment.setAppContainerProperty('gitSshUrl', 'git@test.url') - jer.env.setArtifactVersion('1.2.3-xyz') + environmentRule.env.setArtifactVersion('1.2.3-xyz') stepRule.step.artifactSetVersion(script: stepRule.step, juStabGitUtils: gitUtils, buildTool: 'docker', artifactType: 'appContainer', dockerVersionSource: 'appVersion') - assertEquals('1.2.3-xyz', jer.env.getArtifactVersion()) + assertEquals('1.2.3-xyz', environmentRule.env.getArtifactVersion()) assertEquals('1.2.3-xyz', jwfr.files['VERSION']) } diff --git a/test/groovy/CloudFoundryDeployTest.groovy b/test/groovy/CloudFoundryDeployTest.groovy index cbb3db108..735fa7f92 100644 --- a/test/groovy/CloudFoundryDeployTest.groovy +++ b/test/groovy/CloudFoundryDeployTest.groovy @@ -33,7 +33,7 @@ class CloudFoundryDeployTest extends BasePiperTest { private JenkinsWriteFileRule jwfr = new JenkinsWriteFileRule(this) private JenkinsDockerExecuteRule jedr = new JenkinsDockerExecuteRule(this) private JenkinsStepRule stepRule = new JenkinsStepRule(this) - private JenkinsEnvironmentRule jer = new JenkinsEnvironmentRule(this) + private JenkinsEnvironmentRule environmentRule = new JenkinsEnvironmentRule(this) private JenkinsReadYamlRule readYamlRule = new JenkinsReadYamlRule(this) private writeInfluxMap = [:] @@ -53,7 +53,7 @@ class CloudFoundryDeployTest extends BasePiperTest { .around(shellRule) .around(jwfr) .around(jedr) - .around(jer) + .around(environmentRule) .around(new JenkinsCredentialsRule(this).withCredentials('test_cfCredentialsId', 'test_cf', '********')) .around(stepRule) // needs to be activated after jedr, otherwise executeDocker is not mocked diff --git a/test/groovy/GaugeExecuteTestsTest.groovy b/test/groovy/GaugeExecuteTestsTest.groovy index 4fed21c9b..f369f37e5 100644 --- a/test/groovy/GaugeExecuteTestsTest.groovy +++ b/test/groovy/GaugeExecuteTestsTest.groovy @@ -13,7 +13,7 @@ class GaugeExecuteTestsTest extends BasePiperTest { private JenkinsStepRule stepRule = new JenkinsStepRule(this) private JenkinsLoggingRule loggingRule = new JenkinsLoggingRule(this) private JenkinsShellCallRule shellRule = new JenkinsShellCallRule(this) - private JenkinsEnvironmentRule jer = new JenkinsEnvironmentRule(this) + private JenkinsEnvironmentRule environmentRule = new JenkinsEnvironmentRule(this) private ExpectedException thrown = ExpectedException.none() @Rule @@ -22,7 +22,7 @@ class GaugeExecuteTestsTest extends BasePiperTest { .around(new JenkinsReadYamlRule(this)) .around(shellRule) .around(loggingRule) - .around(jer) + .around(environmentRule) .around(stepRule) .around(thrown) diff --git a/test/groovy/KarmaExecuteTestsTest.groovy b/test/groovy/KarmaExecuteTestsTest.groovy index d49598f0c..fcce88c4a 100644 --- a/test/groovy/KarmaExecuteTestsTest.groovy +++ b/test/groovy/KarmaExecuteTestsTest.groovy @@ -13,7 +13,7 @@ class KarmaExecuteTestsTest extends BasePiperTest { private JenkinsStepRule stepRule = new JenkinsStepRule(this) private JenkinsLoggingRule loggingRule = new JenkinsLoggingRule(this) private JenkinsShellCallRule shellRule = new JenkinsShellCallRule(this) - private JenkinsEnvironmentRule jer = new JenkinsEnvironmentRule(this) + private JenkinsEnvironmentRule environmentRule = new JenkinsEnvironmentRule(this) private ExpectedException thrown = ExpectedException.none() @Rule @@ -22,7 +22,7 @@ class KarmaExecuteTestsTest extends BasePiperTest { .around(new JenkinsReadYamlRule(this)) .around(shellRule) .around(loggingRule) - .around(jer) + .around(environmentRule) .around(stepRule) .around(thrown) diff --git a/test/groovy/PipelineRestartStepsTest.groovy b/test/groovy/PipelineRestartStepsTest.groovy index f9acb9a7a..6d4c471fc 100644 --- a/test/groovy/PipelineRestartStepsTest.groovy +++ b/test/groovy/PipelineRestartStepsTest.groovy @@ -11,14 +11,14 @@ import static org.junit.Assert.assertThat class PipelineRestartStepsTest extends BasePiperTest { - private JenkinsErrorRule jer = new JenkinsErrorRule(this) + private JenkinsErrorRule errorRule = new JenkinsErrorRule(this) private JenkinsLoggingRule loggingRule = new JenkinsLoggingRule(this) private JenkinsStepRule stepRule = new JenkinsStepRule(this) @Rule public RuleChain chain = Rules.getCommonRules(this) .around(new JenkinsReadYamlRule(this)) - .around(jer) + .around(errorRule) .around(loggingRule) .around(stepRule)