Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Arconia MongoDB Atlas Dev Services with Spring Data MongoDB

Application that demonstrates the use of Arconia Dev Services for MongoDB Atlas with Spring Data Mongo. When running the application in dev mode or integration tests, a MongoDB database will be automatically started using Testcontainers and the database connection details will be automatically configured. As a developer, all you need to do is to add the arconia-dev-services-mongodb-atlas dependency to your project. Everything else is taken care of by the Arconia framework, building on top of Spring Boot's support for Testcontainers.

Pre-requisites

  • Java 25
  • Podman/Docker

Running the application

Run the application as follows:

./gradlew bootRun

Alternatively, you can use the Arconia CLI:

arconia dev

Under the hood, the Arconia framework will automatically spin up a MongoDB Atlas database server using Testcontainers (see Arconia Dev Services for more information).

The application will be accessible at http://localhost:8080.

Using the application

Start by creating a book using the httpie command line tool:

http POST :8080/books title="The Hitchhiker's Guide to the Galaxy"

You can then retrieve the list of books:

http GET :8080/books

You can also retrieve a specific book by its ID (which is returned when you create a book):

http GET :8080/books/{id}

Running the tests

You can run the tests using the following command:

./gradlew test

Alternatively, you can use the Arconia CLI:

arconia test

The integration tests will automatically get the database connection details from the Arconia Dev Services and run against the MongoDB database started by Testcontainers.