Attempt to fix Windows CI

This commit is contained in:
Phillip Webb 2014-06-25 17:25:31 -07:00
parent 8be3f33cfb
commit e220f0806a

View File

@ -22,6 +22,7 @@ import org.springframework.boot.test.OutputCapture;
import org.springframework.core.NestedCheckedException;
import com.mongodb.MongoServerSelectionException;
import com.mongodb.MongoTimeoutException;
import static org.junit.Assert.assertTrue;
@ -55,7 +56,8 @@ public class SampleMongoApplicationTests {
NestedCheckedException nested = new NestedCheckedException("failed", ex) {
};
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")) {
return true;
}