How can I disable logging in tests?

I’m using Dropwizard REST framework with the dropwizard-liquibase module for managing database migrations.

I have a test setup with a local database and my database tests run on every test run. This includes running the database migrations, as well as running the sql queries with pre-filled data to ensure all queries run as expected.

To achieve this, I run the database migrations before running my database tests with the Liquibase instance as follows:


Finally figured it out.

I had Logback on the classpath, so to disable it I had to set the log level in Logback instead of on the logger instance because the setLogLevel() method in Slf4jLogger no-ops.

I basically did before running my Liquibase test command.