From dbb2d0416650f58fae311ac1e3bdefc746f3b3b8 Mon Sep 17 00:00:00 2001 From: Scott Leberknight <174812+sleberknight@users.noreply.github.com> Date: Tue, 15 Oct 2024 22:42:51 -0400 Subject: [PATCH] Add warning to MongoServerExtension Javadocs Add a warning to the Javadocs that MongoServerExtension will not work with Mongo Java driver 5.2.0 or higher because that version requires wire version 7. At present, mongo-java-server only supports wire version 6. Closes #524 --- .../test/junit/jupiter/MongoServerExtension.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/org/kiwiproject/test/junit/jupiter/MongoServerExtension.java b/src/main/java/org/kiwiproject/test/junit/jupiter/MongoServerExtension.java index 78fb0f6f..5c525b40 100644 --- a/src/main/java/org/kiwiproject/test/junit/jupiter/MongoServerExtension.java +++ b/src/main/java/org/kiwiproject/test/junit/jupiter/MongoServerExtension.java @@ -20,6 +20,12 @@ import java.util.concurrent.ThreadLocalRandom; /** + * WARNING: As of kiwi-test 3.7.0, this extension will fail when using Mongo + * driver version 5.2.0 or higher, as it requires minimum Mongo server 4.0 and wire version 7. + * It will not work unless the mongo-java-server + * library fixes this issue + * and creates a new release that supports wire version 7. + *

* A JUnit Jupiter {@link org.junit.jupiter.api.extension.Extension Extension} that starts an in-memory * {@link MongoServer} once before all tests have run, and which shuts it down once after all tests have run. * An alternative for testing against "real" MongoDB instances is the {@link MongoDbExtension}. @@ -59,6 +65,7 @@ @Slf4j public class MongoServerExtension implements BeforeAllCallback, AfterAllCallback, AfterEachCallback { +// private static final ServerVersion DEFAULT_SERVER_VERSION = ServerVersion.MONGO_3_6; private static final ServerVersion DEFAULT_SERVER_VERSION = ServerVersion.MONGO_3_6; /**