Combine PagingQueryEmbeddedMongoTest and PagingQueryRealMongoTest #818
Labels
code cleanup
Fix issues reported by Sonar or any other code analysis tools
Milestone
Both
PagingQueryEmbeddedMongoTest
andPagingQueryRealMongoTest
are tests ofPagingQuery
. The only reasonPagingQueryRealMongoTest
exists is because the in-memoryde.bwaldvogel.mongo.MongoServer.MongoServer
that we use for other Mongo testing does not work when testing thePagingQuery#aggregatePage
(it throws a NPE).We used the "flapdoodle" embedded Mongo for this one test. Recently the flapdoodle embedded Mongo (3.5.x) was completely re-written and released as version 4.1.0. Unfortunately, they completely changed the API, so with version 4.1.0,
PagingQueryEmbeddedMongoTest
no longer even compiles. It seems like a better option to simply replace it than try to learn an entire new API for literally just one test class.Another issue is that the
PagingQueryRealMongoTest
must be run manually which pretty much means it never gets run.So, using Testcontainers, we can combine
PagingQueryEmbeddedMongoTest
andPagingQueryRealMongoTest
into a single test and use Testcontainers. In addition, we should be able to design the test so that it runs against different versions of Mongo, e.g. 3, 4, 5, and 6.Once we combine these tests, we can remove the dependency on flapdoodle (and then also remove from kiwi-bom since we don't use flapdoodle anywhere else in our libraries or services).
The text was updated successfully, but these errors were encountered: