Testcontainers

A family of libraries that start real dependencies such as databases in throwaway containers for the length of a test.

In more detail

It exists for Python, Java, Go, C#, JavaScript and other languages. It starts a pinned image, waits for it to be ready, exposes the mapped port to your test and removes the container afterwards.

Example

@Container static PostgreSQLContainer<?> database = new PostgreSQLContainer<>("postgres:16");

Related terms

Taught in

References

Certification courses