1111import java .util .logging .LogManager ;
1212
1313import static org .assertj .core .api .Assertions .assertThat ;
14- import static org .assertj .core .api .Assertions .assertThatThrownBy ;
1514
1615class 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 =
0 commit comments