diff --git a/README.md b/README.md index 0d4615e..3afbe89 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ [![CI](https://github.com/localstack/localstack-java-utils/actions/workflows/build.yml/badge.svg)](https://github.com/localstack/localstack-java-utils/actions/workflows/build.yml) [![Maven Central](https://img.shields.io/maven-central/v/cloud.localstack/localstack-utils)](https://mvnrepository.com/artifact/cloud.localstack/localstack-utils) -[![Thundra Foresight](https://thundra-assets-prod.s3.us-west-2.amazonaws.com/images/badges/thundra-foresight-badge-enabled.svg)](https://foresight.thundra.live/testRuns/71e743a6-b8d5-4d55-aa89-5299f3c3d08e) + +⚠️ Note: This repo is not currently very actively maintained. Please consider using the [Testcontainers LocalStack Java module](https://java.testcontainers.org/modules/localstack/) as a potential alternative. + # LocalStack Java Utils Java utilities and JUnit integration for [LocalStack](https://github.com/localstack/localstack). diff --git a/pom.xml b/pom.xml index d4815b2..aa9238d 100644 --- a/pom.xml +++ b/pom.xml @@ -317,19 +317,6 @@ 2.12.1 test - - io.thundra - jexter-junit4-core - ${jexter.version} - test - - - io.thundra - jexter-junit5-core - ${jexter.version} - test - - diff --git a/src/test/java/cloud/localstack/awssdkv1/KinesisConsumerTest.java b/src/test/java/cloud/localstack/awssdkv1/KinesisConsumerTest.java index af41487..47910cc 100644 --- a/src/test/java/cloud/localstack/awssdkv1/KinesisConsumerTest.java +++ b/src/test/java/cloud/localstack/awssdkv1/KinesisConsumerTest.java @@ -10,7 +10,6 @@ import com.amazonaws.services.kinesis.model.GetShardIteratorRequest; import com.amazonaws.services.kinesis.model.PutRecordRequest; import com.amazonaws.services.kinesis.model.ResourceInUseException; -import io.thundra.jexter.junit4.core.sysprop.SystemPropertySandboxRule; import org.junit.Assert; import org.junit.Rule; import org.junit.Test; @@ -26,10 +25,6 @@ @LocalstackDockerProperties(ignoreDockerRunErrors=true) public class KinesisConsumerTest { - // Revert system properties to the back after the test - @Rule - public SystemPropertySandboxRule systemPropertySandboxRule = new SystemPropertySandboxRule(); - @Test public void testGetRecordCBOR() throws Exception { System.setProperty(SDKGlobalConfiguration.AWS_CBOR_DISABLE_SYSTEM_PROPERTY, "false"); diff --git a/src/test/java/cloud/localstack/awssdkv1/docker/BasicDockerFunctionalityTest.java b/src/test/java/cloud/localstack/awssdkv1/docker/BasicDockerFunctionalityTest.java index 616641c..c7666a1 100644 --- a/src/test/java/cloud/localstack/awssdkv1/docker/BasicDockerFunctionalityTest.java +++ b/src/test/java/cloud/localstack/awssdkv1/docker/BasicDockerFunctionalityTest.java @@ -40,9 +40,6 @@ import com.amazonaws.services.sqs.model.CreateQueueRequest; import com.amazonaws.services.sqs.model.ListQueuesResult; import com.amazonaws.util.IOUtils; -import io.thundra.jexter.junit4.core.envvar.EnvironmentVariableSandboxRule; -import io.thundra.jexter.junit4.core.sysprop.SystemPropertySandboxRule; -import io.thundra.jexter.junit5.core.envvar.EnvironmentVariableSandbox; import org.assertj.core.api.Assertions; import org.junit.Assert; import org.junit.ClassRule; @@ -63,14 +60,8 @@ @RunWith(LocalstackTestRunner.class) @ExtendWith(LocalstackDockerExtension.class) @LocalstackDockerProperties(randomizePorts = true) -// [JUnit5] Revert environment variables to the back after the test suite (class) -@EnvironmentVariableSandbox public class BasicDockerFunctionalityTest { - // [JUnit4] Revert environment variables to the back after the test suite (class) - @ClassRule - public static EnvironmentVariableSandboxRule environmentVariableSandboxRule = new EnvironmentVariableSandboxRule(); - @org.junit.BeforeClass @org.junit.jupiter.api.BeforeAll public static void beforeAll() { diff --git a/src/test/java/cloud/localstack/awssdkv1/docker/DockerOnlySQSFunctionalityTest.java b/src/test/java/cloud/localstack/awssdkv1/docker/DockerOnlySQSFunctionalityTest.java index c3e721c..900b715 100644 --- a/src/test/java/cloud/localstack/awssdkv1/docker/DockerOnlySQSFunctionalityTest.java +++ b/src/test/java/cloud/localstack/awssdkv1/docker/DockerOnlySQSFunctionalityTest.java @@ -12,8 +12,6 @@ import com.amazonaws.services.sqs.AmazonSQS; import com.amazonaws.services.sqs.model.CreateQueueRequest; import com.amazonaws.services.sqs.model.ListQueuesResult; -import io.thundra.jexter.junit4.core.envvar.EnvironmentVariableSandboxRule; -import io.thundra.jexter.junit5.core.envvar.EnvironmentVariableSandbox; import org.assertj.core.api.Assertions; import org.junit.ClassRule; import org.junit.jupiter.api.extension.ExtendWith; @@ -30,14 +28,8 @@ @RunWith(LocalstackTestRunner.class) @ExtendWith(LocalstackDockerExtension.class) @LocalstackDockerProperties(randomizePorts = true, services = "sqs") -// [JUnit5] Revert environment variables to the back after the test suite (class) -@EnvironmentVariableSandbox public class DockerOnlySQSFunctionalityTest { - // [JUnit4] Revert environment variables to the back after the test suite (class) - @ClassRule - public static EnvironmentVariableSandboxRule environmentVariableSandboxRule = new EnvironmentVariableSandboxRule(); - @org.junit.BeforeClass @org.junit.jupiter.api.BeforeAll public static void beforeAll() { diff --git a/src/test/java/cloud/localstack/awssdkv2/BasicFeaturesSDKV2Test.java b/src/test/java/cloud/localstack/awssdkv2/BasicFeaturesSDKV2Test.java index 8aae22f..68d3d12 100644 --- a/src/test/java/cloud/localstack/awssdkv2/BasicFeaturesSDKV2Test.java +++ b/src/test/java/cloud/localstack/awssdkv2/BasicFeaturesSDKV2Test.java @@ -7,7 +7,6 @@ import cloud.localstack.sample.LambdaHandler; import cloud.localstack.utils.LocalTestUtil; import com.amazonaws.services.s3.model.ObjectListing; -import io.thundra.jexter.junit4.core.sysprop.SystemPropertySandboxRule; import lombok.SneakyThrows; import lombok.val; import org.assertj.core.api.Assertions; @@ -109,10 +108,6 @@ @LocalstackDockerProperties(ignoreDockerRunErrors=true) public class BasicFeaturesSDKV2Test { - // Revert system properties to the back after the test suite (class) - @ClassRule - public static SystemPropertySandboxRule systemPropertySandboxRule = new SystemPropertySandboxRule(); - @BeforeClass public static void beforeAll() { System.setProperty(SdkSystemSetting.CBOR_ENABLED.property(), "false"); diff --git a/src/test/java/cloud/localstack/awssdkv2/KinesisSchedulerTest.java b/src/test/java/cloud/localstack/awssdkv2/KinesisSchedulerTest.java index 4d9d397..c1d3afc 100644 --- a/src/test/java/cloud/localstack/awssdkv2/KinesisSchedulerTest.java +++ b/src/test/java/cloud/localstack/awssdkv2/KinesisSchedulerTest.java @@ -3,7 +3,6 @@ import cloud.localstack.awssdkv2.consumer.DeliveryStatusRecordProcessorFactory; import cloud.localstack.awssdkv2.consumer.EventProcessor; import cloud.localstack.docker.annotation.LocalstackDockerProperties; -import io.thundra.jexter.junit4.core.sysprop.SystemPropertySandboxRule; import org.junit.Assert; import org.junit.Before; import org.junit.Rule; @@ -34,10 +33,6 @@ public class KinesisSchedulerTest extends PowerMockLocalStack { String testMessage = "hello, world"; Integer consumerCreationTime = 15; //35 for real AWS - // Revert system properties to the back after the test - @Rule - public SystemPropertySandboxRule systemPropertySandboxRule = new SystemPropertySandboxRule(); - @Before public void mockServicesForScheduler() { System.setProperty(SdkSystemSetting.CBOR_ENABLED.property(), "false"); diff --git a/src/test/java/cloud/localstack/awssdkv2/KinesisV2ConsumerTest.java b/src/test/java/cloud/localstack/awssdkv2/KinesisV2ConsumerTest.java index ee9c28a..3c3808d 100644 --- a/src/test/java/cloud/localstack/awssdkv2/KinesisV2ConsumerTest.java +++ b/src/test/java/cloud/localstack/awssdkv2/KinesisV2ConsumerTest.java @@ -2,7 +2,6 @@ import cloud.localstack.LocalstackTestRunner; import cloud.localstack.docker.annotation.LocalstackDockerProperties; -import io.thundra.jexter.junit4.core.sysprop.SystemPropertySandboxRule; import org.junit.Assert; import org.junit.Rule; import org.junit.Test; @@ -27,10 +26,6 @@ @LocalstackDockerProperties(ignoreDockerRunErrors = true) public class KinesisV2ConsumerTest { - // Revert system properties to the back after the test suite (class) - @Rule - public SystemPropertySandboxRule systemPropertySandboxRule = new SystemPropertySandboxRule(); - @Test public void testGetRecordCBOR() throws Exception { System.setProperty(SdkSystemSetting.CBOR_ENABLED.property(), "true"); diff --git a/src/test/java/cloud/localstack/deprecated/BasicFunctionalityTest.java b/src/test/java/cloud/localstack/deprecated/BasicFunctionalityTest.java index be1afee..7fe93e4 100644 --- a/src/test/java/cloud/localstack/deprecated/BasicFunctionalityTest.java +++ b/src/test/java/cloud/localstack/deprecated/BasicFunctionalityTest.java @@ -32,8 +32,6 @@ import com.amazonaws.services.sqs.model.ReceiveMessageResult; import com.amazonaws.services.sqs.model.SendMessageRequest; import com.amazonaws.services.sqs.model.SendMessageResult; -import io.thundra.jexter.junit4.core.envvar.EnvironmentVariableSandboxRule; -import io.thundra.jexter.junit5.core.envvar.EnvironmentVariableSandbox; import org.assertj.core.api.Assertions; import org.junit.Assert; import org.junit.ClassRule; @@ -59,8 +57,6 @@ @ExtendWith(LocalstackExtension.class) @org.junit.Ignore @org.junit.jupiter.api.Disabled -// [JUnit5] Revert environment variables to the back after the test suite (class) -@EnvironmentVariableSandbox public class BasicFunctionalityTest { static { @@ -70,10 +66,6 @@ public class BasicFunctionalityTest { } } - // [JUnit4] Revert environment variables to the back after the test suite (class) - @ClassRule - public static EnvironmentVariableSandboxRule environmentVariableSandboxRule = new EnvironmentVariableSandboxRule(); - @org.junit.BeforeClass @org.junit.jupiter.api.BeforeAll public static void beforeAll() {