diff --git a/spring-boot-dependencies/pom.xml b/spring-boot-dependencies/pom.xml index 9f2c5fbfadd..8a19468f1cd 100644 --- a/spring-boot-dependencies/pom.xml +++ b/spring-boot-dependencies/pom.xml @@ -89,7 +89,7 @@ 1.2.17 1.1.2 1.9.5 - 2.12.3 + 2.12.4 5.1.34 1.1.5.RELEASE 1.1.3.RELEASE diff --git a/spring-boot-samples/spring-boot-sample-data-mongodb/src/test/java/sample/data/mongo/SampleMongoApplicationTests.java b/spring-boot-samples/spring-boot-sample-data-mongodb/src/test/java/sample/data/mongo/SampleMongoApplicationTests.java index d349ae3d382..a548beeecce 100644 --- a/spring-boot-samples/spring-boot-sample-data-mongodb/src/test/java/sample/data/mongo/SampleMongoApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-data-mongodb/src/test/java/sample/data/mongo/SampleMongoApplicationTests.java @@ -16,6 +16,8 @@ package sample.data.mongo; +import java.util.regex.Pattern; + import org.junit.Rule; import org.junit.Test; import org.springframework.boot.test.OutputCapture; @@ -33,6 +35,9 @@ import static org.junit.Assert.assertTrue; */ public class SampleMongoApplicationTests { + private static final Pattern TIMEOUT_MESSAGE_PATTERN = Pattern + .compile("Timed out after [0-9]+ ms while waiting for a server.*"); + @Rule public OutputCapture outputCapture = new OutputCapture(); @@ -61,7 +66,7 @@ public class SampleMongoApplicationTests { if (root.getMessage().contains("Unable to connect to any server")) { return true; } - if (root.getMessage().contains("Timed out while waiting for a server")) { + if (TIMEOUT_MESSAGE_PATTERN.matcher(root.getMessage()).matches()) { return true; } }