Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-51469] Add Essentials configuration to CasC tests
  • Loading branch information
batmat authored and ndeloof committed May 23, 2018
1 parent 250ab6f commit 13690d7
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pom.xml
Expand Up @@ -286,6 +286,14 @@
<version>3.0.0</version>
</dependency>

<!-- Used by Essentials -->
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>metrics</artifactId>
<version>3.1.2.12</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
Expand Down
21 changes: 21 additions & 0 deletions src/test/java/org/jenkinsci/plugins/casc/EssentialsTest.java
@@ -0,0 +1,21 @@
package org.jenkinsci.plugins.casc;

import jenkins.model.Jenkins;
import org.jenkinsci.plugins.casc.misc.ConfiguredWithCode;
import org.jenkinsci.plugins.casc.misc.JenkinsConfiguredWithCodeRule;
import org.junit.Rule;
import org.junit.Test;

import static org.junit.Assert.assertEquals;

public class EssentialsTest {
@Rule
public JenkinsConfiguredWithCodeRule j = new JenkinsConfiguredWithCodeRule();

@Test
@ConfiguredWithCode("EssentialsTest.yml")
public void essentialsTest() throws Exception {
final Jenkins jenkins = Jenkins.getInstance();
assertEquals("Welcome to Jenkins Essentials!", jenkins.getSystemMessage());
}
}
13 changes: 13 additions & 0 deletions src/test/resources/org/jenkinsci/plugins/casc/EssentialsTest.yml
@@ -0,0 +1,13 @@
---
jenkins:
systemMessage: "Welcome to Jenkins Essentials!"
numExecutors: 0
metricsaccesskey:
accessKeys:
- key: "evergreen"
description: "Key for evergreen health-check"
canHealthCheck: true
canPing: false
canThreadDump: false
canMetrics: false
origins: "*"

0 comments on commit 13690d7

Please sign in to comment.