Skip to content

Commit d2d278e

Browse files
fix for isRunning method after stopping the container (#83)
1 parent 37fc395 commit d2d278e

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/main/java/cloud/localstack/Localstack.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ public void startup(LocalstackDockerConfiguration dockerConfiguration) {
108108
public void stop() {
109109
if (localStackContainer != null) {
110110
localStackContainer.stop();
111+
localStackContainer = null;
111112
}
112113
locked = false;
113114
}

src/test/java/cloud/localstack/awssdkv1/docker/LocalstackDockerTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.junit.rules.ExpectedException;
1313

1414
import static org.junit.Assert.assertNotNull;
15+
import static org.junit.Assert.assertFalse;
1516

1617
public class LocalstackDockerTest {
1718

@@ -52,6 +53,13 @@ public void stop() {
5253
amazonSQS.createQueue("test-queue").getQueueUrl();
5354
}
5455

56+
@Test
57+
public void restart() {
58+
Localstack.INSTANCE.startup(DOCKER_CONFIG);
59+
Localstack.INSTANCE.stop();
60+
assertFalse(Localstack.INSTANCE.isRunning());
61+
}
62+
5563
@After
5664
public void tearDown() {
5765
Localstack.INSTANCE.stop();

0 commit comments

Comments
 (0)