Skip to content

Commit af8726b

Browse files
committed
Merge branch 'fix-test' into develop
2 parents a38aa08 + dc9847a commit af8726b

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@
7878
</exclusion>
7979
</exclusions>
8080
</dependency>
81+
<dependency>
82+
<groupId>com.jcabi</groupId>
83+
<artifactId>jcabi-matchers</artifactId>
84+
<version>1.3</version>
85+
<scope>test</scope>
86+
</dependency>
8187
<dependency>
8288
<groupId>io.jenkins</groupId>
8389
<artifactId>configuration-as-code</artifactId>

src/test/java/io/jenkins/plugins/gitlabserverconfig/casc/ConfigurationAsCodeTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import org.junit.ClassRule;
1616
import org.junit.Test;
1717

18+
import static com.jcabi.matchers.RegexMatchers.matchesPattern;
1819
import static io.jenkins.plugins.casc.misc.Util.getUnclassifiedRoot;
1920
import static io.jenkins.plugins.casc.misc.Util.toStringFromYamlFile;
2021
import static io.jenkins.plugins.casc.misc.Util.toYamlString;
@@ -35,7 +36,7 @@ public void should_support_configuration_as_code() {
3536
assertThat(servers.size(), is(1));
3637
GitLabServer server = servers.get(0);
3738
assertThat(server.getServerUrl(), is("https://gitlab.com"));
38-
assertThat(server.getName(), is("gitlab.com"));
39+
assertThat(server.getName(), matchesPattern("gitlab-[0-9]{4}"));
3940
assertThat(server.isManageHooks(), is(true));
4041

4142
List<PersonalAccessTokenImpl> credentials = CredentialsProvider.lookupCredentials(
@@ -58,6 +59,6 @@ public void should_support_configuration_export() throws Exception {
5859

5960
String expected = toStringFromYamlFile(this, "expected_output.yml");
6061

61-
assertThat(exported, is(expected));
62+
assertThat(exported, matchesPattern(expected));
6263
}
6364
}

src/test/resources/io/jenkins/plugins/gitlabserverconfig/casc/configuration-as-code.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,4 @@ unclassified:
1212
servers:
1313
- credentialsId: "i<3GitLab"
1414
manageHooks: true
15-
name: "gitlab.com"
1615
serverUrl: "https://gitlab.com"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
servers:
22
- credentialsId: "i<3GitLab"
33
manageHooks: true
4-
name: "gitlab.com"
4+
name: "gitlab-[0-9]{4}"
55
serverUrl: "https://gitlab.com"

0 commit comments

Comments
 (0)