| name | testcontainers | ||||
|---|---|---|---|---|---|
| description | Java Testcontainers samples for running Oracle AI Database Free in integration tests. | ||||
| tags |
|
||||
| blog_post | https://andersswanson.dev/2025/05/29/easily-test-oracle-database-applications-with-testcontainers/ |
This module provides examples using Testcontainers with Oracle AI Database Free to test your Oracle AI Database Java applications using dispoable containers.
The gvenzl/oracle-free Oracle AI Database container images are recommended for use with Testcontainers and Java. The examples in this module use the Oracle AI Database 26ai Free image gvenzl/oracle-free:23.26.1-slim-faststart.
This test implements a basic Oracle AI Database test with Testcontainers. The version of the containerized database is queried to verify the test connection works.
This test demonstrates how to run an initialization script in the containerized database to configure a table schema and insert test data.
This test uses a containerized database as a Spring Boot datasource within the context of a @SpringBootTest, initializing the Spring Boot datasource properties at test startup.
The pattern shown allows developers to test their Spring Boot applications with Oracle AI Database using a fully featured Spring context.
This test demonstrates how to mount a SQL script on a containerized database and run that script as sysdba before the test suite begins. This pattern is useful for DBA-level setup before the test, like applying user grants or creating PDBs.
The SysdbaInitTest setup script applies grants to a test user to manage Oracle AI Database Transacational Event Queues (JMS), and then creates a JMS queue.
This package provides sample tests with a reusable Oracle AI Database container, allowing you to reduce startup time between database test suites.