use of io.trino.testing.TestingConnectorContext in project trino by trinodb.
the class TestIcebergPlugin method testThriftMetastore.
@Test
public void testThriftMetastore() {
ConnectorFactory factory = getConnectorFactory();
factory.create("test", Map.of("iceberg.catalog.type", "HIVE_METASTORE", "hive.metastore.uri", "thrift://foo:1234"), new TestingConnectorContext()).shutdown();
}
use of io.trino.testing.TestingConnectorContext in project trino by trinodb.
the class TestIcebergPlugin method testHiveMetastoreRejected.
@Test
public void testHiveMetastoreRejected() {
ConnectorFactory factory = getConnectorFactory();
assertThatThrownBy(() -> factory.create("test", Map.of("hive.metastore", "thrift", "hive.metastore.uri", "thrift://foo:1234"), new TestingConnectorContext())).hasMessageContaining("Error: Configuration property 'hive.metastore' was not used");
}
use of io.trino.testing.TestingConnectorContext in project trino by trinodb.
the class TestIcebergPlugin method testRecordingMetastore.
@Test
public void testRecordingMetastore() {
ConnectorFactory factory = getConnectorFactory();
// recording with thrift
factory.create("test", Map.of("iceberg.catalog.type", "HIVE_METASTORE", "hive.metastore.uri", "thrift://foo:1234", "hive.metastore-recording-path", "/tmp"), new TestingConnectorContext()).shutdown();
// recording with glue
assertThatThrownBy(() -> factory.create("test", Map.of("iceberg.catalog.type", "glue", "hive.metastore.glue.region", "us-east-2", "hive.metastore-recording-path", "/tmp"), new TestingConnectorContext())).hasMessageContaining("Configuration property 'hive.metastore-recording-path' was not used");
}
use of io.trino.testing.TestingConnectorContext in project trino by trinodb.
the class TestIcebergPlugin method testAllowAllAccessControl.
@Test
public void testAllowAllAccessControl() {
ConnectorFactory connectorFactory = getConnectorFactory();
connectorFactory.create("test", ImmutableMap.<String, String>builder().put("iceberg.catalog.type", "HIVE_METASTORE").put("hive.metastore.uri", "thrift://foo:1234").put("iceberg.security", "allow-all").buildOrThrow(), new TestingConnectorContext()).shutdown();
}
use of io.trino.testing.TestingConnectorContext in project trino by trinodb.
the class TestIcebergPlugin method testFileBasedAccessControl.
@Test
public void testFileBasedAccessControl() throws Exception {
ConnectorFactory connectorFactory = getConnectorFactory();
File tempFile = File.createTempFile("test-iceberg-plugin-access-control", ".json");
tempFile.deleteOnExit();
Files.write(tempFile.toPath(), "{}".getBytes(UTF_8));
connectorFactory.create("test", ImmutableMap.<String, String>builder().put("iceberg.catalog.type", "HIVE_METASTORE").put("hive.metastore.uri", "thrift://foo:1234").put("iceberg.security", "file").put("security.config-file", tempFile.getAbsolutePath()).buildOrThrow(), new TestingConnectorContext()).shutdown();
}
Aggregations