Commit e220f080 authored by Phillip Webb's avatar Phillip Webb

Attempt to fix Windows CI

parent 8be3f33c
...@@ -22,6 +22,7 @@ import org.springframework.boot.test.OutputCapture; ...@@ -22,6 +22,7 @@ import org.springframework.boot.test.OutputCapture;
import org.springframework.core.NestedCheckedException; import org.springframework.core.NestedCheckedException;
import com.mongodb.MongoServerSelectionException; import com.mongodb.MongoServerSelectionException;
import com.mongodb.MongoTimeoutException;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
...@@ -55,7 +56,8 @@ public class SampleMongoApplicationTests { ...@@ -55,7 +56,8 @@ public class SampleMongoApplicationTests {
NestedCheckedException nested = new NestedCheckedException("failed", ex) { NestedCheckedException nested = new NestedCheckedException("failed", ex) {
}; };
Throwable root = nested.getRootCause(); Throwable root = nested.getRootCause();
if (root instanceof MongoServerSelectionException) { if (root instanceof MongoServerSelectionException
|| root instanceof MongoTimeoutException) {
if (root.getMessage().contains("Unable to connect to any server")) { if (root.getMessage().contains("Unable to connect to any server")) {
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment