use of com.amazon.dataprepper.plugins.source.oteltrace.OTelTraceSourceConfig in project data-prepper by opensearch-project.
the class CertificateProviderFactoryTest method getCertificateProviderS3ProviderSuccess.
@Test
public void getCertificateProviderS3ProviderSuccess() {
final Map<String, Object> settingsMap = new HashMap<>();
settingsMap.put("ssl", true);
settingsMap.put("awsRegion", "us-east-1");
settingsMap.put("sslKeyCertChainFile", "s3://data/certificate/test_cert.crt");
settingsMap.put("sslKeyFile", "s3://data/certificate/test_decrypted_key.key");
final PluginSetting pluginSetting = new PluginSetting(null, settingsMap);
pluginSetting.setPipelineName("pipeline");
oTelTraceSourceConfig = OBJECT_MAPPER.convertValue(pluginSetting.getSettings(), OTelTraceSourceConfig.class);
oTelTraceSourceConfig.validateAndInitializeCertAndKeyFileInS3();
certificateProviderFactory = new CertificateProviderFactory(oTelTraceSourceConfig);
final CertificateProvider certificateProvider = certificateProviderFactory.getCertificateProvider();
assertThat(certificateProvider, IsInstanceOf.instanceOf(S3CertificateProvider.class));
}
use of com.amazon.dataprepper.plugins.source.oteltrace.OTelTraceSourceConfig in project data-prepper by opensearch-project.
the class CertificateProviderFactoryTest method getCertificateProviderFileProviderSuccess.
@Test
public void getCertificateProviderFileProviderSuccess() {
final Map<String, Object> settingsMap = new HashMap<>();
settingsMap.put("ssl", true);
settingsMap.put("sslKeyCertChainFile", "data/certificate/test_cert.crt");
settingsMap.put("sslKeyFile", "data/certificate/test_decrypted_key.key");
final PluginSetting pluginSetting = new PluginSetting(null, settingsMap);
pluginSetting.setPipelineName("pipeline");
oTelTraceSourceConfig = OBJECT_MAPPER.convertValue(pluginSetting.getSettings(), OTelTraceSourceConfig.class);
certificateProviderFactory = new CertificateProviderFactory(oTelTraceSourceConfig);
final CertificateProvider certificateProvider = certificateProviderFactory.getCertificateProvider();
assertThat(certificateProvider, IsInstanceOf.instanceOf(FileCertificateProvider.class));
}
use of com.amazon.dataprepper.plugins.source.oteltrace.OTelTraceSourceConfig in project data-prepper by opensearch-project.
the class CertificateProviderFactoryTest method getCertificateProviderAcmProviderSuccess.
@Test
public void getCertificateProviderAcmProviderSuccess() {
final Map<String, Object> settingsMap = new HashMap<>();
settingsMap.put("useAcmCertForSSL", true);
settingsMap.put("awsRegion", "us-east-1");
settingsMap.put("acmCertificateArn", "arn:aws:acm:us-east-1:account:certificate/1234-567-856456");
settingsMap.put("sslKeyCertChainFile", "data/certificate/test_cert.crt");
settingsMap.put("sslKeyFile", "data/certificate/test_decrypted_key.key");
final PluginSetting pluginSetting = new PluginSetting(null, settingsMap);
pluginSetting.setPipelineName("pipeline");
oTelTraceSourceConfig = OBJECT_MAPPER.convertValue(pluginSetting.getSettings(), OTelTraceSourceConfig.class);
certificateProviderFactory = new CertificateProviderFactory(oTelTraceSourceConfig);
final CertificateProvider certificateProvider = certificateProviderFactory.getCertificateProvider();
assertThat(certificateProvider, IsInstanceOf.instanceOf(ACMCertificateProvider.class));
}
Aggregations