Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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).
Expand Down
13 changes: 0 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -317,19 +317,6 @@
<version>2.12.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.thundra</groupId>
<artifactId>jexter-junit4-core</artifactId>
<version>${jexter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.thundra</groupId>
<artifactId>jexter-junit5-core</artifactId>
<version>${jexter.version}</version>
<scope>test</scope>
</dependency>

</dependencies>

<profiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand All @@ -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() {
Expand Down