Skip to content

Commit

Permalink
chore(deps): code refactor (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulushcgcj authored Oct 28, 2024
1 parent e2086fe commit 6a431d9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 23 deletions.
9 changes: 2 additions & 7 deletions backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<skip.unit.tests>true</skip.unit.tests>
<jacoco.skip>true</jacoco.skip>
<checkstyle.skip>true</checkstyle.skip>
<checkstyle.failsOnError>true</checkstyle.failsOnError>
<checkstyle.failsOnError>false</checkstyle.failsOnError>
<checkstyle.includeTestSourceDirectory>true</checkstyle.includeTestSourceDirectory>
<jacoco.output.data>${project.build.directory}/coverage-reports</jacoco.output.data>
<timestamp>${maven.build.timestamp}</timestamp>
Expand Down Expand Up @@ -176,7 +176,7 @@
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>oracle-xe</artifactId>
<artifactId>oracle-free</artifactId>
<scope>test</scope>
</dependency>

Expand All @@ -186,11 +186,6 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,22 @@

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")
.withUsername("THE")
.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()
Expand Down

0 comments on commit 6a431d9

Please sign in to comment.