Class BloviateContainers

java.lang.Object
io.bloviate.testcontainers.BloviateContainers

public final class BloviateContainers extends Object
Fills a started JdbcDatabaseContainer with Bloviate-generated data — the public form of the pattern Bloviate uses in its own tests.

The container must already be running and its schema created (for example via withInitScript(...)); Bloviate fills the tables it discovers. The DatabaseSupport is auto-detected from the connection unless one is supplied.

try (var postgres = new PostgreSQLContainer<>("postgres:18-alpine").withInitScript("schema.sql")) {
    postgres.start();
    BloviateContainers.forContainer(postgres)
        .rows(500)
        .seed(42)
        .fill();
}
  • Method Details

    • forContainer

      public static BloviateContainers.Builder forContainer(org.testcontainers.containers.JdbcDatabaseContainer<?> container)
      Begins configuring a fill for the given started container.
      Parameters:
      container - a started JDBC container whose schema already exists
      Returns:
      a builder to configure and run the fill