Liquibase initializer to be used with the Embedded DB JUnit Rule. When added as a plugin i runs the Liquibase update target after the in-memory H2 database has been created. This allows you to write tests for your real world database schema without affecting your real database
<dependency>
<groupId>org.zapodot</groupId>
<artifactId>embedded-db-junit-liquibase</artifactId>
<version>ADD_VERSION</version>
<scope>test</scope>
</dependency>
@Rule
public EmbeddedDatabaseRule embeddedDatabaseRule = EmbeddedDatabaseRule
.builder()
.withMode(CompatibilityMode.MSSQLServer)
.initializedByPlugin(LiquibaseInitializer.builder()
.withChangelogResource("example-changelog.sql")
.withContexts("addUsersAndRoles")
.build())
.build();
The fluent builder API contains numerous methods that let you control various parameters that are provided to Liquibase.