Skip to content

Commit ca165d7

Browse files
authored
Merge branch 'master' into first_field_in_group_as_delimiter
2 parents 3072284 + 9e81970 commit ca165d7

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

quickfixj-core/src/test/java/quickfix/mina/ssl/SSLCertificateTest.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
import org.junit.After;
6464
import quickfix.mina.SocksProxyServer;
6565

66-
import static org.junit.Assert.assertEquals;
6766
import static org.junit.Assert.assertSame;
67+
import static org.junit.Assert.assertTrue;
6868

6969
public class SSLCertificateTest {
7070

@@ -191,7 +191,7 @@ public void shouldAuthenticateServerNameUsingServerCommonName() throws Exception
191191

192192
TestInitiator initiator = new TestInitiator(
193193
createInitiatorSettings("single-session/empty.keystore", "single-session/client-cn.truststore",
194-
CIPHER_SUITES_TLS, "TLSv1.2", "ZULU", "ALFA", Integer.toString(freePort), "JKS", "JKS"));
194+
CIPHER_SUITES_TLS, "TLSv1.2", "ZULU", "ALFA", Integer.toString(freePort), "JKS", "JKS", "HTTPS"));
195195

196196
try {
197197
initiator.start();
@@ -226,7 +226,7 @@ public void shouldAuthenticateServerNameUsingSNIExtension() throws Exception {
226226

227227
TestInitiator initiator = new TestInitiator(
228228
createInitiatorSettings("single-session/empty.keystore", "single-session/client-sni.truststore",
229-
CIPHER_SUITES_TLS, "TLSv1.2", "ZULU", "ALFA", Integer.toString(freePort), "JKS", "JKS"));
229+
CIPHER_SUITES_TLS, "TLSv1.2", "ZULU", "ALFA", Integer.toString(freePort), "JKS", "JKS", "HTTPS"));
230230

231231
try {
232232
initiator.start();
@@ -786,7 +786,7 @@ public void assertSslExceptionThrown() throws Exception {
786786
assertSslExceptionThrown(null, null);
787787
}
788788

789-
public void assertSslExceptionThrown(String errorMessage, Class<?> errorType) throws Exception {
789+
public void assertSslExceptionThrown(String expectedErrorMessage, Class<?> expectedErrorType) throws Exception {
790790
boolean reachedZero = exceptionThrownLatch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS);
791791

792792
if (!reachedZero) {
@@ -795,12 +795,14 @@ public void assertSslExceptionThrown(String errorMessage, Class<?> errorType) th
795795

796796
Throwable throwable = exception.get();
797797

798-
if (errorMessage != null) {
799-
assertEquals(errorMessage, throwable.getMessage());
798+
if (expectedErrorMessage != null) {
799+
String thrownErrorMessage = throwable.getMessage();
800+
assertTrue("Thrown error message: " + thrownErrorMessage + " does not contain: " + expectedErrorMessage,
801+
thrownErrorMessage != null && thrownErrorMessage.contains(expectedErrorMessage));
800802
}
801803

802-
if (errorType != null) {
803-
assertSame(errorType, throwable.getClass());
804+
if (expectedErrorType != null) {
805+
assertSame(expectedErrorType, throwable.getClass());
804806
}
805807
}
806808

0 commit comments

Comments
 (0)