From e7be9d6616bc4c69fb415e8d502551113c1a27d2 Mon Sep 17 00:00:00 2001 From: Anton Kurako Date: Fri, 1 Sep 2023 03:29:38 +0300 Subject: [PATCH] [0.6.2-SNAPSHOT] Cleanup --- .../cassandra/CassandraConnection.java | 5 +++-- .../cassandra/CassandraConnectionImpl.java | 11 ++++++----- .../cassandra/ContainerCassandra.java | 3 ++- .../cassandra/TestcontainersCassandra.java | 3 ++- .../TestcontainersCassandraExtension.java | 19 ++++++++++--------- .../CassandraConnectionAssertsTests.java | 4 ++-- ...CassandraSimplePerClassMigrationTests.java | 9 ++++++--- ...assandraSimplePerMethodMigrationTests.java | 9 ++++++--- .../extensions/jdbc/ContainerCockroachdb.java | 3 ++- .../jdbc/TestcontainersCockroachdb.java | 3 ++- .../TestcontainersCockroachdbExtension.java | 11 ++++++----- ...kroachdbFlywayPerMethodMigrationTests.java | 9 ++++++--- ...achdbLiquibaseMigrationPerMethodTests.java | 9 ++++++--- .../extensions/AbstractContainerMetadata.java | 3 ++- .../ContainerFromAnnotationTests.java | 4 ++-- .../ContainerPerClassAbstractTests.java | 4 ++-- .../ContainerPerClassConstructorTests.java | 4 ++-- .../ContainerPerClassInstanceClassTests.java | 4 ++-- .../ContainerPerClassInstanceMethodTests.java | 4 ++-- .../ContainerPerMethodConstructorTests.java | 4 ++-- .../ContainerPerMethodInstanceClassTests.java | 4 ++-- ...ContainerPerMethodInstanceMethodTests.java | 4 ++-- .../extensions/ContainerPerRunFirstTests.java | 6 +++--- .../ContainerPerRunSecondTests.java | 6 +++--- .../extensions/example/RedisConnection.java | 3 ++- .../example/RedisConnectionImpl.java | 8 +++++--- .../extensions/example/RedisContainer.java | 3 ++- .../example/TestcontainersRedis.java | 3 ++- .../example/TestcontainersRedisExtension.java | 7 ++++--- .../AbstractTestcontainersJdbcExtension.java | 15 +++++++++------ .../extensions/jdbc/JdbcConnection.java | 7 ++++--- .../extensions/jdbc/JdbcConnectionImpl.java | 13 +++++++------ .../ExampleTestcontainersJdbcExtension.java | 5 +++-- .../jdbc/FlywayPerClassMigrationTests.java | 9 ++++++--- .../jdbc/FlywayPerMethodMigrationTests.java | 9 ++++++--- .../jdbc/JdbcConnectionAssertsTests.java | 4 ++-- .../JdbcContainerFromAnnotationTests.java | 4 ++-- .../jdbc/LiquibaseMigrationPerClassTests.java | 9 ++++++--- .../LiquibaseMigrationPerMethodTests.java | 9 ++++++--- .../jdbc/example/ContainerJdbc.java | 3 ++- .../jdbc/example/ContainerJdbcConnection.java | 1 + .../jdbc/example/TestcontainersJdbc.java | 3 ++- .../extensions/kafka/KafkaConnection.java | 5 ++++- .../kafka/KafkaConnectionTopicResetTests.java | 7 +++++-- .../extensions/jdbc/ContainerMariadb.java | 3 ++- .../jdbc/TestcontainersMariadb.java | 3 ++- .../jdbc/TestcontainersMariadbExtension.java | 11 ++++++----- .../MariadbFlywayPerMethodMigrationTests.java | 9 ++++++--- ...riadbLiquibaseMigrationPerMethodTests.java | 9 ++++++--- .../extensions/jdbc/ContainerMysql.java | 3 ++- .../extensions/jdbc/TestcontainersMysql.java | 3 ++- .../jdbc/TestcontainersMysqlExtension.java | 11 ++++++----- .../MysqlFlywayPerMethodMigrationTests.java | 9 ++++++--- ...MysqlLiquibaseMigrationPerMethodTests.java | 9 ++++++--- .../extensions/jdbc/ContainerOracle.java | 3 ++- .../extensions/jdbc/TestcontainersOracle.java | 3 ++- .../jdbc/TestcontainersOracleExtension.java | 11 ++++++----- .../OracleFlywayPerMethodMigrationTests.java | 9 ++++++--- ...racleLiquibaseMigrationPerMethodTests.java | 9 ++++++--- .../extensions/jdbc/ContainerPostgres.java | 3 ++- .../jdbc/TestcontainersPostgres.java | 3 ++- .../jdbc/TestcontainersPostgresExtension.java | 11 ++++++----- ...PostgresFlywayPerMethodMigrationTests.java | 9 ++++++--- ...tgresLiquibaseMigrationPerMethodTests.java | 9 ++++++--- .../extensions/redis/RedisConnection.java | 3 ++- .../extensions/redis/RedisConnectionImpl.java | 15 +++++++++------ .../extensions/redis/RedisContainer.java | 3 ++- .../extensions/redis/RedisKey.java | 3 ++- .../extensions/redis/RedisKeyImpl.java | 5 +++-- .../extensions/redis/RedisValueImpl.java | 7 ++++--- .../extensions/redis/TestcontainersRedis.java | 3 ++- .../redis/TestcontainersRedisExtension.java | 11 ++++++----- .../redis/RedisConnectionAssertsTests.java | 7 ++++--- 73 files changed, 285 insertions(+), 184 deletions(-) diff --git a/cassandra/src/main/java/io/goodforgod/testcontainers/extensions/cassandra/CassandraConnection.java b/cassandra/src/main/java/io/goodforgod/testcontainers/extensions/cassandra/CassandraConnection.java index 05ef64a..ddab243 100644 --- a/cassandra/src/main/java/io/goodforgod/testcontainers/extensions/cassandra/CassandraConnection.java +++ b/cassandra/src/main/java/io/goodforgod/testcontainers/extensions/cassandra/CassandraConnection.java @@ -3,12 +3,13 @@ import com.datastax.oss.driver.api.core.CqlSession; import com.datastax.oss.driver.api.core.cql.ResultSet; import com.datastax.oss.driver.api.core.cql.Row; -import java.util.List; -import java.util.Optional; import org.intellij.lang.annotations.Language; import org.jetbrains.annotations.NotNull; import org.testcontainers.containers.CassandraContainer; +import java.util.List; +import java.util.Optional; + /** * Describes active Cassandra connection of currently running {@link CassandraContainer} */ diff --git a/cassandra/src/main/java/io/goodforgod/testcontainers/extensions/cassandra/CassandraConnectionImpl.java b/cassandra/src/main/java/io/goodforgod/testcontainers/extensions/cassandra/CassandraConnectionImpl.java index 7e97989..8b843a6 100644 --- a/cassandra/src/main/java/io/goodforgod/testcontainers/extensions/cassandra/CassandraConnectionImpl.java +++ b/cassandra/src/main/java/io/goodforgod/testcontainers/extensions/cassandra/CassandraConnectionImpl.java @@ -7,11 +7,6 @@ import com.datastax.oss.driver.api.core.cql.Row; import com.datastax.oss.driver.internal.core.config.typesafe.DefaultProgrammaticDriverConfigLoaderBuilder; import com.datastax.oss.driver.internal.core.type.codec.registry.DefaultCodecRegistry; -import java.net.InetSocketAddress; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import java.util.*; -import java.util.stream.Collectors; import org.intellij.lang.annotations.Language; import org.jetbrains.annotations.ApiStatus.Internal; import org.jetbrains.annotations.NotNull; @@ -19,6 +14,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.net.InetSocketAddress; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.*; +import java.util.stream.Collectors; + @Internal final class CassandraConnectionImpl implements CassandraConnection { diff --git a/cassandra/src/main/java/io/goodforgod/testcontainers/extensions/cassandra/ContainerCassandra.java b/cassandra/src/main/java/io/goodforgod/testcontainers/extensions/cassandra/ContainerCassandra.java index 0770c1a..7f72528 100644 --- a/cassandra/src/main/java/io/goodforgod/testcontainers/extensions/cassandra/ContainerCassandra.java +++ b/cassandra/src/main/java/io/goodforgod/testcontainers/extensions/cassandra/ContainerCassandra.java @@ -1,8 +1,9 @@ package io.goodforgod.testcontainers.extensions.cassandra; -import java.lang.annotation.*; import org.testcontainers.containers.CassandraContainer; +import java.lang.annotation.*; + /** * Indicates that annotated field containers {@link CassandraContainer} instance * that should be used by {@link TestcontainersCassandra} rather than creating default container diff --git a/cassandra/src/main/java/io/goodforgod/testcontainers/extensions/cassandra/TestcontainersCassandra.java b/cassandra/src/main/java/io/goodforgod/testcontainers/extensions/cassandra/TestcontainersCassandra.java index e74bc75..8f1efea 100644 --- a/cassandra/src/main/java/io/goodforgod/testcontainers/extensions/cassandra/TestcontainersCassandra.java +++ b/cassandra/src/main/java/io/goodforgod/testcontainers/extensions/cassandra/TestcontainersCassandra.java @@ -2,11 +2,12 @@ import io.goodforgod.testcontainers.extensions.ContainerMode; import io.goodforgod.testcontainers.extensions.Network; -import java.lang.annotation.*; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.extension.ExtendWith; import org.testcontainers.containers.CassandraContainer; +import java.lang.annotation.*; + /** * Extension that is running {@link CassandraContainer} for tests in different modes with database * schema migration support between test executions diff --git a/cassandra/src/main/java/io/goodforgod/testcontainers/extensions/cassandra/TestcontainersCassandraExtension.java b/cassandra/src/main/java/io/goodforgod/testcontainers/extensions/cassandra/TestcontainersCassandraExtension.java index 255bc78..617914f 100644 --- a/cassandra/src/main/java/io/goodforgod/testcontainers/extensions/cassandra/TestcontainersCassandraExtension.java +++ b/cassandra/src/main/java/io/goodforgod/testcontainers/extensions/cassandra/TestcontainersCassandraExtension.java @@ -1,15 +1,6 @@ package io.goodforgod.testcontainers.extensions.cassandra; import io.goodforgod.testcontainers.extensions.AbstractTestcontainersExtension; -import java.io.File; -import java.io.IOException; -import java.lang.annotation.Annotation; -import java.net.URL; -import java.nio.file.Files; -import java.time.Duration; -import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; import org.jetbrains.annotations.ApiStatus.Internal; import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.extension.ExtensionContext; @@ -20,6 +11,16 @@ import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.utility.DockerImageName; +import java.io.File; +import java.io.IOException; +import java.lang.annotation.Annotation; +import java.net.URL; +import java.nio.file.Files; +import java.time.Duration; +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; + @Internal class TestcontainersCassandraExtension extends AbstractTestcontainersExtension, CassandraMetadata> { diff --git a/cassandra/src/test/java/io/goodforgod/testcontainers/extensions/cassandra/CassandraConnectionAssertsTests.java b/cassandra/src/test/java/io/goodforgod/testcontainers/extensions/cassandra/CassandraConnectionAssertsTests.java index 21db3dd..9decc3d 100644 --- a/cassandra/src/test/java/io/goodforgod/testcontainers/extensions/cassandra/CassandraConnectionAssertsTests.java +++ b/cassandra/src/test/java/io/goodforgod/testcontainers/extensions/cassandra/CassandraConnectionAssertsTests.java @@ -1,11 +1,11 @@ package io.goodforgod.testcontainers.extensions.cassandra; -import static org.junit.jupiter.api.Assertions.*; - import io.goodforgod.testcontainers.extensions.ContainerMode; import org.junit.jupiter.api.Test; import org.opentest4j.AssertionFailedError; +import static org.junit.jupiter.api.Assertions.*; + @TestcontainersCassandra(mode = ContainerMode.PER_CLASS, image = "cassandra:4.1", migration = @Migration( diff --git a/cassandra/src/test/java/io/goodforgod/testcontainers/extensions/cassandra/CassandraSimplePerClassMigrationTests.java b/cassandra/src/test/java/io/goodforgod/testcontainers/extensions/cassandra/CassandraSimplePerClassMigrationTests.java index e59adce..f456111 100644 --- a/cassandra/src/test/java/io/goodforgod/testcontainers/extensions/cassandra/CassandraSimplePerClassMigrationTests.java +++ b/cassandra/src/test/java/io/goodforgod/testcontainers/extensions/cassandra/CassandraSimplePerClassMigrationTests.java @@ -1,9 +1,12 @@ package io.goodforgod.testcontainers.extensions.cassandra; -import static org.junit.jupiter.api.Assertions.assertEquals; - import io.goodforgod.testcontainers.extensions.ContainerMode; -import org.junit.jupiter.api.*; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; + +import static org.junit.jupiter.api.Assertions.assertEquals; @TestcontainersCassandra(mode = ContainerMode.PER_CLASS, image = "cassandra:4.1", diff --git a/cassandra/src/test/java/io/goodforgod/testcontainers/extensions/cassandra/CassandraSimplePerMethodMigrationTests.java b/cassandra/src/test/java/io/goodforgod/testcontainers/extensions/cassandra/CassandraSimplePerMethodMigrationTests.java index d7d67e3..8ea783a 100644 --- a/cassandra/src/test/java/io/goodforgod/testcontainers/extensions/cassandra/CassandraSimplePerMethodMigrationTests.java +++ b/cassandra/src/test/java/io/goodforgod/testcontainers/extensions/cassandra/CassandraSimplePerMethodMigrationTests.java @@ -1,9 +1,12 @@ package io.goodforgod.testcontainers.extensions.cassandra; -import static org.junit.jupiter.api.Assertions.assertTrue; - import io.goodforgod.testcontainers.extensions.ContainerMode; -import org.junit.jupiter.api.*; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; + +import static org.junit.jupiter.api.Assertions.assertTrue; @TestcontainersCassandra(mode = ContainerMode.PER_CLASS, image = "cassandra:4.1", diff --git a/cockroachdb/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/ContainerCockroachdb.java b/cockroachdb/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/ContainerCockroachdb.java index ec125ae..4c058bb 100644 --- a/cockroachdb/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/ContainerCockroachdb.java +++ b/cockroachdb/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/ContainerCockroachdb.java @@ -1,8 +1,9 @@ package io.goodforgod.testcontainers.extensions.jdbc; -import java.lang.annotation.*; import org.testcontainers.containers.CockroachContainer; +import java.lang.annotation.*; + /** * Indicates that annotated field containers {@link CockroachContainer} instance * that should be used by {@link TestcontainersCockroachdb} rather than creating default container diff --git a/cockroachdb/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersCockroachdb.java b/cockroachdb/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersCockroachdb.java index eb2e152..0cf6eba 100644 --- a/cockroachdb/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersCockroachdb.java +++ b/cockroachdb/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersCockroachdb.java @@ -2,11 +2,12 @@ import io.goodforgod.testcontainers.extensions.ContainerMode; import io.goodforgod.testcontainers.extensions.Network; -import java.lang.annotation.*; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.extension.ExtendWith; import org.testcontainers.containers.CockroachContainer; +import java.lang.annotation.*; + /** * Extension that is running {@link CockroachContainer} for tests in different modes with database * schema migration support between test executions diff --git a/cockroachdb/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersCockroachdbExtension.java b/cockroachdb/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersCockroachdbExtension.java index b4a1618..00adec3 100644 --- a/cockroachdb/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersCockroachdbExtension.java +++ b/cockroachdb/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersCockroachdbExtension.java @@ -1,10 +1,5 @@ package io.goodforgod.testcontainers.extensions.jdbc; -import java.lang.annotation.Annotation; -import java.time.Duration; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.extension.ExtensionContext; import org.slf4j.LoggerFactory; @@ -13,6 +8,12 @@ import org.testcontainers.containers.output.Slf4jLogConsumer; import org.testcontainers.utility.DockerImageName; +import java.lang.annotation.Annotation; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + final class TestcontainersCockroachdbExtension extends AbstractTestcontainersJdbcExtension { diff --git a/cockroachdb/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/CockroachdbFlywayPerMethodMigrationTests.java b/cockroachdb/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/CockroachdbFlywayPerMethodMigrationTests.java index 7fb058f..9b2c1b2 100644 --- a/cockroachdb/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/CockroachdbFlywayPerMethodMigrationTests.java +++ b/cockroachdb/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/CockroachdbFlywayPerMethodMigrationTests.java @@ -1,9 +1,12 @@ package io.goodforgod.testcontainers.extensions.jdbc; -import static org.junit.jupiter.api.Assertions.assertTrue; - import io.goodforgod.testcontainers.extensions.ContainerMode; -import org.junit.jupiter.api.*; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; + +import static org.junit.jupiter.api.Assertions.assertTrue; @TestcontainersCockroachdb(mode = ContainerMode.PER_CLASS, image = "cockroachdb/cockroach:latest-v23.1", diff --git a/cockroachdb/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/CockroachdbLiquibaseMigrationPerMethodTests.java b/cockroachdb/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/CockroachdbLiquibaseMigrationPerMethodTests.java index b0f02c4..0ac269c 100644 --- a/cockroachdb/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/CockroachdbLiquibaseMigrationPerMethodTests.java +++ b/cockroachdb/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/CockroachdbLiquibaseMigrationPerMethodTests.java @@ -1,9 +1,12 @@ package io.goodforgod.testcontainers.extensions.jdbc; -import static org.junit.jupiter.api.Assertions.assertTrue; - import io.goodforgod.testcontainers.extensions.ContainerMode; -import org.junit.jupiter.api.*; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; + +import static org.junit.jupiter.api.Assertions.assertTrue; @TestcontainersCockroachdb(mode = ContainerMode.PER_CLASS, image = "cockroachdb/cockroach:latest-v23.1", diff --git a/common/src/main/java/io/goodforgod/testcontainers/extensions/AbstractContainerMetadata.java b/common/src/main/java/io/goodforgod/testcontainers/extensions/AbstractContainerMetadata.java index 9eeb61c..c5dfc35 100644 --- a/common/src/main/java/io/goodforgod/testcontainers/extensions/AbstractContainerMetadata.java +++ b/common/src/main/java/io/goodforgod/testcontainers/extensions/AbstractContainerMetadata.java @@ -1,10 +1,11 @@ package io.goodforgod.testcontainers.extensions; -import java.util.Optional; import org.jetbrains.annotations.ApiStatus.Internal; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.util.Optional; + @Internal public abstract class AbstractContainerMetadata implements ContainerMetadata { diff --git a/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerFromAnnotationTests.java b/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerFromAnnotationTests.java index fed260d..0cff98d 100644 --- a/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerFromAnnotationTests.java +++ b/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerFromAnnotationTests.java @@ -1,7 +1,5 @@ package io.goodforgod.testcontainers.extensions; -import static org.junit.jupiter.api.Assertions.assertTrue; - import io.goodforgod.testcontainers.extensions.example.*; import org.junit.jupiter.api.MethodOrderer; import org.junit.jupiter.api.Test; @@ -9,6 +7,8 @@ import org.slf4j.LoggerFactory; import org.testcontainers.containers.output.Slf4jLogConsumer; +import static org.junit.jupiter.api.Assertions.assertTrue; + @TestcontainersRedis(mode = ContainerMode.PER_METHOD) @TestMethodOrder(MethodOrderer.OrderAnnotation.class) class ContainerFromAnnotationTests { diff --git a/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerClassAbstractTests.java b/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerClassAbstractTests.java index 65afcfd..8cbfc49 100644 --- a/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerClassAbstractTests.java +++ b/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerClassAbstractTests.java @@ -1,7 +1,5 @@ package io.goodforgod.testcontainers.extensions; -import static org.junit.jupiter.api.Assertions.*; - import io.goodforgod.testcontainers.extensions.example.ContainerRedisConnection; import io.goodforgod.testcontainers.extensions.example.RedisConnection; import io.goodforgod.testcontainers.extensions.example.TestcontainersRedis; @@ -10,6 +8,8 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; +import static org.junit.jupiter.api.Assertions.*; + @TestcontainersRedis(mode = ContainerMode.PER_CLASS, image = "redis:7.2-alpine") abstract class ContainerPerClassAbstractTests { diff --git a/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerClassConstructorTests.java b/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerClassConstructorTests.java index e1a4f9e..b678c53 100644 --- a/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerClassConstructorTests.java +++ b/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerClassConstructorTests.java @@ -1,12 +1,12 @@ package io.goodforgod.testcontainers.extensions; -import static org.junit.jupiter.api.Assertions.*; - import io.goodforgod.testcontainers.extensions.example.ContainerRedisConnection; import io.goodforgod.testcontainers.extensions.example.RedisConnection; import io.goodforgod.testcontainers.extensions.example.TestcontainersRedis; import org.junit.jupiter.api.*; +import static org.junit.jupiter.api.Assertions.*; + @TestcontainersRedis(mode = ContainerMode.PER_CLASS, image = "redis:7.2-alpine", network = @Network(shared = false, alias = "my_alias")) diff --git a/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerClassInstanceClassTests.java b/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerClassInstanceClassTests.java index 0bb9858..327c303 100644 --- a/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerClassInstanceClassTests.java +++ b/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerClassInstanceClassTests.java @@ -1,12 +1,12 @@ package io.goodforgod.testcontainers.extensions; -import static org.junit.jupiter.api.Assertions.*; - import io.goodforgod.testcontainers.extensions.example.ContainerRedisConnection; import io.goodforgod.testcontainers.extensions.example.RedisConnection; import io.goodforgod.testcontainers.extensions.example.TestcontainersRedis; import org.junit.jupiter.api.*; +import static org.junit.jupiter.api.Assertions.*; + @TestcontainersRedis(mode = ContainerMode.PER_CLASS, image = "${MY_IMAGE_ENV}", network = @Network(shared = false, alias = "${MY_ALIAS_ENV}")) diff --git a/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerClassInstanceMethodTests.java b/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerClassInstanceMethodTests.java index f8c34be..755015d 100644 --- a/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerClassInstanceMethodTests.java +++ b/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerClassInstanceMethodTests.java @@ -1,12 +1,12 @@ package io.goodforgod.testcontainers.extensions; -import static org.junit.jupiter.api.Assertions.*; - import io.goodforgod.testcontainers.extensions.example.ContainerRedisConnection; import io.goodforgod.testcontainers.extensions.example.RedisConnection; import io.goodforgod.testcontainers.extensions.example.TestcontainersRedis; import org.junit.jupiter.api.*; +import static org.junit.jupiter.api.Assertions.*; + @TestcontainersRedis(mode = ContainerMode.PER_CLASS, image = "${MY_IMAGE_ENV_EMPTY|redis:7.2-alpine}", network = @Network(shared = false, alias = "${MY_ALIAS_ENV_EMPTY|my_default_alias}")) diff --git a/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerMethodConstructorTests.java b/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerMethodConstructorTests.java index 56bd9b1..5dcb115 100644 --- a/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerMethodConstructorTests.java +++ b/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerMethodConstructorTests.java @@ -1,12 +1,12 @@ package io.goodforgod.testcontainers.extensions; -import static org.junit.jupiter.api.Assertions.*; - import io.goodforgod.testcontainers.extensions.example.ContainerRedisConnection; import io.goodforgod.testcontainers.extensions.example.RedisConnection; import io.goodforgod.testcontainers.extensions.example.TestcontainersRedis; import org.junit.jupiter.api.*; +import static org.junit.jupiter.api.Assertions.*; + @TestcontainersRedis(mode = ContainerMode.PER_METHOD, image = "redis:7.2-alpine") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @TestInstance(TestInstance.Lifecycle.PER_METHOD) diff --git a/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerMethodInstanceClassTests.java b/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerMethodInstanceClassTests.java index 9bb2b5f..340a604 100644 --- a/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerMethodInstanceClassTests.java +++ b/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerMethodInstanceClassTests.java @@ -1,12 +1,12 @@ package io.goodforgod.testcontainers.extensions; -import static org.junit.jupiter.api.Assertions.*; - import io.goodforgod.testcontainers.extensions.example.ContainerRedisConnection; import io.goodforgod.testcontainers.extensions.example.RedisConnection; import io.goodforgod.testcontainers.extensions.example.TestcontainersRedis; import org.junit.jupiter.api.*; +import static org.junit.jupiter.api.Assertions.*; + @TestcontainersRedis(mode = ContainerMode.PER_METHOD, image = "redis:7.2-alpine") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @TestInstance(TestInstance.Lifecycle.PER_CLASS) diff --git a/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerMethodInstanceMethodTests.java b/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerMethodInstanceMethodTests.java index 5d5c4f9..6c93d93 100644 --- a/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerMethodInstanceMethodTests.java +++ b/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerMethodInstanceMethodTests.java @@ -1,12 +1,12 @@ package io.goodforgod.testcontainers.extensions; -import static org.junit.jupiter.api.Assertions.*; - import io.goodforgod.testcontainers.extensions.example.ContainerRedisConnection; import io.goodforgod.testcontainers.extensions.example.RedisConnection; import io.goodforgod.testcontainers.extensions.example.TestcontainersRedis; import org.junit.jupiter.api.*; +import static org.junit.jupiter.api.Assertions.*; + @TestcontainersRedis(mode = ContainerMode.PER_METHOD, image = "redis:7.2-alpine") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) @TestInstance(TestInstance.Lifecycle.PER_METHOD) diff --git a/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerRunFirstTests.java b/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerRunFirstTests.java index a0dfa5d..7d6a127 100644 --- a/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerRunFirstTests.java +++ b/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerRunFirstTests.java @@ -1,8 +1,5 @@ package io.goodforgod.testcontainers.extensions; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; - import io.goodforgod.testcontainers.extensions.example.ContainerRedisConnection; import io.goodforgod.testcontainers.extensions.example.RedisConnection; import io.goodforgod.testcontainers.extensions.example.TestcontainersRedis; @@ -11,6 +8,9 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + @TestcontainersRedis(mode = ContainerMode.PER_RUN, image = "redis:7.2-alpine") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) class ContainerPerRunFirstTests { diff --git a/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerRunSecondTests.java b/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerRunSecondTests.java index 4aa9d6e..91c3705 100644 --- a/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerRunSecondTests.java +++ b/common/src/test/java/io/goodforgod/testcontainers/extensions/ContainerPerRunSecondTests.java @@ -1,8 +1,5 @@ package io.goodforgod.testcontainers.extensions; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; - import io.goodforgod.testcontainers.extensions.example.ContainerRedisConnection; import io.goodforgod.testcontainers.extensions.example.RedisConnection; import io.goodforgod.testcontainers.extensions.example.TestcontainersRedis; @@ -11,6 +8,9 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestMethodOrder; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + @TestcontainersRedis(mode = ContainerMode.PER_RUN, image = "redis:7.2-alpine") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) class ContainerPerRunSecondTests { diff --git a/common/src/test/java/io/goodforgod/testcontainers/extensions/example/RedisConnection.java b/common/src/test/java/io/goodforgod/testcontainers/extensions/example/RedisConnection.java index e899b31..87f884f 100644 --- a/common/src/test/java/io/goodforgod/testcontainers/extensions/example/RedisConnection.java +++ b/common/src/test/java/io/goodforgod/testcontainers/extensions/example/RedisConnection.java @@ -1,8 +1,9 @@ package io.goodforgod.testcontainers.extensions.example; +import org.jetbrains.annotations.NotNull; + import java.net.URI; import java.util.Optional; -import org.jetbrains.annotations.NotNull; /** * Describes active Redis connection of currently running {@link RedisContainer} diff --git a/common/src/test/java/io/goodforgod/testcontainers/extensions/example/RedisConnectionImpl.java b/common/src/test/java/io/goodforgod/testcontainers/extensions/example/RedisConnectionImpl.java index a273779..0a410f4 100644 --- a/common/src/test/java/io/goodforgod/testcontainers/extensions/example/RedisConnectionImpl.java +++ b/common/src/test/java/io/goodforgod/testcontainers/extensions/example/RedisConnectionImpl.java @@ -1,8 +1,5 @@ package io.goodforgod.testcontainers.extensions.example; -import java.net.URI; -import java.time.Duration; -import java.util.*; import org.jetbrains.annotations.NotNull; import redis.clients.jedis.DefaultJedisClientConfig; import redis.clients.jedis.HostAndPort; @@ -10,6 +7,11 @@ import redis.clients.jedis.Protocol; import redis.clients.jedis.args.FlushMode; +import java.net.URI; +import java.time.Duration; +import java.util.Objects; +import java.util.Optional; + final class RedisConnectionImpl implements RedisConnection { private static final class ParamsImpl implements Params { diff --git a/common/src/test/java/io/goodforgod/testcontainers/extensions/example/RedisContainer.java b/common/src/test/java/io/goodforgod/testcontainers/extensions/example/RedisContainer.java index 00aec5d..f884738 100644 --- a/common/src/test/java/io/goodforgod/testcontainers/extensions/example/RedisContainer.java +++ b/common/src/test/java/io/goodforgod/testcontainers/extensions/example/RedisContainer.java @@ -1,10 +1,11 @@ package io.goodforgod.testcontainers.extensions.example; -import java.time.Duration; import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.utility.DockerImageName; +import java.time.Duration; + public final class RedisContainer extends GenericContainer { public static final Integer PORT = 6379; diff --git a/common/src/test/java/io/goodforgod/testcontainers/extensions/example/TestcontainersRedis.java b/common/src/test/java/io/goodforgod/testcontainers/extensions/example/TestcontainersRedis.java index a005198..7b8be10 100644 --- a/common/src/test/java/io/goodforgod/testcontainers/extensions/example/TestcontainersRedis.java +++ b/common/src/test/java/io/goodforgod/testcontainers/extensions/example/TestcontainersRedis.java @@ -2,10 +2,11 @@ import io.goodforgod.testcontainers.extensions.ContainerMode; import io.goodforgod.testcontainers.extensions.Network; -import java.lang.annotation.*; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.extension.ExtendWith; +import java.lang.annotation.*; + /** * Extension that is running {@link RedisContainer} for tests in different modes with database * schema migration support between test executions diff --git a/common/src/test/java/io/goodforgod/testcontainers/extensions/example/TestcontainersRedisExtension.java b/common/src/test/java/io/goodforgod/testcontainers/extensions/example/TestcontainersRedisExtension.java index a30cbfa..15a9bd2 100644 --- a/common/src/test/java/io/goodforgod/testcontainers/extensions/example/TestcontainersRedisExtension.java +++ b/common/src/test/java/io/goodforgod/testcontainers/extensions/example/TestcontainersRedisExtension.java @@ -1,9 +1,6 @@ package io.goodforgod.testcontainers.extensions.example; import io.goodforgod.testcontainers.extensions.AbstractTestcontainersExtension; -import java.lang.annotation.Annotation; -import java.time.Duration; -import java.util.Optional; import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.extension.ExtensionContext; import org.slf4j.LoggerFactory; @@ -12,6 +9,10 @@ import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.utility.DockerImageName; +import java.lang.annotation.Annotation; +import java.time.Duration; +import java.util.Optional; + class TestcontainersRedisExtension extends AbstractTestcontainersExtension { private static final ExtensionContext.Namespace NAMESPACE = ExtensionContext.Namespace diff --git a/jdbc/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/AbstractTestcontainersJdbcExtension.java b/jdbc/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/AbstractTestcontainersJdbcExtension.java index f51a467..a30790e 100644 --- a/jdbc/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/AbstractTestcontainersJdbcExtension.java +++ b/jdbc/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/AbstractTestcontainersJdbcExtension.java @@ -1,11 +1,6 @@ package io.goodforgod.testcontainers.extensions.jdbc; import io.goodforgod.testcontainers.extensions.AbstractTestcontainersExtension; -import java.io.FileWriter; -import java.io.Writer; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.util.*; import liquibase.Contexts; import liquibase.LabelExpression; import liquibase.Liquibase; @@ -14,10 +9,18 @@ import liquibase.resource.ClassLoaderResourceAccessor; import org.flywaydb.core.Flyway; import org.jetbrains.annotations.ApiStatus.Internal; -import org.junit.jupiter.api.extension.*; +import org.junit.jupiter.api.extension.ExtensionContext; import org.slf4j.bridge.SLF4JBridgeHandler; import org.testcontainers.containers.JdbcDatabaseContainer; +import java.io.FileWriter; +import java.io.Writer; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.util.Arrays; +import java.util.List; +import java.util.Optional; + @Internal abstract class AbstractTestcontainersJdbcExtension, Metadata extends JdbcMetadata> extends diff --git a/jdbc/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/JdbcConnection.java b/jdbc/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/JdbcConnection.java index a247bc4..c8b19e2 100644 --- a/jdbc/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/JdbcConnection.java +++ b/jdbc/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/JdbcConnection.java @@ -1,13 +1,14 @@ package io.goodforgod.testcontainers.extensions.jdbc; +import org.intellij.lang.annotations.Language; +import org.jetbrains.annotations.NotNull; +import org.testcontainers.containers.JdbcDatabaseContainer; + import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.util.List; import java.util.Optional; -import org.intellij.lang.annotations.Language; -import org.jetbrains.annotations.NotNull; -import org.testcontainers.containers.JdbcDatabaseContainer; /** * Describes active JDBC connection of currently running {@link JdbcDatabaseContainer} diff --git a/jdbc/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/JdbcConnectionImpl.java b/jdbc/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/JdbcConnectionImpl.java index de37ad9..97ce0c0 100644 --- a/jdbc/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/JdbcConnectionImpl.java +++ b/jdbc/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/JdbcConnectionImpl.java @@ -1,5 +1,12 @@ package io.goodforgod.testcontainers.extensions.jdbc; +import org.intellij.lang.annotations.Language; +import org.jetbrains.annotations.ApiStatus.Internal; +import org.jetbrains.annotations.NotNull; +import org.junit.jupiter.api.Assertions; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.net.URI; import java.nio.charset.StandardCharsets; import java.sql.Connection; @@ -10,12 +17,6 @@ import java.util.List; import java.util.Objects; import java.util.Optional; -import org.intellij.lang.annotations.Language; -import org.jetbrains.annotations.ApiStatus.Internal; -import org.jetbrains.annotations.NotNull; -import org.junit.jupiter.api.Assertions; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; @Internal final class JdbcConnectionImpl implements JdbcConnection { diff --git a/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/ExampleTestcontainersJdbcExtension.java b/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/ExampleTestcontainersJdbcExtension.java index d82cc38..6d676d3 100644 --- a/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/ExampleTestcontainersJdbcExtension.java +++ b/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/ExampleTestcontainersJdbcExtension.java @@ -3,8 +3,6 @@ import io.goodforgod.testcontainers.extensions.jdbc.example.ContainerJdbc; import io.goodforgod.testcontainers.extensions.jdbc.example.ContainerJdbcConnection; import io.goodforgod.testcontainers.extensions.jdbc.example.TestcontainersJdbc; -import java.lang.annotation.Annotation; -import java.util.Optional; import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.extension.ExtensionContext; import org.slf4j.LoggerFactory; @@ -12,6 +10,9 @@ import org.testcontainers.containers.output.Slf4jLogConsumer; import org.testcontainers.utility.DockerImageName; +import java.lang.annotation.Annotation; +import java.util.Optional; + public final class ExampleTestcontainersJdbcExtension extends AbstractTestcontainersJdbcExtension, PostgresJdbcMetadata> { diff --git a/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/FlywayPerClassMigrationTests.java b/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/FlywayPerClassMigrationTests.java index fcaa2d7..68d8e01 100644 --- a/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/FlywayPerClassMigrationTests.java +++ b/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/FlywayPerClassMigrationTests.java @@ -1,11 +1,14 @@ package io.goodforgod.testcontainers.extensions.jdbc; -import static org.junit.jupiter.api.Assertions.assertEquals; - import io.goodforgod.testcontainers.extensions.ContainerMode; import io.goodforgod.testcontainers.extensions.jdbc.example.ContainerJdbcConnection; import io.goodforgod.testcontainers.extensions.jdbc.example.TestcontainersJdbc; -import org.junit.jupiter.api.*; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; + +import static org.junit.jupiter.api.Assertions.assertEquals; @TestcontainersJdbc(mode = ContainerMode.PER_CLASS, image = "postgres:15.2-alpine", diff --git a/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/FlywayPerMethodMigrationTests.java b/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/FlywayPerMethodMigrationTests.java index 33671cd..5a08f81 100644 --- a/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/FlywayPerMethodMigrationTests.java +++ b/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/FlywayPerMethodMigrationTests.java @@ -1,11 +1,14 @@ package io.goodforgod.testcontainers.extensions.jdbc; -import static org.junit.jupiter.api.Assertions.assertTrue; - import io.goodforgod.testcontainers.extensions.ContainerMode; import io.goodforgod.testcontainers.extensions.jdbc.example.ContainerJdbcConnection; import io.goodforgod.testcontainers.extensions.jdbc.example.TestcontainersJdbc; -import org.junit.jupiter.api.*; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; + +import static org.junit.jupiter.api.Assertions.assertTrue; @TestcontainersJdbc(mode = ContainerMode.PER_CLASS, image = "postgres:15.1-alpine", diff --git a/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/JdbcConnectionAssertsTests.java b/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/JdbcConnectionAssertsTests.java index 85965ea..360502c 100644 --- a/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/JdbcConnectionAssertsTests.java +++ b/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/JdbcConnectionAssertsTests.java @@ -1,13 +1,13 @@ package io.goodforgod.testcontainers.extensions.jdbc; -import static org.junit.jupiter.api.Assertions.*; - import io.goodforgod.testcontainers.extensions.ContainerMode; import io.goodforgod.testcontainers.extensions.jdbc.example.ContainerJdbcConnection; import io.goodforgod.testcontainers.extensions.jdbc.example.TestcontainersJdbc; import org.junit.jupiter.api.Test; import org.opentest4j.AssertionFailedError; +import static org.junit.jupiter.api.Assertions.*; + @TestcontainersJdbc(mode = ContainerMode.PER_CLASS, image = "postgres:15.2-alpine", migration = @Migration( diff --git a/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/JdbcContainerFromAnnotationTests.java b/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/JdbcContainerFromAnnotationTests.java index cbc2357..14a954b 100644 --- a/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/JdbcContainerFromAnnotationTests.java +++ b/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/JdbcContainerFromAnnotationTests.java @@ -1,7 +1,5 @@ package io.goodforgod.testcontainers.extensions.jdbc; -import static org.junit.jupiter.api.Assertions.assertEquals; - import io.goodforgod.testcontainers.extensions.ContainerMode; import io.goodforgod.testcontainers.extensions.jdbc.example.ContainerJdbc; import io.goodforgod.testcontainers.extensions.jdbc.example.ContainerJdbcConnection; @@ -13,6 +11,8 @@ import org.testcontainers.containers.PostgreSQLContainer; import org.testcontainers.containers.output.Slf4jLogConsumer; +import static org.junit.jupiter.api.Assertions.assertEquals; + @TestcontainersJdbc(mode = ContainerMode.PER_METHOD, image = "postgres:15.2-alpine") @TestMethodOrder(MethodOrderer.OrderAnnotation.class) class JdbcContainerFromAnnotationTests { diff --git a/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/LiquibaseMigrationPerClassTests.java b/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/LiquibaseMigrationPerClassTests.java index 87e4bad..be505cf 100644 --- a/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/LiquibaseMigrationPerClassTests.java +++ b/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/LiquibaseMigrationPerClassTests.java @@ -1,11 +1,14 @@ package io.goodforgod.testcontainers.extensions.jdbc; -import static org.junit.jupiter.api.Assertions.assertEquals; - import io.goodforgod.testcontainers.extensions.ContainerMode; import io.goodforgod.testcontainers.extensions.jdbc.example.ContainerJdbcConnection; import io.goodforgod.testcontainers.extensions.jdbc.example.TestcontainersJdbc; -import org.junit.jupiter.api.*; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; + +import static org.junit.jupiter.api.Assertions.assertEquals; @TestcontainersJdbc(mode = ContainerMode.PER_CLASS, image = "postgres:15.2-alpine", diff --git a/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/LiquibaseMigrationPerMethodTests.java b/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/LiquibaseMigrationPerMethodTests.java index 384f5bb..aa63700 100644 --- a/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/LiquibaseMigrationPerMethodTests.java +++ b/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/LiquibaseMigrationPerMethodTests.java @@ -1,11 +1,14 @@ package io.goodforgod.testcontainers.extensions.jdbc; -import static org.junit.jupiter.api.Assertions.assertTrue; - import io.goodforgod.testcontainers.extensions.ContainerMode; import io.goodforgod.testcontainers.extensions.jdbc.example.ContainerJdbcConnection; import io.goodforgod.testcontainers.extensions.jdbc.example.TestcontainersJdbc; -import org.junit.jupiter.api.*; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; + +import static org.junit.jupiter.api.Assertions.assertTrue; @TestcontainersJdbc(mode = ContainerMode.PER_CLASS, image = "postgres:15.1-alpine", diff --git a/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/example/ContainerJdbc.java b/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/example/ContainerJdbc.java index f589cd8..7825b39 100644 --- a/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/example/ContainerJdbc.java +++ b/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/example/ContainerJdbc.java @@ -1,8 +1,9 @@ package io.goodforgod.testcontainers.extensions.jdbc.example; -import java.lang.annotation.*; import org.testcontainers.containers.JdbcDatabaseContainer; +import java.lang.annotation.*; + /** * Indicates that already instantiated annotated field with type {@link JdbcDatabaseContainer} * should be used by extension rather than creating default one diff --git a/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/example/ContainerJdbcConnection.java b/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/example/ContainerJdbcConnection.java index ad3578b..49601e5 100644 --- a/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/example/ContainerJdbcConnection.java +++ b/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/example/ContainerJdbcConnection.java @@ -1,6 +1,7 @@ package io.goodforgod.testcontainers.extensions.jdbc.example; import io.goodforgod.testcontainers.extensions.jdbc.JdbcConnection; + import java.lang.annotation.*; /** diff --git a/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/example/TestcontainersJdbc.java b/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/example/TestcontainersJdbc.java index 091c0c9..ab522b1 100644 --- a/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/example/TestcontainersJdbc.java +++ b/jdbc/src/test/java/io/goodforgod/testcontainers/extensions/jdbc/example/TestcontainersJdbc.java @@ -3,10 +3,11 @@ import io.goodforgod.testcontainers.extensions.ContainerMode; import io.goodforgod.testcontainers.extensions.jdbc.ExampleTestcontainersJdbcExtension; import io.goodforgod.testcontainers.extensions.jdbc.Migration; -import java.lang.annotation.*; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.extension.ExtendWith; +import java.lang.annotation.*; + @Order(Order.DEFAULT - 100) // Run before other extensions @ExtendWith(ExampleTestcontainersJdbcExtension.class) @Documented diff --git a/kafka/src/main/java/io/goodforgod/testcontainers/extensions/kafka/KafkaConnection.java b/kafka/src/main/java/io/goodforgod/testcontainers/extensions/kafka/KafkaConnection.java index 6992cf7..fd9d8dd 100644 --- a/kafka/src/main/java/io/goodforgod/testcontainers/extensions/kafka/KafkaConnection.java +++ b/kafka/src/main/java/io/goodforgod/testcontainers/extensions/kafka/KafkaConnection.java @@ -1,7 +1,10 @@ package io.goodforgod.testcontainers.extensions.kafka; import java.time.Duration; -import java.util.*; +import java.util.List; +import java.util.Optional; +import java.util.Properties; +import java.util.Set; import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.Assertions; import org.opentest4j.AssertionFailedError; diff --git a/kafka/src/test/java/io/goodforgod/testcontainers/extensions/kafka/KafkaConnectionTopicResetTests.java b/kafka/src/test/java/io/goodforgod/testcontainers/extensions/kafka/KafkaConnectionTopicResetTests.java index 4120856..ed68715 100644 --- a/kafka/src/test/java/io/goodforgod/testcontainers/extensions/kafka/KafkaConnectionTopicResetTests.java +++ b/kafka/src/test/java/io/goodforgod/testcontainers/extensions/kafka/KafkaConnectionTopicResetTests.java @@ -1,12 +1,15 @@ package io.goodforgod.testcontainers.extensions.kafka; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertTrue; import io.goodforgod.testcontainers.extensions.ContainerMode; import io.goodforgod.testcontainers.extensions.kafka.ContainerKafkaConnection.Property; import java.time.Duration; import org.apache.kafka.clients.consumer.ConsumerConfig; -import org.junit.jupiter.api.*; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; @TestcontainersKafka(mode = ContainerMode.PER_CLASS, image = "confluentinc/cp-kafka:7.4.1", diff --git a/mariadb/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/ContainerMariadb.java b/mariadb/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/ContainerMariadb.java index e5c43e8..cc93f3d 100644 --- a/mariadb/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/ContainerMariadb.java +++ b/mariadb/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/ContainerMariadb.java @@ -1,8 +1,9 @@ package io.goodforgod.testcontainers.extensions.jdbc; -import java.lang.annotation.*; import org.testcontainers.containers.MariaDBContainer; +import java.lang.annotation.*; + /** * Indicates that annotated field containers {@link MariaDBContainer} instance * that should be used by {@link TestcontainersMariadb} rather than creating default container diff --git a/mariadb/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersMariadb.java b/mariadb/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersMariadb.java index 52d3a19..0a563a5 100644 --- a/mariadb/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersMariadb.java +++ b/mariadb/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersMariadb.java @@ -2,11 +2,12 @@ import io.goodforgod.testcontainers.extensions.ContainerMode; import io.goodforgod.testcontainers.extensions.Network; -import java.lang.annotation.*; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.extension.ExtendWith; import org.testcontainers.containers.MariaDBContainer; +import java.lang.annotation.*; + /** * Extension that is running {@link MariaDBContainer} for tests in different modes with database * schema migration support between test executions diff --git a/mariadb/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersMariadbExtension.java b/mariadb/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersMariadbExtension.java index 5939e03..e8babbe 100644 --- a/mariadb/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersMariadbExtension.java +++ b/mariadb/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersMariadbExtension.java @@ -1,10 +1,5 @@ package io.goodforgod.testcontainers.extensions.jdbc; -import java.lang.annotation.Annotation; -import java.time.Duration; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.extension.ExtensionContext; import org.slf4j.LoggerFactory; @@ -14,6 +9,12 @@ import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.utility.DockerImageName; +import java.lang.annotation.Annotation; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + final class TestcontainersMariadbExtension extends AbstractTestcontainersJdbcExtension, MariadbMetadata> { private static final ExtensionContext.Namespace NAMESPACE = ExtensionContext.Namespace diff --git a/mariadb/src/test/java/io/goodforgod/testcontainers/extensions/mariadb/MariadbFlywayPerMethodMigrationTests.java b/mariadb/src/test/java/io/goodforgod/testcontainers/extensions/mariadb/MariadbFlywayPerMethodMigrationTests.java index 0ff5019..c8a1394 100644 --- a/mariadb/src/test/java/io/goodforgod/testcontainers/extensions/mariadb/MariadbFlywayPerMethodMigrationTests.java +++ b/mariadb/src/test/java/io/goodforgod/testcontainers/extensions/mariadb/MariadbFlywayPerMethodMigrationTests.java @@ -1,13 +1,16 @@ package io.goodforgod.testcontainers.extensions.mariadb; -import static org.junit.jupiter.api.Assertions.assertTrue; - import io.goodforgod.testcontainers.extensions.ContainerMode; import io.goodforgod.testcontainers.extensions.jdbc.ContainerMariadbConnection; import io.goodforgod.testcontainers.extensions.jdbc.JdbcConnection; import io.goodforgod.testcontainers.extensions.jdbc.Migration; import io.goodforgod.testcontainers.extensions.jdbc.TestcontainersMariadb; -import org.junit.jupiter.api.*; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; + +import static org.junit.jupiter.api.Assertions.assertTrue; @TestcontainersMariadb(mode = ContainerMode.PER_CLASS, image = "mariadb:11.0-jammy", diff --git a/mariadb/src/test/java/io/goodforgod/testcontainers/extensions/mariadb/MariadbLiquibaseMigrationPerMethodTests.java b/mariadb/src/test/java/io/goodforgod/testcontainers/extensions/mariadb/MariadbLiquibaseMigrationPerMethodTests.java index 9974800..cc3f53b 100644 --- a/mariadb/src/test/java/io/goodforgod/testcontainers/extensions/mariadb/MariadbLiquibaseMigrationPerMethodTests.java +++ b/mariadb/src/test/java/io/goodforgod/testcontainers/extensions/mariadb/MariadbLiquibaseMigrationPerMethodTests.java @@ -1,13 +1,16 @@ package io.goodforgod.testcontainers.extensions.mariadb; -import static org.junit.jupiter.api.Assertions.assertTrue; - import io.goodforgod.testcontainers.extensions.ContainerMode; import io.goodforgod.testcontainers.extensions.jdbc.ContainerMariadbConnection; import io.goodforgod.testcontainers.extensions.jdbc.JdbcConnection; import io.goodforgod.testcontainers.extensions.jdbc.Migration; import io.goodforgod.testcontainers.extensions.jdbc.TestcontainersMariadb; -import org.junit.jupiter.api.*; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; + +import static org.junit.jupiter.api.Assertions.assertTrue; @TestcontainersMariadb(mode = ContainerMode.PER_CLASS, image = "mariadb:11.0-jammy", diff --git a/mysql/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/ContainerMysql.java b/mysql/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/ContainerMysql.java index 9249514..c035792 100644 --- a/mysql/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/ContainerMysql.java +++ b/mysql/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/ContainerMysql.java @@ -1,8 +1,9 @@ package io.goodforgod.testcontainers.extensions.jdbc; -import java.lang.annotation.*; import org.testcontainers.containers.MySQLContainer; +import java.lang.annotation.*; + /** * Indicates that annotated field containers {@link MySQLContainer} instance * that should be used by {@link TestcontainersMysql} rather than creating default container diff --git a/mysql/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersMysql.java b/mysql/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersMysql.java index c718f71..2f5e451 100644 --- a/mysql/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersMysql.java +++ b/mysql/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersMysql.java @@ -2,11 +2,12 @@ import io.goodforgod.testcontainers.extensions.ContainerMode; import io.goodforgod.testcontainers.extensions.Network; -import java.lang.annotation.*; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.extension.ExtendWith; import org.testcontainers.containers.MySQLContainer; +import java.lang.annotation.*; + /** * Extension that is running {@link MySQLContainer} for tests in different modes with database * schema migration support between test executions diff --git a/mysql/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersMysqlExtension.java b/mysql/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersMysqlExtension.java index fe019ba..02ec419 100644 --- a/mysql/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersMysqlExtension.java +++ b/mysql/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersMysqlExtension.java @@ -1,10 +1,5 @@ package io.goodforgod.testcontainers.extensions.jdbc; -import java.lang.annotation.Annotation; -import java.time.Duration; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.extension.ExtensionContext; import org.slf4j.LoggerFactory; @@ -14,6 +9,12 @@ import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.utility.DockerImageName; +import java.lang.annotation.Annotation; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + final class TestcontainersMysqlExtension extends AbstractTestcontainersJdbcExtension, MysqlMetadata> { private static final ExtensionContext.Namespace NAMESPACE = ExtensionContext.Namespace diff --git a/mysql/src/test/java/io/goodforgod/testcontainers/extensions/mysql/MysqlFlywayPerMethodMigrationTests.java b/mysql/src/test/java/io/goodforgod/testcontainers/extensions/mysql/MysqlFlywayPerMethodMigrationTests.java index 07e6b76..510c0c8 100644 --- a/mysql/src/test/java/io/goodforgod/testcontainers/extensions/mysql/MysqlFlywayPerMethodMigrationTests.java +++ b/mysql/src/test/java/io/goodforgod/testcontainers/extensions/mysql/MysqlFlywayPerMethodMigrationTests.java @@ -1,13 +1,16 @@ package io.goodforgod.testcontainers.extensions.mysql; -import static org.junit.jupiter.api.Assertions.assertTrue; - import io.goodforgod.testcontainers.extensions.ContainerMode; import io.goodforgod.testcontainers.extensions.jdbc.ContainerMysqlConnection; import io.goodforgod.testcontainers.extensions.jdbc.JdbcConnection; import io.goodforgod.testcontainers.extensions.jdbc.Migration; import io.goodforgod.testcontainers.extensions.jdbc.TestcontainersMysql; -import org.junit.jupiter.api.*; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; + +import static org.junit.jupiter.api.Assertions.assertTrue; @TestcontainersMysql(mode = ContainerMode.PER_CLASS, image = "mysql:8.0-debian", diff --git a/mysql/src/test/java/io/goodforgod/testcontainers/extensions/mysql/MysqlLiquibaseMigrationPerMethodTests.java b/mysql/src/test/java/io/goodforgod/testcontainers/extensions/mysql/MysqlLiquibaseMigrationPerMethodTests.java index aa81afc..9a4b34d 100644 --- a/mysql/src/test/java/io/goodforgod/testcontainers/extensions/mysql/MysqlLiquibaseMigrationPerMethodTests.java +++ b/mysql/src/test/java/io/goodforgod/testcontainers/extensions/mysql/MysqlLiquibaseMigrationPerMethodTests.java @@ -1,13 +1,16 @@ package io.goodforgod.testcontainers.extensions.mysql; -import static org.junit.jupiter.api.Assertions.assertTrue; - import io.goodforgod.testcontainers.extensions.ContainerMode; import io.goodforgod.testcontainers.extensions.jdbc.ContainerMysqlConnection; import io.goodforgod.testcontainers.extensions.jdbc.JdbcConnection; import io.goodforgod.testcontainers.extensions.jdbc.Migration; import io.goodforgod.testcontainers.extensions.jdbc.TestcontainersMysql; -import org.junit.jupiter.api.*; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; + +import static org.junit.jupiter.api.Assertions.assertTrue; @TestcontainersMysql(mode = ContainerMode.PER_CLASS, image = "mysql:8.0-debian", diff --git a/oracle/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/ContainerOracle.java b/oracle/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/ContainerOracle.java index 28eb8cc..462a30e 100644 --- a/oracle/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/ContainerOracle.java +++ b/oracle/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/ContainerOracle.java @@ -1,8 +1,9 @@ package io.goodforgod.testcontainers.extensions.jdbc; -import java.lang.annotation.*; import org.testcontainers.containers.OracleContainer; +import java.lang.annotation.*; + /** * Indicates that annotated field containers {@link OracleContainer} instance * that should be used by {@link TestcontainersOracle} rather than creating default container diff --git a/oracle/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersOracle.java b/oracle/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersOracle.java index 4d38549..0c62342 100644 --- a/oracle/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersOracle.java +++ b/oracle/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersOracle.java @@ -2,11 +2,12 @@ import io.goodforgod.testcontainers.extensions.ContainerMode; import io.goodforgod.testcontainers.extensions.Network; -import java.lang.annotation.*; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.extension.ExtendWith; import org.testcontainers.containers.OracleContainer; +import java.lang.annotation.*; + /** * Extension that is running {@link OracleContainer} for tests in different modes with database * schema migration support between test executions diff --git a/oracle/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersOracleExtension.java b/oracle/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersOracleExtension.java index 95bf9fd..40c28de 100644 --- a/oracle/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersOracleExtension.java +++ b/oracle/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersOracleExtension.java @@ -1,10 +1,5 @@ package io.goodforgod.testcontainers.extensions.jdbc; -import java.lang.annotation.Annotation; -import java.time.Duration; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.extension.ExtensionContext; import org.slf4j.LoggerFactory; @@ -13,6 +8,12 @@ import org.testcontainers.containers.output.Slf4jLogConsumer; import org.testcontainers.utility.DockerImageName; +import java.lang.annotation.Annotation; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + final class TestcontainersOracleExtension extends AbstractTestcontainersJdbcExtension { private static final ExtensionContext.Namespace NAMESPACE = ExtensionContext.Namespace diff --git a/oracle/src/test/java/io/goodforgod/testcontainers/extensions/oracle/OracleFlywayPerMethodMigrationTests.java b/oracle/src/test/java/io/goodforgod/testcontainers/extensions/oracle/OracleFlywayPerMethodMigrationTests.java index 38ef110..30bacbc 100644 --- a/oracle/src/test/java/io/goodforgod/testcontainers/extensions/oracle/OracleFlywayPerMethodMigrationTests.java +++ b/oracle/src/test/java/io/goodforgod/testcontainers/extensions/oracle/OracleFlywayPerMethodMigrationTests.java @@ -1,13 +1,16 @@ package io.goodforgod.testcontainers.extensions.oracle; -import static org.junit.jupiter.api.Assertions.assertTrue; - import io.goodforgod.testcontainers.extensions.ContainerMode; import io.goodforgod.testcontainers.extensions.jdbc.ContainerOracleConnection; import io.goodforgod.testcontainers.extensions.jdbc.JdbcConnection; import io.goodforgod.testcontainers.extensions.jdbc.Migration; import io.goodforgod.testcontainers.extensions.jdbc.TestcontainersOracle; -import org.junit.jupiter.api.*; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; + +import static org.junit.jupiter.api.Assertions.assertTrue; @TestcontainersOracle(mode = ContainerMode.PER_CLASS, image = "gvenzl/oracle-xe:18.4.0-faststart", diff --git a/oracle/src/test/java/io/goodforgod/testcontainers/extensions/oracle/OracleLiquibaseMigrationPerMethodTests.java b/oracle/src/test/java/io/goodforgod/testcontainers/extensions/oracle/OracleLiquibaseMigrationPerMethodTests.java index 15cda9f..04bb82c 100644 --- a/oracle/src/test/java/io/goodforgod/testcontainers/extensions/oracle/OracleLiquibaseMigrationPerMethodTests.java +++ b/oracle/src/test/java/io/goodforgod/testcontainers/extensions/oracle/OracleLiquibaseMigrationPerMethodTests.java @@ -1,13 +1,16 @@ package io.goodforgod.testcontainers.extensions.oracle; -import static org.junit.jupiter.api.Assertions.assertTrue; - import io.goodforgod.testcontainers.extensions.ContainerMode; import io.goodforgod.testcontainers.extensions.jdbc.ContainerOracleConnection; import io.goodforgod.testcontainers.extensions.jdbc.JdbcConnection; import io.goodforgod.testcontainers.extensions.jdbc.Migration; import io.goodforgod.testcontainers.extensions.jdbc.TestcontainersOracle; -import org.junit.jupiter.api.*; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; + +import static org.junit.jupiter.api.Assertions.assertTrue; @TestcontainersOracle(mode = ContainerMode.PER_CLASS, image = "gvenzl/oracle-xe:18.4.0-faststart", diff --git a/postgres/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/ContainerPostgres.java b/postgres/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/ContainerPostgres.java index f10d9c6..1ed2e64 100644 --- a/postgres/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/ContainerPostgres.java +++ b/postgres/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/ContainerPostgres.java @@ -1,8 +1,9 @@ package io.goodforgod.testcontainers.extensions.jdbc; -import java.lang.annotation.*; import org.testcontainers.containers.PostgreSQLContainer; +import java.lang.annotation.*; + /** * Indicates that annotated field containers {@link PostgreSQLContainer} instance * that should be used by {@link TestcontainersPostgres} rather than creating default container diff --git a/postgres/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersPostgres.java b/postgres/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersPostgres.java index fd8d546..32e37c2 100644 --- a/postgres/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersPostgres.java +++ b/postgres/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersPostgres.java @@ -2,11 +2,12 @@ import io.goodforgod.testcontainers.extensions.ContainerMode; import io.goodforgod.testcontainers.extensions.Network; -import java.lang.annotation.*; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.extension.ExtendWith; import org.testcontainers.containers.PostgreSQLContainer; +import java.lang.annotation.*; + /** * Extension that is running {@link PostgreSQLContainer} for tests in different modes with database * schema migration support between test executions diff --git a/postgres/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersPostgresExtension.java b/postgres/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersPostgresExtension.java index ff5ea94..a555be5 100644 --- a/postgres/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersPostgresExtension.java +++ b/postgres/src/main/java/io/goodforgod/testcontainers/extensions/jdbc/TestcontainersPostgresExtension.java @@ -1,10 +1,5 @@ package io.goodforgod.testcontainers.extensions.jdbc; -import java.lang.annotation.Annotation; -import java.time.Duration; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.extension.ExtensionContext; import org.slf4j.LoggerFactory; @@ -13,6 +8,12 @@ import org.testcontainers.containers.output.Slf4jLogConsumer; import org.testcontainers.utility.DockerImageName; +import java.lang.annotation.Annotation; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + final class TestcontainersPostgresExtension extends AbstractTestcontainersJdbcExtension, PostgresMetadata> { diff --git a/postgres/src/test/java/io/goodforgod/testcontainers/extensions/postgres/PostgresFlywayPerMethodMigrationTests.java b/postgres/src/test/java/io/goodforgod/testcontainers/extensions/postgres/PostgresFlywayPerMethodMigrationTests.java index 312f7a3..89c57cb 100644 --- a/postgres/src/test/java/io/goodforgod/testcontainers/extensions/postgres/PostgresFlywayPerMethodMigrationTests.java +++ b/postgres/src/test/java/io/goodforgod/testcontainers/extensions/postgres/PostgresFlywayPerMethodMigrationTests.java @@ -1,13 +1,16 @@ package io.goodforgod.testcontainers.extensions.postgres; -import static org.junit.jupiter.api.Assertions.assertTrue; - import io.goodforgod.testcontainers.extensions.ContainerMode; import io.goodforgod.testcontainers.extensions.jdbc.ContainerPostgresConnection; import io.goodforgod.testcontainers.extensions.jdbc.JdbcConnection; import io.goodforgod.testcontainers.extensions.jdbc.Migration; import io.goodforgod.testcontainers.extensions.jdbc.TestcontainersPostgres; -import org.junit.jupiter.api.*; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; + +import static org.junit.jupiter.api.Assertions.assertTrue; @TestcontainersPostgres(mode = ContainerMode.PER_CLASS, image = "postgres:15.3-alpine", diff --git a/postgres/src/test/java/io/goodforgod/testcontainers/extensions/postgres/PostgresLiquibaseMigrationPerMethodTests.java b/postgres/src/test/java/io/goodforgod/testcontainers/extensions/postgres/PostgresLiquibaseMigrationPerMethodTests.java index b0f04a7..5c3fc88 100644 --- a/postgres/src/test/java/io/goodforgod/testcontainers/extensions/postgres/PostgresLiquibaseMigrationPerMethodTests.java +++ b/postgres/src/test/java/io/goodforgod/testcontainers/extensions/postgres/PostgresLiquibaseMigrationPerMethodTests.java @@ -1,13 +1,16 @@ package io.goodforgod.testcontainers.extensions.postgres; -import static org.junit.jupiter.api.Assertions.assertTrue; - import io.goodforgod.testcontainers.extensions.ContainerMode; import io.goodforgod.testcontainers.extensions.jdbc.ContainerPostgresConnection; import io.goodforgod.testcontainers.extensions.jdbc.JdbcConnection; import io.goodforgod.testcontainers.extensions.jdbc.Migration; import io.goodforgod.testcontainers.extensions.jdbc.TestcontainersPostgres; -import org.junit.jupiter.api.*; +import org.junit.jupiter.api.MethodOrderer; +import org.junit.jupiter.api.Order; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestMethodOrder; + +import static org.junit.jupiter.api.Assertions.assertTrue; @TestcontainersPostgres(mode = ContainerMode.PER_CLASS, image = "postgres:15.3-alpine", diff --git a/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/RedisConnection.java b/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/RedisConnection.java index b302f6d..d0f3556 100644 --- a/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/RedisConnection.java +++ b/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/RedisConnection.java @@ -1,10 +1,11 @@ package io.goodforgod.testcontainers.extensions.redis; +import org.jetbrains.annotations.NotNull; + import java.net.URI; import java.util.Collection; import java.util.List; import java.util.Optional; -import org.jetbrains.annotations.NotNull; /** * Describes active Redis connection of currently running {@link RedisContainer} diff --git a/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/RedisConnectionImpl.java b/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/RedisConnectionImpl.java index 111b8e0..c0cfc2f 100644 --- a/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/RedisConnectionImpl.java +++ b/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/RedisConnectionImpl.java @@ -1,18 +1,21 @@ package io.goodforgod.testcontainers.extensions.redis; -import java.net.URI; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import java.util.*; -import java.util.stream.Collectors; import org.jetbrains.annotations.ApiStatus.Internal; import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.Assertions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import redis.clients.jedis.*; +import redis.clients.jedis.DefaultJedisClientConfig; +import redis.clients.jedis.HostAndPort; +import redis.clients.jedis.Protocol; import redis.clients.jedis.args.FlushMode; +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.*; +import java.util.stream.Collectors; + @Internal final class RedisConnectionImpl implements RedisConnection { diff --git a/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/RedisContainer.java b/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/RedisContainer.java index 608aef5..16a2c26 100644 --- a/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/RedisContainer.java +++ b/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/RedisContainer.java @@ -1,10 +1,11 @@ package io.goodforgod.testcontainers.extensions.redis; -import java.time.Duration; import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.utility.DockerImageName; +import java.time.Duration; + public final class RedisContainer extends GenericContainer { public static final Integer PORT = 6379; diff --git a/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/RedisKey.java b/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/RedisKey.java index 3d78626..b5842fb 100644 --- a/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/RedisKey.java +++ b/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/RedisKey.java @@ -1,10 +1,11 @@ package io.goodforgod.testcontainers.extensions.redis; +import org.jetbrains.annotations.NotNull; + import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; -import org.jetbrains.annotations.NotNull; /** * Redis key diff --git a/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/RedisKeyImpl.java b/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/RedisKeyImpl.java index 9ac1ef3..bfcf507 100644 --- a/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/RedisKeyImpl.java +++ b/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/RedisKeyImpl.java @@ -1,10 +1,11 @@ package io.goodforgod.testcontainers.extensions.redis; +import org.jetbrains.annotations.ApiStatus.Internal; +import org.jetbrains.annotations.NotNull; + import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.Objects; -import org.jetbrains.annotations.ApiStatus.Internal; -import org.jetbrains.annotations.NotNull; @Internal final class RedisKeyImpl implements RedisKey { diff --git a/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/RedisValueImpl.java b/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/RedisValueImpl.java index abe4c76..e76c8d9 100644 --- a/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/RedisValueImpl.java +++ b/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/RedisValueImpl.java @@ -1,13 +1,14 @@ package io.goodforgod.testcontainers.extensions.redis; -import java.nio.charset.StandardCharsets; -import java.util.Arrays; -import java.util.Objects; import org.jetbrains.annotations.ApiStatus.Internal; import org.jetbrains.annotations.NotNull; import org.json.JSONArray; import org.json.JSONObject; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Objects; + @Internal final class RedisValueImpl implements RedisValue { diff --git a/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/TestcontainersRedis.java b/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/TestcontainersRedis.java index 884c474..fd733a8 100644 --- a/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/TestcontainersRedis.java +++ b/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/TestcontainersRedis.java @@ -2,10 +2,11 @@ import io.goodforgod.testcontainers.extensions.ContainerMode; import io.goodforgod.testcontainers.extensions.Network; -import java.lang.annotation.*; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.extension.ExtendWith; +import java.lang.annotation.*; + /** * Extension that is running {@link RedisContainer} for tests in different modes with database * schema migration support between test executions diff --git a/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/TestcontainersRedisExtension.java b/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/TestcontainersRedisExtension.java index bb51ea5..65c780b 100644 --- a/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/TestcontainersRedisExtension.java +++ b/redis/src/main/java/io/goodforgod/testcontainers/extensions/redis/TestcontainersRedisExtension.java @@ -1,11 +1,6 @@ package io.goodforgod.testcontainers.extensions.redis; import io.goodforgod.testcontainers.extensions.AbstractTestcontainersExtension; -import java.lang.annotation.Annotation; -import java.time.Duration; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; import org.jetbrains.annotations.ApiStatus.Internal; import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.extension.ExtensionContext; @@ -15,6 +10,12 @@ import org.testcontainers.containers.wait.strategy.Wait; import org.testcontainers.utility.DockerImageName; +import java.lang.annotation.Annotation; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + @Internal class TestcontainersRedisExtension extends AbstractTestcontainersExtension { diff --git a/redis/src/test/java/io/goodforgod/testcontainers/extensions/redis/RedisConnectionAssertsTests.java b/redis/src/test/java/io/goodforgod/testcontainers/extensions/redis/RedisConnectionAssertsTests.java index 8016887..87a214f 100644 --- a/redis/src/test/java/io/goodforgod/testcontainers/extensions/redis/RedisConnectionAssertsTests.java +++ b/redis/src/test/java/io/goodforgod/testcontainers/extensions/redis/RedisConnectionAssertsTests.java @@ -1,13 +1,14 @@ package io.goodforgod.testcontainers.extensions.redis; -import static org.junit.jupiter.api.Assertions.*; - import io.goodforgod.testcontainers.extensions.ContainerMode; -import java.util.List; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.opentest4j.AssertionFailedError; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.*; + @TestcontainersRedis(mode = ContainerMode.PER_CLASS, image = "redis:7.0-alpine") class RedisConnectionAssertsTests {