From 84d5cfcfe4e725e31b080389073f68db2a529fe2 Mon Sep 17 00:00:00 2001 From: Ezbon Jacob Date: Wed, 23 Sep 2020 19:40:22 -0400 Subject: [PATCH] removed unused function & duplicate test --- ...arameterStoreBuildWrapperPluginTest.groovy | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/test/ParameterStoreBuildWrapperPluginTest.groovy b/test/ParameterStoreBuildWrapperPluginTest.groovy index 51758a37..82830207 100644 --- a/test/ParameterStoreBuildWrapperPluginTest.groovy +++ b/test/ParameterStoreBuildWrapperPluginTest.groovy @@ -46,18 +46,9 @@ class ParameterStoreBuildWrapperPluginTest { public class Apply { @After public void reset() { - Jenkinsfile.instance = null ParameterStoreBuildWrapperPlugin.reset() } - private configureJenkins(Map config = [:]) { - Jenkinsfile.instance = mock(Jenkinsfile.class) - when(Jenkinsfile.instance.getStandardizedRepoSlug()).thenReturn(config.repoSlug) - when(Jenkinsfile.instance.getRepoName()).thenReturn(config.repoName ?: 'repo') - when(Jenkinsfile.instance.getOrganization()).thenReturn(config.organization ?: 'org') - when(Jenkinsfile.instance.getEnv()).thenReturn(config.env ?: [:]) - } - class WithTerraformValidateStage { @Test void doesNotDecorateTheTerraformValidateStageIfGlobalParametersNotSet() { @@ -147,32 +138,9 @@ class ParameterStoreBuildWrapperPluginTest { class GetParameterOptions { @After public void reset() { - Jenkinsfile.instance = null ParameterStoreBuildWrapperPlugin.reset() } - private configureJenkins(Map config = [:]) { - Jenkinsfile.instance = mock(Jenkinsfile.class) - when(Jenkinsfile.instance.getStandardizedRepoSlug()).thenReturn(config.repoSlug) - when(Jenkinsfile.instance.getRepoName()).thenReturn(config.repoName ?: 'repo') - when(Jenkinsfile.instance.getOrganization()).thenReturn(config.organization ?: 'org') - when(Jenkinsfile.instance.getEnv()).thenReturn(config.env ?: [:]) - } - - @Test - void returnsNoOptionsWhenNotSet() { - String environment = "MyEnv" - Map option = [:] - List expected = [ option ] - ParameterStoreBuildWrapperPlugin plugin = spy(new ParameterStoreBuildWrapperPlugin()) - - doReturn(option).when(plugin).getEnvironmentParameterOptions(environment) - - List actual = plugin.getParameterOptions(environment) - - assertEquals(expected, actual) - } - @Test void returnsEnvironmentOptionWhenSet() { String environment = "MyEnv"