Skip to content

Commit cdca4b1

Browse files
committed
Update cockroachdb image version
1 parent 01451d1 commit cdca4b1

File tree

3 files changed

+3
-33
lines changed

3 files changed

+3
-33
lines changed

modules/cockroachdb/src/test/java/org/testcontainers/CockroachDBTestImages.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,4 @@
44

55
public interface CockroachDBTestImages {
66
DockerImageName COCKROACHDB_IMAGE = DockerImageName.parse("cockroachdb/cockroach:v22.2.3");
7-
8-
DockerImageName FIRST_COCKROACHDB_IMAGE_WITH_ENV_VARS_SUPPORT = DockerImageName.parse(
9-
"cockroachdb/cockroach:v22.1.0"
10-
);
11-
12-
DockerImageName COCKROACHDB_IMAGE_WITH_ENV_VARS_UNSUPPORTED = DockerImageName.parse(
13-
"cockroachdb/cockroach:v21.2.17"
14-
);
157
}

modules/cockroachdb/src/test/java/org/testcontainers/cockroachdb/CockroachContainerTest.java

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import java.util.logging.LogManager;
1212

1313
import static org.assertj.core.api.Assertions.assertThat;
14-
import static org.assertj.core.api.Assertions.assertThatThrownBy;
1514

1615
class CockroachContainerTest extends AbstractContainerDatabaseTest {
1716
static {
@@ -22,7 +21,7 @@ class CockroachContainerTest extends AbstractContainerDatabaseTest {
2221
@Test
2322
void testSimple() throws SQLException {
2423
try ( // container {
25-
CockroachContainer cockroach = new CockroachContainer("cockroachdb/cockroach:v22.2.3")
24+
CockroachContainer cockroach = new CockroachContainer("cockroachdb/cockroach:v26.1.1")
2625
// }
2726
) {
2827
cockroach.start();
@@ -71,9 +70,7 @@ void testWithAdditionalUrlParamInJdbcUrl() {
7170
@Test
7271
void testWithUsernamePasswordDatabase() throws SQLException {
7372
try (
74-
CockroachContainer cockroach = new CockroachContainer(
75-
CockroachDBTestImages.FIRST_COCKROACHDB_IMAGE_WITH_ENV_VARS_SUPPORT
76-
)
73+
CockroachContainer cockroach = new CockroachContainer(CockroachDBTestImages.COCKROACHDB_IMAGE)
7774
.withUsername("test_user")
7875
.withPassword("test_password")
7976
.withDatabaseName("test_database")
@@ -90,25 +87,6 @@ void testWithUsernamePasswordDatabase() throws SQLException {
9087
}
9188
}
9289

93-
@Test
94-
void testAnExceptionIsThrownWhenImageDoesNotSupportEnvVars() {
95-
CockroachContainer cockroachContainer = new CockroachContainer(
96-
CockroachDBTestImages.COCKROACHDB_IMAGE_WITH_ENV_VARS_UNSUPPORTED
97-
);
98-
99-
assertThatThrownBy(() -> cockroachContainer.withUsername("test_user"))
100-
.isInstanceOf(UnsupportedOperationException.class)
101-
.withFailMessage("Setting a username in not supported in the versions below 22.1.0");
102-
103-
assertThatThrownBy(() -> cockroachContainer.withPassword("test_password"))
104-
.isInstanceOf(UnsupportedOperationException.class)
105-
.withFailMessage("Setting a password in not supported in the versions below 22.1.0");
106-
107-
assertThatThrownBy(() -> cockroachContainer.withDatabaseName("test_database"))
108-
.isInstanceOf(UnsupportedOperationException.class)
109-
.withFailMessage("Setting a databaseName in not supported in the versions below 22.1.0");
110-
}
111-
11290
@Test
11391
void testInitializationScript() throws SQLException {
11492
String sql =

modules/cockroachdb/src/test/java/org/testcontainers/jdbc/cockroachdb/CockroachDBJDBCDriverTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class CockroachDBJDBCDriverTest extends AbstractJDBCDriverTest {
1010
public static Iterable<Object[]> data() {
1111
return Arrays.asList(
1212
new Object[][] { //
13-
{ "jdbc:tc:cockroach:v21.2.17://hostname/databasename", EnumSet.noneOf(Options.class) },
13+
{ "jdbc:tc:cockroach:v22.2.3://hostname/databasename", EnumSet.noneOf(Options.class) },
1414
}
1515
);
1616
}

0 commit comments

Comments
 (0)