Hi, this is the initial post of a series where i’ll be publishing some samples showing how to work with MongoDB documents with Java.
This post sample consists on a project that uses spring-boot with spring-data-mongo repository, Fongo(an in-memory mongodb representation) and NoSqlUnit – a helper library for tests.
For a cleaner document object, we use Lombok.
Sample data to load using NoSqlUnit.
‘fongo-hello-world‘ – is a maven project, so it should be fairly simple to import and build it. Run the test on class ‘UserRepositoryTest’.
Hope it’s helpful for someone!