Skip to content

Instantly share code, notes, and snippets.

@mklueh
Created May 1, 2020 15:32
Show Gist options
  • Save mklueh/fb78f6178da43ad80cd8962d2cf925a1 to your computer and use it in GitHub Desktop.
Save mklueh/fb78f6178da43ad80cd8962d2cf925a1 to your computer and use it in GitHub Desktop.
Annotation order matters when using TestContainers with QuarkusTest
@Testcontainers
@QuarkusTest
@SuppressWarnings("ALL")
@QuarkusTestResource(H2DatabaseTestResource.class)
class PostTest {
public static final int PORT = 5431;
@ClassRule
static PostgreSQLContainer db = new PostgreSQLContainer<>("postgres")
.withDatabaseName("postgres")
.withUsername("postgres")
.withPassword("postgres")
.withNetworkAliases("postgres")
.withExposedPorts(PORT)
.withStartupTimeout(Duration.ofMinutes(5));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment