Questions tagged [fongo]

Fongo, for "Fake Mongo," is a Java-based in-memory implementation of MongoDB. It is intended to assist in unit testing.

21 questions
5
votes
2 answers

Adding configuration class to SpringBootTest breaks component scan

I am trying to disable real Mongo connection and replace it with Fongo mock in tests. Here is my test class: @SpringBootTest @RunWith(SpringRunner.class) public class ControllerTest { @Autowired private…
Alesto
  • 639
  • 4
  • 13
  • 29
5
votes
1 answer

Fongo - OperationExecutor not found

I would like to use fongo 2.0.x in my Spring boot application, but I getting errror Error:(23, 44) java: cannot access com.mongodb.operation.OperationExecutor class file for com.mongodb.operation.OperationExecutor not found Here is my…
richersoon
  • 4,682
  • 13
  • 44
  • 74
4
votes
3 answers

Spring boot Embedded MongoDb data prefilled

I want to know if there are any tools like Flyway which can assist in database initialization / migration for mongodb. Some of the thoughts I had is I have used flapdoodle as embedded mongo with springboot. This works fine but, I need to manually…
pvpkiran
  • 25,582
  • 8
  • 87
  • 134
2
votes
1 answer

Junit/Fongo: How to make use of Fongo in the unit test for checking NotNull

I am writing a basic unit test that checks whether the returned query (type DataVersion) is not null. I have to make sure that I am using Fongo for testing my db. This is the repo class: @Repository public class DataVersionDaoMongo extends…
lovprogramming
  • 593
  • 11
  • 24
2
votes
1 answer

How to turn off fakemongo logs

I am using Fongo, Fongo is an in-memory java implementation of MongoDB. How to prevent these logs It creating a lengthy log which occupies a lot of space. I am using following dependencies
arunkumar sambu
  • 653
  • 1
  • 9
  • 22
2
votes
1 answer

Id field is not set when read out of a fongo using spring-data-monogdb during unit tests

I have the following problem: I have a spring-boot (1.3.3) application that uses a mongodb as storage. All works fine with a real mongodb using the mongo repositories. But for unit tests we try to use fongo to have not install a mongodb on every…
R. Illger
  • 21
  • 2
2
votes
1 answer

Failing to create 'mongoMappingContext' Bean when unit-testing with Fongo

I am currently setting up the unit test for the project I am working on and I have run into a bit of a wall. The project I am working on is using mongoDB as its database so for unit-testing I wanted to use Fongo to simulation the database so I can…
Josh Balcitis
  • 490
  • 6
  • 19
2
votes
1 answer

MongoDB Java client - why does `sort` seem to break my query?

I have not been able to make a query work when using sort. I expect the results of a query to be exactly the same as if I were not using sort, except the results should come in sorted, of course, but what happens is that when using sort I get…
Renato
  • 12,940
  • 3
  • 54
  • 85
1
vote
4 answers

Fongo 2.1.0 not working with Mongo java driver 3.2.8

I am trying to upgrade mongodb to 4.x from 3.x since we need to have transaction support in mongodb, and also using fongo for junits. I have modified version for below given dependencies…
Bhagwati Malav
  • 3,349
  • 2
  • 20
  • 33
1
vote
1 answer

Java applications with In memory database are taking too long to build

I am using in memory databases like HSQL and FONGO in my java application for junit tests I am executing these build on linux machine. Due to these in memory database, build are taking too long to build. Build which is supposed to complete in 2…
Patan
  • 17,073
  • 36
  • 124
  • 198
0
votes
3 answers

How to do integration testing using Fongo (Fake mongo) in Spring Boot

I am working on spring boot application with mongodb as backend. mongorepository for crud operation I want to do integration testing using fake mongo (fongo) I have taken reference from following link to do integration testing using fongo but no…
StackOverFlow
  • 4,486
  • 12
  • 52
  • 87
0
votes
2 answers

Fongo - Fake Mongo : Not able to load dataset from location for unit testing of mongrepository using fongo

I am using fongo as in memory database for testing my mongodbrepository. I have taken reference from http://dontpanic.42.nl/2015/02/in-memory-mongodb-for-unit-and.html for unit testing. To populate sample data, I have added required json file under…
StackOverFlow
  • 4,486
  • 12
  • 52
  • 87
0
votes
2 answers

Spring/MongoDB/Junit: Unit test with Fongo is giving the Null Pointer Exception

I am fairly new to unit testing and trying to test a simple function that returns a query. In my unit test, I am getting the NullPointerException after calling the method. I assume mongoOperations is null, and guessing that is the reason why it is…
lovprogramming
  • 593
  • 11
  • 24
0
votes
1 answer

Error creating mongobee bean on springboot app (on run of tests)

I use all lasts versions (fix others problems) mongobee 0.13 fongo 2.2.0-RC3-SNAPSHOT mongodb-driver 3.8.2 When I run my app, I have this error: org.springframework.beans.factory.BeanCreationException: Error creating bean with name…
Stéphane GRILLON
  • 11,140
  • 10
  • 85
  • 154
0
votes
2 answers

Failing JUnit tests for embedded Fongo DB

I have a Spring Boot application which use MongoDB. I would like to use the embedded FongoDB for my JUnit tests. I follow some articles, for example: http://dontpanic.42.nl/2015/02/in-memory-mongodb-for-unit-and.html My Fongo test configuration…
1
2