lsd-consulting/lsd-distributed-interceptors

Fix shutting down Mongo after integration tests

lukasz-gryzbon opened this issue · 0 comments

The MongoDB instance that is span up during integration tests needs to be shut down at the end.

This becomes problematic as soon as there is more than 1 integration test using that instance and one or more unit tests that don't use it.

The problems are:

  • when to spin it up?
  • when to shut it down?

A number of approaches have been tried and all seem to cause problems.

The best so far has been to implement a jUnit5 listener which spins it up before all the tests and shuts it down after all the test. This, however, caused problems with Pitest.

The next one I can think of is to move those integration tests to a separate source set.