Search in sources :

Example 6 with Envs

use of io.jenkins.plugins.casc.misc.Envs in project configuration-as-code-plugin by jenkinsci.

the class TokenReloadActionTest method reloadReturnsOkWhenCalledWithValidTokenSetByEnvVar.

@Test
@Envs({ @Env(name = "CASC_RELOAD_TOKEN", value = "someSecretValue") })
public void reloadReturnsOkWhenCalledWithValidTokenSetByEnvVar() throws IOException {
    tokenReloadAction.doIndex(newRequest("someSecretValue"), new ResponseImpl(null, response));
    assertConfigReloaded();
}
Also used : ResponseImpl(org.kohsuke.stapler.ResponseImpl) Test(org.junit.Test) Envs(io.jenkins.plugins.casc.misc.Envs)

Aggregations

Envs (io.jenkins.plugins.casc.misc.Envs)6 Test (org.junit.Test)6 ResponseImpl (org.kohsuke.stapler.ResponseImpl)3 StandardUsernamePasswordCredentials (com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials)2 ConfiguredWithReadme (io.jenkins.plugins.casc.misc.ConfiguredWithReadme)2 AWSCredentialsImpl (com.cloudbees.jenkins.plugins.awscredentials.AWSCredentialsImpl)1 BasicSSHUserPrivateKey (com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey)1 Credentials (com.cloudbees.plugins.credentials.Credentials)1 SecretBytes (com.cloudbees.plugins.credentials.SecretBytes)1 UsernamePasswordCredentials (com.cloudbees.plugins.credentials.common.UsernamePasswordCredentials)1 CertificateCredentialsImpl (com.cloudbees.plugins.credentials.impl.CertificateCredentialsImpl)1 UploadedKeyStoreSource (com.cloudbees.plugins.credentials.impl.CertificateCredentialsImpl.UploadedKeyStoreSource)1 FreeStyleBuild (hudson.model.FreeStyleBuild)1 FreeStyleProject (hudson.model.FreeStyleProject)1 ConfiguredWithCode (io.jenkins.plugins.casc.misc.ConfiguredWithCode)1 GlobalJobDslSecurityConfiguration (javaposse.jobdsl.plugin.GlobalJobDslSecurityConfiguration)1 Jenkins (jenkins.model.Jenkins)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1 FileCredentials (org.jenkinsci.plugins.plaincredentials.FileCredentials)1 StringCredentials (org.jenkinsci.plugins.plaincredentials.StringCredentials)1