Skip to main content

Test integration

Test cross-component workflows with Testcontainers and API tests.

Testcontainers setup

Test with real databases using Docker:

@QuarkusTest
@QuarkusTestResource(PostgresResource.class)
public class IntegrationTest {
// Test with real PostgreSQL container
}

API contract tests

Test API interactions between frontend and backend:

describe("Dataset API", () => {
it("creates and retrieves dataset", async () => {
const created = await fetch("/api/datasets", {
method: "POST",
body: JSON.stringify({ title: "Test" }),
});
const dataset = await created.json();

const retrieved = await fetch(`/api/datasets/${dataset.id}`);
expect(retrieved.status).toBe(200);
});
});