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
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
*/
public class ActiveMQContainer extends GenericContainer<ActiveMQContainer> {

private static final DockerImageName DEFAULT_IMAGE = DockerImageName.parse("apache/activemq-classic");
private static final DockerImageName APACHE_ACTIVEMQ_CLASSIC_IMAGE = DockerImageName.parse(
"apache/activemq-classic"
);

private static final DockerImageName DEFAULT_IMAGE = DockerImageName.parse("apache/activemq");

private static final int WEB_CONSOLE_PORT = 8161;

Expand All @@ -45,7 +49,7 @@ public ActiveMQContainer(String image) {

public ActiveMQContainer(DockerImageName dockerImageName) {
super(dockerImageName);
dockerImageName.assertCompatibleWith(DEFAULT_IMAGE);
dockerImageName.assertCompatibleWith(DEFAULT_IMAGE, APACHE_ACTIVEMQ_CLASSIC_IMAGE);

withExposedPorts(WEB_CONSOLE_PORT, TCP_PORT, AMQP_PORT, STOMP_PORT, MQTT_PORT, WS_PORT);
waitingFor(Wait.forLogMessage(".*Apache ActiveMQ.*started.*", 1).withStartupTimeout(Duration.ofMinutes(1)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import lombok.SneakyThrows;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;

import static org.assertj.core.api.Assertions.assertThat;

Expand All @@ -18,7 +20,7 @@ class ActiveMQContainerTest {
@Test
void test() {
try ( // container {
ActiveMQContainer activemq = new ActiveMQContainer("apache/activemq-classic:5.18.3")
ActiveMQContainer activemq = new ActiveMQContainer("apache/activemq:5.18.7")
// }
) {
activemq.start();
Expand All @@ -29,11 +31,20 @@ void test() {
}
}

@ParameterizedTest
@ValueSource(strings = { "apache/activemq-classic:5.18.7", "apache/activemq:5.18.7" })
void compatibility(String image) {
try (ActiveMQContainer activemq = new ActiveMQContainer(image)) {
activemq.start();
assertFunctionality(activemq, false);
}
}

@Test
void customCredentials() {
try (
// settingCredentials {
ActiveMQContainer activemq = new ActiveMQContainer("apache/activemq-classic:5.18.3")
ActiveMQContainer activemq = new ActiveMQContainer("apache/activemq:5.18.7")
.withUser("testcontainers")
.withPassword("testcontainers")
// }
Expand Down
Loading