File tree Expand file tree Collapse file tree 4 files changed +10
-4
lines changed
java/io/jenkins/plugins/gitlabserverconfig/casc
resources/io/jenkins/plugins/gitlabserverconfig/casc Expand file tree Collapse file tree 4 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 1515import org .junit .ClassRule ;
1616import org .junit .Test ;
1717
18+ import static com .jcabi .matchers .RegexMatchers .matchesPattern ;
1819import static io .jenkins .plugins .casc .misc .Util .getUnclassifiedRoot ;
1920import static io .jenkins .plugins .casc .misc .Util .toStringFromYamlFile ;
2021import 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}
Original file line number Diff line number Diff 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"
Original file line number Diff line number Diff line change 11servers :
22- credentialsId : " i<3GitLab"
33 manageHooks : true
4- name : " gitlab.com "
4+ name : " gitlab-[0-9]{4} "
55 serverUrl : " https://gitlab.com"
You can’t perform that action at this time.
0 commit comments