This module provides examples using Testcontainers with Oracle Database Free to test your Oracle Database Java applications using dispoable containers.
The gvenzl/oracle-free
Oracle Database container images are recommended for use with Testcontainers and Java. The examples in this module use the Oracle Database 23ai Free image gvenzl/oracle-free:23.6-slim-faststart
.
This test implements a basic Oracle 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 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 Database Transacational Event Queues (JMS), and then creates a JMS queue.
This package provides sample tests with a reusable Oracle Database container, allowing you to reduce startup time between database test suites.