use of com.datastax.oss.sink.pulsar.PulsarRecordImpl in project pulsar-sink by datastax.
the class SslHostnameValidationCCMIT method raw_bigint_value.
@Test
void raw_bigint_value() {
Map<String, String> extras = ImmutableMap.<String, String>builder().put(PROVIDER_OPT, "JDK").put(KEYSTORE_PATH_OPT, DEFAULT_CLIENT_KEYSTORE_FILE.getAbsolutePath()).put(KEYSTORE_PASSWORD_OPT, CcmBridge.DEFAULT_CLIENT_KEYSTORE_PASSWORD).put(TRUSTSTORE_PATH_OPT, DEFAULT_CLIENT_TRUSTSTORE_FILE.getAbsolutePath()).put(TRUSTSTORE_PASSWORD_OPT, DEFAULT_CLIENT_TRUSTSTORE_PASSWORD).build();
taskConfigs.add(makeConnectorProperties(extras));
PulsarRecordImpl record = new PulsarRecordImpl("persistent://tenant/namespace/mytopic", null, new GenericRecordImpl().put("bigint", 5725368L), recordType);
runTaskWithRecords(record);
// Verify that the record was inserted properly in the database.
List<Row> results = session.execute("SELECT bigintcol FROM types").all();
assertThat(results.size()).isEqualTo(1);
Row row = results.get(0);
assertThat(row.getLong("bigintcol")).isEqualTo(5725368L);
}
use of com.datastax.oss.sink.pulsar.PulsarRecordImpl in project pulsar-sink by datastax.
the class SslEndToEndCCMIT method raw_bigint_value_with_hostname_validation.
@Test
void raw_bigint_value_with_hostname_validation() {
Map<String, String> extras = ImmutableMap.<String, String>builder().put(SslConfig.PROVIDER_OPT, "JDK").put(SslConfig.KEYSTORE_PATH_OPT, CcmBridge.DEFAULT_CLIENT_KEYSTORE_FILE.getAbsolutePath()).put(SslConfig.KEYSTORE_PASSWORD_OPT, CcmBridge.DEFAULT_CLIENT_KEYSTORE_PASSWORD).put(SslConfig.TRUSTSTORE_PATH_OPT, CcmBridge.DEFAULT_CLIENT_TRUSTSTORE_FILE.getAbsolutePath()).put(SslConfig.TRUSTSTORE_PASSWORD_OPT, CcmBridge.DEFAULT_CLIENT_TRUSTSTORE_PASSWORD).build();
taskConfigs.add(makeConnectorProperties(extras));
PulsarRecordImpl record = new PulsarRecordImpl("persistent://tenant/namespace/mytopic", null, new GenericRecordImpl().put("bigint", 5725368L), recordType);
assertThatThrownBy(() -> runTaskWithRecords(record)).isInstanceOf(AllNodesFailedException.class);
}
use of com.datastax.oss.sink.pulsar.PulsarRecordImpl in project pulsar-sink by datastax.
the class SslEndToEndCCMIT method raw_bigint_value_without_hostname_validation.
@Test
void raw_bigint_value_without_hostname_validation() {
Map<String, String> extras = ImmutableMap.<String, String>builder().put(SslConfig.PROVIDER_OPT, "JDK").put(SslConfig.KEYSTORE_PATH_OPT, CcmBridge.DEFAULT_CLIENT_KEYSTORE_FILE.getAbsolutePath()).put(SslConfig.KEYSTORE_PASSWORD_OPT, CcmBridge.DEFAULT_CLIENT_KEYSTORE_PASSWORD).put(SslConfig.HOSTNAME_VALIDATION_OPT, "false").put(SslConfig.TRUSTSTORE_PATH_OPT, CcmBridge.DEFAULT_CLIENT_TRUSTSTORE_FILE.getAbsolutePath()).put(SslConfig.TRUSTSTORE_PASSWORD_OPT, CcmBridge.DEFAULT_CLIENT_TRUSTSTORE_PASSWORD).build();
taskConfigs.add(makeConnectorProperties(extras));
PulsarRecordImpl record = new PulsarRecordImpl("persistent://tenant/namespace/mytopic", null, new GenericRecordImpl().put("bigint", 5725368L), recordType);
runTaskWithRecords(record);
// Verify that the record was inserted properly in the database.
List<Row> results = session.execute("SELECT bigintcol FROM types").all();
assertThat(results.size()).isEqualTo(1);
Row row = results.get(0);
assertThat(row.getLong("bigintcol")).isEqualTo(5725368L);
}
use of com.datastax.oss.sink.pulsar.PulsarRecordImpl in project pulsar-sink by datastax.
the class SslEndToEndCCMIT method raw_bigint_value_with_openssl_base64_encoded_files.
@Test
void raw_bigint_value_with_openssl_base64_encoded_files() throws Exception {
Map<String, String> extras = ImmutableMap.<String, String>builder().put(SslConfig.PROVIDER_OPT, "OpenSSL").put(SslConfig.HOSTNAME_VALIDATION_OPT, "false").put(SslConfig.OPENSSL_KEY_CERT_CHAIN_OPT, encodeFile(CcmBridge.DEFAULT_CLIENT_CERT_CHAIN_FILE)).put(SslConfig.OPENSSL_PRIVATE_KEY_OPT, encodeFile(CcmBridge.DEFAULT_CLIENT_PRIVATE_KEY_FILE)).put(SslConfig.TRUSTSTORE_PATH_OPT, encodeFile(CcmBridge.DEFAULT_CLIENT_TRUSTSTORE_FILE)).put(SslConfig.TRUSTSTORE_PASSWORD_OPT, CcmBridge.DEFAULT_CLIENT_TRUSTSTORE_PASSWORD).build();
taskConfigs.add(makeConnectorProperties(extras));
PulsarRecordImpl record = new PulsarRecordImpl("persistent://tenant/namespace/mytopic", null, new GenericRecordImpl().put("bigint", 5725368L), recordType);
runTaskWithRecords(record);
// Verify that the record was inserted properly in the database.
List<Row> results = session.execute("SELECT bigintcol FROM types").all();
assertThat(results.size()).isEqualTo(1);
Row row = results.get(0);
assertThat(row.getLong("bigintcol")).isEqualTo(5725368L);
}
use of com.datastax.oss.sink.pulsar.PulsarRecordImpl in project pulsar-sink by datastax.
the class SslEndToEndCCMIT method raw_bigint_value_openssl_with_hostname_validation.
@Test
void raw_bigint_value_openssl_with_hostname_validation() {
Map<String, String> extras = ImmutableMap.<String, String>builder().put(SslConfig.PROVIDER_OPT, "OpenSSL").put(SslConfig.OPENSSL_KEY_CERT_CHAIN_OPT, CcmBridge.DEFAULT_CLIENT_CERT_CHAIN_FILE.getAbsolutePath()).put(SslConfig.OPENSSL_PRIVATE_KEY_OPT, CcmBridge.DEFAULT_CLIENT_PRIVATE_KEY_FILE.getAbsolutePath()).put(SslConfig.TRUSTSTORE_PATH_OPT, CcmBridge.DEFAULT_CLIENT_TRUSTSTORE_FILE.getAbsolutePath()).put(SslConfig.TRUSTSTORE_PASSWORD_OPT, CcmBridge.DEFAULT_CLIENT_TRUSTSTORE_PASSWORD).build();
taskConfigs.add(makeConnectorProperties(extras));
PulsarRecordImpl record = new PulsarRecordImpl("persistent://tenant/namespace/mytopic", null, new GenericRecordImpl().put("bigint", 5725368L), recordType);
assertThatThrownBy(() -> runTaskWithRecords(record)).isInstanceOf(AllNodesFailedException.class);
}
Aggregations