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 @@ -16,9 +16,9 @@
import io.airlift.log.Logger;
import io.airlift.log.Logging;
import io.trino.gateway.ha.HaGatewayLauncher;
import org.testcontainers.containers.MySQLContainer;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.containers.TrinoContainer;
import org.testcontainers.mysql.MySQLContainer;
import org.testcontainers.postgresql.PostgreSQLContainer;
import org.testcontainers.trino.TrinoContainer;

import java.util.List;

Expand All @@ -44,7 +44,7 @@ public static void main(String[] args)
trino2.withCopyFileToContainer(forClasspathResource("trino-config.properties"), "/etc/trino/config.properties");
trino2.start();

PostgreSQLContainer<?> postgres = createPostgreSqlContainer();
PostgreSQLContainer postgres = createPostgreSqlContainer();
postgres.withUsername("trino_gateway_db_admin");
postgres.withPassword("P0stG&es");
postgres.withDatabaseName("trino_gateway_db");
Expand All @@ -53,7 +53,7 @@ public static void main(String[] args)
postgres.setPortBindings(List.of("5432:5432"));
postgres.start();

MySQLContainer<?> mysql = new MySQLContainer("mysql:5.7");
MySQLContainer mysql = new MySQLContainer("mysql:5.7");
mysql.withUsername("root");
mysql.withPassword("root123");
mysql.withDatabaseName("trinogateway");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import okhttp3.mockwebserver.MockWebServer;
import org.jdbi.v3.core.Handle;
import org.jdbi.v3.core.Jdbi;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.oracle.OracleContainer;
import org.testcontainers.postgresql.PostgreSQLContainer;

import java.io.BufferedWriter;
import java.io.File;
Expand Down Expand Up @@ -110,7 +110,7 @@ public static File buildGatewayConfig(String configFile, Map<String, String> add
return target;
}

public static Map<String, String> buildPostgresVars(PostgreSQLContainer<?> postgresql)
public static Map<String, String> buildPostgresVars(PostgreSQLContainer postgresql)
{
return ImmutableMap.<String, String>builder()
.put("POSTGRESQL_JDBC_URL", postgresql.getJdbcUrl())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestInstance.Lifecycle;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.containers.TrinoContainer;
import org.testcontainers.postgresql.PostgreSQLContainer;
import org.testcontainers.trino.TrinoContainer;

import java.io.File;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import org.junit.jupiter.api.TestInstance.Lifecycle;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.containers.TrinoContainer;
import org.testcontainers.postgresql.PostgreSQLContainer;
import org.testcontainers.trino.TrinoContainer;

import java.io.File;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.containers.TrinoContainer;
import org.testcontainers.postgresql.PostgreSQLContainer;
import org.testcontainers.trino.TrinoContainer;

import java.io.File;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestInstance.Lifecycle;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.containers.TrinoContainer;
import org.testcontainers.postgresql.PostgreSQLContainer;
import org.testcontainers.trino.TrinoContainer;

import java.io.File;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestInstance.Lifecycle;
import org.junit.jupiter.api.TestMethodOrder;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.postgresql.PostgreSQLContainer;

import java.io.File;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.testcontainers.containers.TrinoContainer;
import org.testcontainers.trino.TrinoContainer;

import java.util.Map;
import java.util.function.Function;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
package io.trino.gateway.ha.persistence;

import org.jdbi.v3.core.Handle;
import org.testcontainers.containers.MySQLContainer;
import org.testcontainers.mysql.MySQLContainer;

final class TestDatabaseMigrationsMySql
extends BaseTestDatabaseMigrations
{
public TestDatabaseMigrationsMySql()
{
super(new MySQLContainer<>("mysql:8.0.36"), "test");
super(new MySQLContainer("mysql:8.0.36"), "test");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
*/
package io.trino.gateway.ha.router;

import org.testcontainers.containers.MySQLContainer;
import org.testcontainers.mysql.MySQLContainer;

public class TestExternalUrlQueryHistoryMySql
extends BaseExternalUrlQueryHistoryTest
{
public TestExternalUrlQueryHistoryMySql()
{
super(new MySQLContainer<>("mysql:8.0.36"));
super(new MySQLContainer("mysql:8.0.36"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
package io.trino.gateway.ha.router;

import org.testcontainers.containers.JdbcDatabaseContainer;
import org.testcontainers.containers.MySQLContainer;
import org.testcontainers.mysql.MySQLContainer;

public class TestQueryHistoryManagerMySql
extends BaseTestQueryHistoryManager
{
@Override
protected final JdbcDatabaseContainer<?> startContainer()
{
JdbcDatabaseContainer<?> container = new MySQLContainer<>("mysql:8.0.36");
JdbcDatabaseContainer<?> container = new MySQLContainer("mysql:8.0.36");
container.start();
return container;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.containers.TrinoContainer;
import org.testcontainers.postgresql.PostgreSQLContainer;
import org.testcontainers.trino.TrinoContainer;

import java.io.File;
import java.util.List;
Expand All @@ -44,7 +44,7 @@ final class TestRoutingAPI
public static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
private final OkHttpClient httpClient = new OkHttpClient();
private TrinoContainer trino;
private final PostgreSQLContainer<?> postgresql = createPostgreSqlContainer();
private final PostgreSQLContainer postgresql = createPostgreSqlContainer();
int routerPort = 21001 + (int) (Math.random() * 1000);
int backendPort;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.TestInstance.Lifecycle;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.postgresql.PostgreSQLContainer;

import java.io.File;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
import org.testcontainers.containers.FixedHostPortGenericContainer;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.containers.startupcheck.OneShotStartupCheckStrategy;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.containers.wait.strategy.WaitAllStrategy;
import org.testcontainers.postgresql.PostgreSQLContainer;

import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
Expand Down Expand Up @@ -76,7 +76,7 @@ void setup()
{
Network network = Network.newNetwork();

PostgreSQLContainer<?> databaseContainer = createPostgreSqlContainer()
PostgreSQLContainer databaseContainer = createPostgreSqlContainer()
.withNetwork(network)
.withNetworkAliases("hydra-db")
.withUsername("hydra")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@
*/
package io.trino.gateway.ha.util;

import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.containers.wait.strategy.WaitAllStrategy;
import org.testcontainers.postgresql.PostgreSQLContainer;

import java.time.Duration;

public final class TestcontainersUtils
{
private TestcontainersUtils() {}

public static PostgreSQLContainer<?> createPostgreSqlContainer()
public static PostgreSQLContainer createPostgreSqlContainer()
{
//noinspection resource
return new PostgreSQLContainer<>("postgres:17")
return new PostgreSQLContainer("postgres:17")
.waitingFor(new WaitAllStrategy()
.withStrategy(Wait.forListeningPort())
.withStrategy(new LogMessageWaitStrategy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.testcontainers.containers.PostgreSQLContainer;
import org.testcontainers.postgresql.PostgreSQLContainer;

import java.io.File;
import java.net.URI;
Expand Down