From 6a431d91ec6556d32bc613d82b030b5630de1c0f Mon Sep 17 00:00:00 2001 From: Paulo Gomes da Cruz Junior Date: Mon, 28 Oct 2024 07:47:30 -0700 Subject: [PATCH] chore(deps): code refactor (#417) --- backend/pom.xml | 9 ++------- .../AbstractTestContainerIntegrationTest.java | 2 +- .../extensions/CustomOracleContainer.java | 16 +--------------- 3 files changed, 4 insertions(+), 23 deletions(-) diff --git a/backend/pom.xml b/backend/pom.xml index 7008de85..230215a0 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -31,7 +31,7 @@ true true true - true + false true ${project.build.directory}/coverage-reports ${maven.build.timestamp} @@ -176,7 +176,7 @@ org.testcontainers - oracle-xe + oracle-free test @@ -186,11 +186,6 @@ spring-boot-starter-test test - - com.h2database - h2 - test - org.springframework.security spring-security-test diff --git a/backend/src/test/java/ca/bc/gov/restapi/results/extensions/AbstractTestContainerIntegrationTest.java b/backend/src/test/java/ca/bc/gov/restapi/results/extensions/AbstractTestContainerIntegrationTest.java index b2a8e96b..969847e2 100644 --- a/backend/src/test/java/ca/bc/gov/restapi/results/extensions/AbstractTestContainerIntegrationTest.java +++ b/backend/src/test/java/ca/bc/gov/restapi/results/extensions/AbstractTestContainerIntegrationTest.java @@ -10,9 +10,9 @@ import org.springframework.test.context.DynamicPropertyRegistry; import org.springframework.test.context.DynamicPropertySource; import org.springframework.test.context.junit.jupiter.SpringExtension; -import org.testcontainers.containers.OracleContainer; import org.testcontainers.containers.PostgreSQLContainer; import org.testcontainers.junit.jupiter.Testcontainers; +import org.testcontainers.oracle.OracleContainer; /** * Abstract base class for integration tests using Testcontainers for PostgreSQL and Oracle diff --git a/backend/src/test/java/ca/bc/gov/restapi/results/extensions/CustomOracleContainer.java b/backend/src/test/java/ca/bc/gov/restapi/results/extensions/CustomOracleContainer.java index e23c832e..7905d33c 100644 --- a/backend/src/test/java/ca/bc/gov/restapi/results/extensions/CustomOracleContainer.java +++ b/backend/src/test/java/ca/bc/gov/restapi/results/extensions/CustomOracleContainer.java @@ -2,25 +2,15 @@ import java.time.Duration; import java.util.UUID; -import org.testcontainers.containers.OracleContainer; +import org.testcontainers.oracle.OracleContainer; import org.testcontainers.utility.DockerImageName; -/** - * CustomOracleContainer extends OracleContainer to provide a customized Oracle database container. - * This is because by default, the library expects the Oracle database to come from a different - * image. - */ public class CustomOracleContainer extends OracleContainer { - /** - * Constructs a CustomOracleContainer with predefined settings. Sets the Docker image, database - * name, username, and a random password. - */ public CustomOracleContainer() { super( DockerImageName .parse("gvenzl/oracle-free:23.5-slim-faststart") - .asCompatibleSubstituteFor("gvenzl/oracle-xe") ); this.withDatabaseName("legacyfsa") @@ -28,10 +18,6 @@ public CustomOracleContainer() { .withPassword(UUID.randomUUID().toString().substring(24)); } - /** - * Overrides the waitUntilContainerStarted method to set a custom startup timeout. The Oracle - * image tends to be slow, so we set a longer timeout. - */ @Override protected void waitUntilContainerStarted() { getWaitStrategy()