|
13 | 13 | */ |
14 | 14 | package io.trino.gateway.ha.router; |
15 | 15 |
|
| 16 | +<<<<<<< HEAD |
| 17 | +======= |
| 18 | +import com.google.inject.AbstractModule; |
| 19 | +import com.google.inject.Guice; |
| 20 | +import com.google.inject.Injector; |
| 21 | +>>>>>>> c13a8db (address comments) |
16 | 22 | import io.trino.gateway.ha.HaGatewayTestUtils; |
17 | 23 | import io.trino.gateway.ha.config.DataStoreConfiguration; |
18 | 24 | import io.trino.gateway.ha.persistence.DefaultJdbcPropertiesProvider; |
@@ -48,8 +54,26 @@ void setUp() |
48 | 54 | HaGatewayTestUtils.seedRequiredData(tempH2DbDir.getAbsolutePath()); |
49 | 55 | DataStoreConfiguration db = new DataStoreConfiguration(jdbcUrl, "sa", |
50 | 56 | "sa", "org.h2.Driver", 4, false); |
| 57 | +<<<<<<< HEAD |
51 | 58 | Jdbi jdbi = Jdbi.create(jdbcUrl, "sa", "sa"); |
52 | 59 | JdbcConnectionManager connectionManager = new JdbcConnectionManager(jdbi, db, new DefaultJdbcPropertiesProvider()); |
| 60 | +======= |
| 61 | + HaGatewayConfiguration configuration = new HaGatewayConfiguration(); |
| 62 | + configuration.setDataStore(db); |
| 63 | + AbstractModule testConfigModule = new AbstractModule() { |
| 64 | + @Override |
| 65 | + protected void configure() |
| 66 | + { |
| 67 | + bind(HaGatewayConfiguration.class) |
| 68 | + .toInstance(configuration); |
| 69 | + } |
| 70 | + }; |
| 71 | + Injector injector = Guice.createInjector( |
| 72 | + testConfigModule, |
| 73 | + new RouterBaseModule()); |
| 74 | + |
| 75 | + JdbcConnectionManager connectionManager = injector.getInstance(JdbcConnectionManager.class); |
| 76 | +>>>>>>> c13a8db (address comments) |
53 | 77 | super.resourceGroupManager = new HaResourceGroupsManager(connectionManager); |
54 | 78 | } |
55 | 79 |
|
|
0 commit comments