File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
main/java/org/testcontainers/databend
test/java/org/testcontainers/databend Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,8 @@ public class DatabendContainer extends JdbcDatabaseContainer<DatabendContainer>
3737
3838 private String password = "databend" ;
3939
40+ private boolean minioEnabled = true ;
41+
4042 public DatabendContainer (String dockerImageName ) {
4143 this (DockerImageName .parse (dockerImageName ));
4244 }
@@ -53,6 +55,7 @@ public DatabendContainer(final DockerImageName dockerImageName) {
5355 protected void configure () {
5456 withEnv ("QUERY_DEFAULT_USER" , this .username );
5557 withEnv ("QUERY_DEFAULT_PASSWORD" , this .password );
58+ withEnv ("MINIO_ENABLED" , this .minioEnabled );
5659 }
5760
5861 @ Override
@@ -93,6 +96,10 @@ public String getDatabaseName() {
9396 return this .databaseName ;
9497 }
9598
99+ public boolean isMinioEnabled () {
100+ return this .minioEnabled ;
101+ }
102+
96103 @ Override
97104 public String getTestQueryString () {
98105 return TEST_QUERY ;
@@ -109,4 +116,9 @@ public DatabendContainer withPassword(String password) {
109116 this .password = password ;
110117 return this ;
111118 }
119+
120+ public DatabendContainer withMinioEnabled (boolean minioEnabled ) {
121+ this .minioEnabled = minioEnabled ;
122+ return this ;
123+ }
112124}
Original file line number Diff line number Diff line change @@ -38,4 +38,25 @@ public void customCredentialsWithUrlParams() throws SQLException {
3838 assertThat (resultSetInt ).isEqualTo (1 );
3939 }
4040 }
41+
42+ @ Test
43+ public void testInsertIntoWithMinioEnabled () throws SQLException {
44+ try (DatabendContainer databend = new DatabendContainer ("datafuselabs/databend:v1.2.615" )
45+ .withMinioEnabled (true )
46+ .withUsername ("test" )
47+ .withPassword ("test" )
48+ .withUrlParam ("ssl" , "false" )
49+ ) {
50+ databend .start ();
51+
52+ performQuery (databend , "CREATE TABLE test_table (a int, b int);" );
53+ performQuery (databend , "INSERT INTO test_table VALUES (1, 2);" );
54+
55+ ResultSet resultSet = performQuery (databend , "SELECT * FROM test_table;" );
56+
57+ resultSet .next ();
58+ assertThat (resultSet .getInt (1 )).isEqualTo (1 );
59+ assertThat (resultSet .getInt (2 )).isEqualTo (2 );
60+ }
61+ }
4162}
You can’t perform that action at this time.
0 commit comments