Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bmike2047/springboot-mongodb-embedded
Run Spring Boot mongo tests on an embedded MongoDB instance
https://github.com/bmike2047/springboot-mongodb-embedded
flapdoodle-embed-mongo java jdk17 mongodb mongodb-database mongodb-embedded spring spring-boot
Last synced: about 1 month ago
JSON representation
Run Spring Boot mongo tests on an embedded MongoDB instance
- Host: GitHub
- URL: https://github.com/bmike2047/springboot-mongodb-embedded
- Owner: bmike2047
- Created: 2024-08-09T12:34:58.000Z (3 months ago)
- Default Branch: master
- Last Pushed: 2024-09-23T19:19:18.000Z (about 2 months ago)
- Last Synced: 2024-09-27T17:20:52.008Z (about 2 months ago)
- Topics: flapdoodle-embed-mongo, java, jdk17, mongodb, mongodb-database, mongodb-embedded, spring, spring-boot
- Language: Java
- Homepage:
- Size: 248 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Spring Boot MongoDB embedded
--
![](assets/images/logo3.png)### Description
This project is an example of using Spring Boot with MongoDB but more particular testing is done using an embedded MongoDB instance instead of docker.
It includes a simple data model and repository.
The embedded MongoDB instance is running on localhost:27017
### Usage
Requires JDK 17
To run the tests use the following gradle task:
```
./gradlew clean test
```
> [!TIP]
> This embedded-MongoDB test ran on Ubuntu 22.04.4 which support MonogoDB 6.x and up. This is because of libcrypto.so was updated to version 3.x on Ubuntu 22.
> If you require to run MonogoDB 4.x tests you need to run on an older Ubuntu version that has libcrypto.so.1.1 like Ubuntu 18.> [!TIP]
> I case you have older JDK version than JDK 17 and you are using IntelliJIDEA as IDE make sure Gradle JVM is set to JDK 17 in:
> File | Settings | Build, Execution, Deployment | Build Tools | Gradle -> Gradle JVM### Screenshot
This was generated by putting a Thread.sleep() in the middle of the test and using Studio3T as a client to explore the embedded MongoDB instance.
![](assets/images/screen1.png)