Browse Source

Upgrade to Mongo Java Driver 2.12.4

The exception message for a connection timeout has been updated to
include the timeout period. The tests for the sample have been updated
accordingly.

Closes gh-1884
pull/2035/head
Andy Wilkinson 11 years ago
parent
commit
f07c090876
  1. 2
      spring-boot-dependencies/pom.xml
  2. 7
      spring-boot-samples/spring-boot-sample-data-mongodb/src/test/java/sample/data/mongo/SampleMongoApplicationTests.java

2
spring-boot-dependencies/pom.xml

@ -89,7 +89,7 @@ @@ -89,7 +89,7 @@
<log4j.version>1.2.17</log4j.version>
<logback.version>1.1.2</logback.version>
<mockito.version>1.9.5</mockito.version>
<mongodb.version>2.12.3</mongodb.version>
<mongodb.version>2.12.4</mongodb.version>
<mysql.version>5.1.34</mysql.version>
<reactor.version>1.1.5.RELEASE</reactor.version>
<reactor-spring.version>1.1.3.RELEASE</reactor-spring.version>

7
spring-boot-samples/spring-boot-sample-data-mongodb/src/test/java/sample/data/mongo/SampleMongoApplicationTests.java

@ -16,6 +16,8 @@ @@ -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; @@ -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 { @@ -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;
}
}

Loading…
Cancel
Save