use of io.trino.testing.TestingConnectorContext in project trino by trinodb.
the class TestKafkaPlugin method testSslKeystoreMissingFileSpindown.
@Test
public void testSslKeystoreMissingFileSpindown() throws IOException {
KafkaPlugin plugin = new KafkaPlugin();
ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
assertInstanceOf(factory, KafkaConnectorFactory.class);
Path truststorePath = Files.createTempFile("test", ".jks");
assertThatThrownBy(() -> factory.create("test-connector", ImmutableMap.<String, String>builder().put("kafka.table-names", "test").put("kafka.nodes", "localhost:9092").put("kafka.security-protocol", "SSL").put("kafka.ssl.keystore.type", "JKS").put("kafka.ssl.keystore.location", "/not/a/real/path").put("kafka.ssl.keystore.password", "keystore-password").put("kafka.ssl.key.password", "key-password").put("kafka.ssl.truststore.type", "JKS").put("kafka.ssl.truststore.location", truststorePath.toString()).put("kafka.ssl.truststore.password", "truststore-password").put("kafka.ssl.endpoint-identification-algorithm", "https").buildOrThrow(), new TestingConnectorContext())).hasMessageContaining("Error: Invalid configuration property kafka.ssl.keystore.location: file does not exist: /not/a/real/path");
}
use of io.trino.testing.TestingConnectorContext in project trino by trinodb.
the class TestKafkaPlugin method testSpinup.
@Test
public void testSpinup() {
KafkaPlugin plugin = new KafkaPlugin();
ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
assertInstanceOf(factory, KafkaConnectorFactory.class);
Connector connector = factory.create("test-connector", ImmutableMap.<String, String>builder().put("kafka.table-names", "test").put("kafka.nodes", "localhost:9092").buildOrThrow(), new TestingConnectorContext());
assertNotNull(connector);
connector.shutdown();
}
use of io.trino.testing.TestingConnectorContext in project trino by trinodb.
the class TestSqlServerPlugin method testCreateConnector.
@Test
public void testCreateConnector() {
Plugin plugin = new SqlServerPlugin();
ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
factory.create("test", ImmutableMap.of("connection-url", "jdbc:sqlserver:test"), new TestingConnectorContext()).shutdown();
}
use of io.trino.testing.TestingConnectorContext in project trino by trinodb.
the class TestUtils method createConnector.
public static KinesisConnector createConnector(KinesisPlugin plugin, Map<String, String> properties, boolean withMockClient) {
requireNonNull(plugin, "Plugin instance should not be null");
requireNonNull(properties, "Properties map should not be null (can be empty)");
ConnectorFactory factory = plugin.getConnectorFactories().iterator().next();
assertNotNull(factory);
Connector connector = factory.create("kinesis", properties, new TestingConnectorContext());
return (KinesisConnector) connector;
}
use of io.trino.testing.TestingConnectorContext in project trino by trinodb.
the class TestPhoenixPlugin method testCreateConnector.
@Test
public void testCreateConnector() {
Plugin plugin = new PhoenixPlugin();
ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
factory.create("test", ImmutableMap.of("phoenix.connection-url", "jdbc:phoenix:test"), new TestingConnectorContext()).shutdown();
}
Aggregations