Skip to content
Open
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 @@ -5,7 +5,7 @@
import org.testcontainers.utility.DockerImageName;

import java.time.Duration;
import java.util.HashSet;
import java.util.Collections;
import java.util.Set;

/**
Expand Down Expand Up @@ -75,7 +75,7 @@ protected void configure() {

@Override
public Set<Integer> getLivenessCheckPortNumbers() {
return new HashSet<>(getMappedPort(HTTP_PORT));
return Collections.singleton(getMappedPort(HTTP_PORT));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.testcontainers.utility.DockerImageName;

import java.time.Duration;
import java.util.HashSet;
import java.util.Collections;
import java.util.Set;

/**
Expand Down Expand Up @@ -74,7 +74,7 @@ public ClickHouseContainer(final DockerImageName dockerImageName) {

@Override
public Set<Integer> getLivenessCheckPortNumbers() {
return new HashSet<>(getMappedPort(HTTP_PORT));
return Collections.singleton(getMappedPort(HTTP_PORT));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@

class ClickHouseContainerTest extends AbstractContainerDatabaseTest {

@Test
void livenessCheckPortIsTheMappedHttpPort() {
// a mapped port that is easy to recognise, without starting the container
ClickHouseContainer clickhouse = new ClickHouseContainer("clickhouse/clickhouse-server:21.11-alpine") {
@Override
public Integer getMappedPort(int originalPort) {
return originalPort + 10000;
}
};

assertThat(clickhouse.getLivenessCheckPortNumbers()).containsExactly(18123);
}

@Test
void testSimple() throws SQLException {
try ( // container {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@

class SimpleClickhouseTest extends AbstractContainerDatabaseTest {

@Test
void livenessCheckPortIsTheMappedHttpPort() {
// a mapped port that is easy to recognise, without starting the container
ClickHouseContainer clickhouse = new ClickHouseContainer(ClickhouseTestImages.CLICKHOUSE_IMAGE) {
@Override
public Integer getMappedPort(int originalPort) {
return originalPort + 10000;
}
};

assertThat(clickhouse.getLivenessCheckPortNumbers()).containsExactly(18123);
}

@Test
public void testSimple() throws SQLException {
try (ClickHouseContainer clickhouse = new ClickHouseContainer(ClickhouseTestImages.CLICKHOUSE_IMAGE)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.utility.DockerImageName;

import java.util.HashSet;
import java.util.Collections;
import java.util.Set;

/**
Expand Down Expand Up @@ -57,7 +57,7 @@ protected void configure() {

@Override
public Set<Integer> getLivenessCheckPortNumbers() {
return new HashSet<>(getMappedPort(HTTP_PORT));
return Collections.singleton(getMappedPort(HTTP_PORT));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@

class DatabendContainerTest extends AbstractContainerDatabaseTest {

@Test
void livenessCheckPortIsTheMappedHttpPort() {
// a mapped port that is easy to recognise, without starting the container
DatabendContainer databend = new DatabendContainer("datafuselabs/databend:v1.2.615") {
@Override
public Integer getMappedPort(int originalPort) {
return originalPort + 10000;
}
};

assertThat(databend.getLivenessCheckPortNumbers()).containsExactly(18000);
}

@Test
void testSimple() throws SQLException {
try ( // container {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.testcontainers.utility.DockerImageName;

import java.time.Duration;
import java.util.HashSet;
import java.util.Collections;
import java.util.Set;

/**
Expand Down Expand Up @@ -64,7 +64,7 @@ protected void configure() {

@Override
public Set<Integer> getLivenessCheckPortNumbers() {
return new HashSet<>(getMappedPort(HTTP_PORT));
return Collections.singleton(getMappedPort(HTTP_PORT));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@

class TimeplusContainerTest extends AbstractContainerDatabaseTest {

@Test
void livenessCheckPortIsTheMappedHttpPort() {
// a mapped port that is easy to recognise, without starting the container
TimeplusContainer timeplus = new TimeplusContainer("timeplus/timeplusd:2.3.21") {
@Override
public Integer getMappedPort(int originalPort) {
return originalPort + 10000;
}
};

assertThat(timeplus.getLivenessCheckPortNumbers()).containsExactly(13218);
}

@Test
void testSimple() throws SQLException {
try ( // container {
Expand Down