There is no common exception for the SSL error therefore just check for a client error

This commit is contained in:
Robin Müller 2016-03-25 19:59:39 +01:00
parent c3d94826cf
commit b8ac408446
1 changed files with 2 additions and 1 deletions

View File

@ -20,6 +20,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.core.Response;
import java.io.IOException;
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
@ -71,6 +72,6 @@ public class GitLabConnectionConfigSSLTest {
String apiToken = "secret";
GitLabConnectionConfig connectionConfig = jenkins.get(GitLabConnectionConfig.class);
FormValidation formValidation = connectionConfig.doTestConnection("https://localhost:" + port + "/gitlab", apiToken, false);
assertThat(formValidation.getMessage(), is(Messages.connection_error("peer not authenticated")));
assertThat(formValidation.getMessage(), containsString(Messages.connection_error("")));
}
}