|
| 1 | +package hudson.plugins.gradle.injection |
| 2 | + |
| 3 | + |
| 4 | +import hudson.plugins.gradle.AbstractIntegrationTest |
| 5 | +import io.jenkins.plugins.casc.misc.ConfiguredWithCode |
| 6 | +import io.jenkins.plugins.casc.misc.JenkinsConfiguredWithCodeRule |
| 7 | +import org.junit.Rule |
| 8 | +import org.junit.rules.RuleChain |
| 9 | +import spock.lang.Subject |
| 10 | +import spock.lang.Unroll |
| 11 | + |
| 12 | +@Unroll |
| 13 | +@Subject(InjectionConfig.class) |
| 14 | +class InjectionConfigWithCasCTest extends AbstractIntegrationTest { |
| 15 | + @Rule |
| 16 | + public final RuleChain rules = RuleChain.outerRule(noSpaceInTmpDirs).around(new JenkinsConfiguredWithCodeRule()) |
| 17 | + |
| 18 | + @ConfiguredWithCode("injection-config.yml") |
| 19 | + def 'current configuration is readable with JCasC'() { |
| 20 | + expect: |
| 21 | + with(InjectionConfig.get()) { |
| 22 | + it.allowUntrusted == true |
| 23 | + it.ccudExtensionCustomCoordinates == "mycustom-ccud:ext" |
| 24 | + it.ccudExtensionVersion == "2.0.1" |
| 25 | + it.ccudPluginVersion == "2.0.2" |
| 26 | + it.checkForBuildAgentErrors == true |
| 27 | + it.enabled == true |
| 28 | + it.enforceUrl == true |
| 29 | + it.gradleCaptureTaskInputFiles == true |
| 30 | + it.gradleInjectionDisabledNodes*.label == ["non-gradle-node"] |
| 31 | + it.gradleInjectionEnabledNodes*.label == ["gradle-node"] |
| 32 | + it.gradlePluginRepositoryUrl == "https://plugins.gradle.org" |
| 33 | + it.gradlePluginVersion == "3.18.1" |
| 34 | + it.injectMavenExtension == true |
| 35 | + it.injectCcudExtension == true |
| 36 | + it.mavenCaptureGoalInputFiles == true |
| 37 | + it.mavenExtensionCustomCoordinates == "mycustom:ext" |
| 38 | + it.mavenExtensionRepositoryUrl == "https://repo1.maven.org/maven2" |
| 39 | + it.mavenExtensionVersion == "1.22.1" |
| 40 | + it.mavenInjectionDisabledNodes*.label == ["non-maven-node"] |
| 41 | + it.mavenInjectionEnabledNodes*.label == ["maven-node"] |
| 42 | + it.server == "http://localhost:5086" |
| 43 | + it.shortLivedTokenExpiry == 24 |
| 44 | + it.vcsRepositoryFilter == "+:myrepo" |
| 45 | + } |
| 46 | + } |
| 47 | +} |
0 commit comments