Skip to content

Commit 9ab54f9

Browse files
authored
Fixing issue with invalid certificate test (#1834)
* Empty commit to show the issue in CI * Adds exception message prefix in test * Comply with spotless * Fixing string detection for java 17 up to 25
1 parent f0a8d2d commit 9ab54f9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/test/java/com/dabsquared/gitlabjenkins/connection/GitLabConnectionConfigSSLTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package com.dabsquared.gitlabjenkins.connection;
22

3+
import static org.hamcrest.CoreMatchers.allOf;
34
import static org.hamcrest.CoreMatchers.containsString;
5+
import static org.hamcrest.CoreMatchers.startsWith;
46
import static org.hamcrest.MatcherAssert.assertThat;
57

68
import com.cloudbees.plugins.credentials.CredentialsProvider;
@@ -164,6 +166,8 @@ void doCheckConnection_certificateError() {
164166

165167
FormValidation formValidation =
166168
descriptor.doTestConnection("https://localhost:" + port + "/gitlab", API_TOKEN_ID, "v3", false, 10, 10);
167-
assertThat(formValidation.getMessage(), containsString(Messages.connection_error("PKIX path building failed")));
169+
assertThat(
170+
formValidation.getMessage(),
171+
allOf(startsWith(Messages.connection_error("")), containsString("PKIX path building failed")));
168172
}
169173
}

0 commit comments

Comments
 (0)