Skip to content

Commit

Permalink
Fix Stream TestContainer
Browse files Browse the repository at this point in the history
- do not close the container; used by other tests.
  • Loading branch information
garyrussell committed Sep 28, 2022
1 parent 4ee9d21 commit 0cce533
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 the original author or authors.
* Copyright 2021-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,6 @@

import java.time.Duration;

import org.junit.jupiter.api.AfterAll;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.RabbitMQContainer;

Expand All @@ -43,28 +42,29 @@ public abstract class AbstractIntegrationTests {
.withExposedPorts(5672, 15672, 5552)
.withPluginsEnabled("rabbitmq_stream", "rabbitmq_management")
.withStartupTimeout(Duration.ofMinutes(2));
System.out.println("Created");
RABBITMQ.start();
System.out.println("Started");
}
else {
RABBITMQ = null;
}
System.out.println(RABBITMQ);
}

public static int amqpPort() {
System.out.println("amqp:" + RABBITMQ);
return RABBITMQ != null ? RABBITMQ.getMappedPort(5672) : 5672;
}

public static int managementPort() {
System.out.println("mgmt:" + RABBITMQ);
return RABBITMQ != null ? RABBITMQ.getMappedPort(15672) : 15672;
}

public static int streamPort() {
System.out.println("stream:" + RABBITMQ);
return RABBITMQ != null ? RABBITMQ.getMappedPort(5552) : 5552;
}

@AfterAll
static void shutDown() {
RABBITMQ.close();
}

}

0 comments on commit 0cce533

Please sign in to comment.