-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for java mongodb driver 3.6.4+ #357
Comments
I'm using mongo-java-driver 3.8.2 and getting the exact same exception (also with Java 8). |
Same issue for me with mongodb-driver 3.8.2 (spring boot 2.1.0). The class com.mongodb.OperationExecutor createOperationExecutor() {
return new FongoOperationExecutor(fongo);
} |
@twillouer Hi, can we have a response regarding this issue? What is the priority of this issue as it is currently a show stopper for our project, as we cannot upgrade to latest the spring/mongo version. I would like to avoid switching to another (embedded) mongo solution... |
We are also having a similar problem. Using driver 3.8.2 with spring boot 2.1.0. We are getting a null pointer exception in the com.mongodb.Mongo class when attempting to access the: private final MongoClientDelegate delegate; This element is not set by the MockMongoClient from Fongo and certain operations fail. The operation we are executing is: mongoTemplate.indexOps(QueueEntry.class).ensureIndex(new Index(CREATED_DATE_FIELD_NAME, Sort.Direction.DESC)); Here is the stack trace from the failure: java.lang.NullPointerException |
You should give a try to mongo-java-server. Except for 2 test cases the switch from |
Same issue as @tschiman ! |
Btw @tschiman ! Seeing that it was created on Sep 20, and nothing has changed in last 4 months, I switched to mongo-java-server, as @markbigler suggested, and it worked like a charm. No code change required in my case. Just a small change in my test-mongo.xml spring configurations, and everything went smoothly. I would highly recommend doing that to anyone who comes here, until the bug is fixed. |
I invested three days before my holidays fixing my specs and didn't get it done. With @markbigler solution, all tests were green again within 10 minutes 💯. Big thanks! :-) |
We switched one week later and it everything is working. We will not switch back anymore. |
Hi everyone, We (at Malt) encountered the same problems as everyone:
So I finally dedicated some hours to fongo itself and here is the result: fongo-mongo-3.8. Please note that only the minimum amount of work required to have all tests pass with the 3.8 driver has been done. I couldn't find a way to contribute it in an "intelligent" way, since it can't just be a pull request for a new version of fongo (it requires Java 8+ and mongo 3.8), so I called it fongo-mongo-3.8 and made it clear that it's not provided by the fongo team (for now). Also we didn't publish it to Maven central, so you will have to build it by yourself if you want to use it. As a side note, I'd like to share some thoughts if it can be of any help to someone else: we do think in my team that though fongo is a nice tool, we should not rely that much on it. We are improving our testing strategy to mock our repository interfaces (which is easier now that we're more and more applying the hexagonal architecture principles), and we test our repository implementations using a real database via https://www.testcontainers.org/. Also, we're in the process of dropping MongoDB, but that's another story :-) |
Hi @jaypatel512, We are trying to fix using same type of xml configuration. Could you please share your test-mongo.xml or inbox me the same. ([email protected]) |
|
PR notes Use pipe delimiter in application properties so that they can be parametrized for both Travis and Gitlab Replace Fongo with real MongoDB tests because Fongo is not supported in Spring Boot 2.1 - see [here](fakemongo/fongo#357) Update Travis and Gitlab scripts to include Mongo installations Update POMs to support "|" delimiters so that EVA mongo host for tests can be parametrized for both Travis and Gitlab javax.validation API dependency need no longer be explicitly pulled in since Spring Boot 2 contains it Upgrade jackson-databind version to 2.9.7 to work with Spring Boot 2 JPA repository query methods should be marked with "Query" annotation
PR notes Use pipe delimiter in application properties so that they can be parametrized for both Travis and Gitlab Replace Fongo with real MongoDB tests because Fongo is not supported in Spring Boot 2.1 - see [here](fakemongo/fongo#357) Update Travis and Gitlab scripts to include Mongo installations Update POMs to support "|" delimiters so that EVA mongo host for tests can be parametrized for both Travis and Gitlab javax.validation API dependency need no longer be explicitly pulled in since Spring Boot 2 contains it Upgrade jackson-databind version to 2.9.7 to work with Spring Boot 2 JPA repository query methods should be marked with "Query" annotation
EVA-1902 - Spring Boot 2 upgrade - Replace Fongo with real MongoDB tests because Fongo is not supported in Spring Boot 2.1 - see [here](fakemongo/fongo#357) - Update Travis and Gitlab scripts to include Mongo installations - Update POMs to support "|" delimiters so that EVA mongo host for tests can be parametrized for both Travis and Gitlab - javax.validation API dependency need no longer be explicitly pulled in since Spring Boot 2 contains it - Upgrade jackson-databind version to 2.9.7 to work with Spring Boot 2 - JPA repository query methods should be marked with "Query" annotation
I've tried to use Fongo with java mongodb driver 3.7.1 and receive this exception (with Java 8):
Reading 3.7.x release notes: http://mongodb.github.io/mongo-java-driver/3.7/whats-new/ seems to be a problem related to new Java 9 modular approach.
I've found branch driver37 but I'm not sure If I need to use it or stay with master, please let me know
The text was updated successfully, but these errors were encountered: