-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from jenkinsci/JENKINS-64743
Support JCasC
- Loading branch information
Showing
6 changed files
with
105 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/test/java/io/jenkins/plugins/credentials/gcp/secretsmanager/ConfigurationAsCodeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package io.jenkins.plugins.credentials.gcp.secretsmanager; | ||
|
||
import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat; | ||
|
||
import io.jenkins.plugins.casc.misc.ConfiguredWithCode; | ||
import io.jenkins.plugins.casc.misc.JenkinsConfiguredWithCodeRule; | ||
import io.jenkins.plugins.credentials.gcp.secretsmanager.config.PluginConfiguration; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
|
||
public class ConfigurationAsCodeTest { | ||
|
||
@Rule public JenkinsConfiguredWithCodeRule r = new JenkinsConfiguredWithCodeRule(); | ||
|
||
@Test | ||
@ConfiguredWithCode("configuration-as-code.yml") | ||
public void should_support_configuration_as_code() throws Exception { | ||
PluginConfiguration configuration = | ||
(PluginConfiguration) r.jenkins.getDescriptor(PluginConfiguration.class); | ||
assertThat(configuration.getProject()).isEqualTo("gcp-project"); | ||
assertThat(configuration.getFilter().getLabel()).isEqualTo("my-label"); | ||
assertThat(configuration.getFilter().getValue()).isEqualTo("my-value"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
unclassified: | ||
gcpCredentialsProvider: | ||
filter: | ||
label: "my-label" | ||
value: "my-value" | ||
project: "gcp-project" |