SpringBootTest: How to avoid the need of starting a container

70 Views Asked by At

I have SpringBootTests that use org.testcontainer:postgres for integration tests.

While thats very useful for tests that involve the database, it's quite useless when the database isn't needed. Let's say, I want to test the actuator/info endpoint.

If I don't provide a database, the context won't load.

java.lang.IllegalStateException: Failed to load ApplicationContext
    ...
    Error creating bean with name 'liquibase'

Question: How can I run a SpringBootTest without the need to provide a database?

0

There are 0 best solutions below