Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combine PagingQueryEmbeddedMongoTest and PagingQueryRealMongoTest #818

Closed
sleberknight opened this issue Dec 7, 2022 · 1 comment · Fixed by #848
Closed

Combine PagingQueryEmbeddedMongoTest and PagingQueryRealMongoTest #818

sleberknight opened this issue Dec 7, 2022 · 1 comment · Fixed by #848
Assignees
Labels
code cleanup Fix issues reported by Sonar or any other code analysis tools
Milestone

Comments

@sleberknight
Copy link
Member

Both PagingQueryEmbeddedMongoTest and PagingQueryRealMongoTest are tests of PagingQuery. The only reason PagingQueryRealMongoTest exists is because the in-memory de.bwaldvogel.mongo.MongoServer.MongoServer that we use for other Mongo testing does not work when testing the PagingQuery#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 and PagingQueryRealMongoTest 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).

@sleberknight sleberknight added the code cleanup Fix issues reported by Sonar or any other code analysis tools label Dec 7, 2022
@sleberknight sleberknight added this to the 2.4.1 milestone Dec 7, 2022
@sleberknight sleberknight removed this from the 2.5.0 milestone Jan 20, 2023
@sleberknight
Copy link
Member Author

Removing the milestone for now. This isn't a high priority at the moment, so will revisit later.

sleberknight added a commit that referenced this issue Jan 23, 2023
* Add integration tests for PagingQuery that test against Mongo 3-6

Closes #818
chrisrohr pushed a commit that referenced this issue Jan 23, 2023
* Add integration tests for PagingQuery that test against Mongo 3-6

References #818
sleberknight added a commit that referenced this issue Jan 23, 2023
* Remove PagingQueryEmbeddedMongoTest
* Remove PagingQueryRealMongoTest
* Remove flapdoodle dependency from the POM

Closes #818
sleberknight added a commit that referenced this issue Jan 23, 2023
* Remove PagingQueryEmbeddedMongoTest
* Remove PagingQueryRealMongoTest
* Remove flapdoodle dependency from the POM

Closes #818
@sleberknight sleberknight self-assigned this Jan 23, 2023
@sleberknight sleberknight added this to the 2.5.0 milestone Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code cleanup Fix issues reported by Sonar or any other code analysis tools
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant