Search in sources :

Example 1 with GlueSchemaRegistryDeserializationFacade

use of com.amazonaws.services.schemaregistry.deserializers.GlueSchemaRegistryDeserializationFacade in project flink by apache.

the class GlueSchemaRegistryInputStreamDeserializerTest method testAwsCredentialsProviderFromConfig.

@Test
public void testAwsCredentialsProviderFromConfig() throws Exception {
    Map<String, Object> config = new HashMap<>(configs);
    config.put(AWS_ACCESS_KEY_ID, "ak");
    config.put(AWS_SECRET_ACCESS_KEY, "sk");
    GlueSchemaRegistryInputStreamDeserializer glueSchemaRegistryInputStreamDeserializer = new GlueSchemaRegistryInputStreamDeserializer(config);
    GlueSchemaRegistryDeserializationFacade facade = getField("glueSchemaRegistryDeserializationFacade", glueSchemaRegistryInputStreamDeserializer);
    AwsCredentialsProvider credentialsProvider = facade.getCredentialsProvider();
    assertThat(credentialsProvider.resolveCredentials().accessKeyId()).isEqualTo("ak");
    assertThat(credentialsProvider.resolveCredentials().secretAccessKey()).isEqualTo("sk");
}
Also used : HashMap(java.util.HashMap) AwsCredentialsProvider(software.amazon.awssdk.auth.credentials.AwsCredentialsProvider) GlueSchemaRegistryDeserializationFacade(com.amazonaws.services.schemaregistry.deserializers.GlueSchemaRegistryDeserializationFacade) Test(org.junit.Test)

Example 2 with GlueSchemaRegistryDeserializationFacade

use of com.amazonaws.services.schemaregistry.deserializers.GlueSchemaRegistryDeserializationFacade in project flink by apache.

the class GlueSchemaRegistryInputStreamDeserializerTest method testDefaultAwsCredentialsProvider.

@Test
public void testDefaultAwsCredentialsProvider() throws Exception {
    GlueSchemaRegistryInputStreamDeserializer glueSchemaRegistryInputStreamDeserializer = new GlueSchemaRegistryInputStreamDeserializer(configs);
    GlueSchemaRegistryDeserializationFacade facade = getField("glueSchemaRegistryDeserializationFacade", glueSchemaRegistryInputStreamDeserializer);
    AwsCredentialsProvider credentialsProvider = facade.getCredentialsProvider();
    assertThat(credentialsProvider).isInstanceOf(DefaultCredentialsProvider.class);
}
Also used : AwsCredentialsProvider(software.amazon.awssdk.auth.credentials.AwsCredentialsProvider) GlueSchemaRegistryDeserializationFacade(com.amazonaws.services.schemaregistry.deserializers.GlueSchemaRegistryDeserializationFacade) Test(org.junit.Test)

Example 3 with GlueSchemaRegistryDeserializationFacade

use of com.amazonaws.services.schemaregistry.deserializers.GlueSchemaRegistryDeserializationFacade in project flink by apache.

the class GlueSchemaRegistryJsonSchemaCoderTest method testDefaultAwsCredentialsProvider.

@Test
public void testDefaultAwsCredentialsProvider() throws Exception {
    GlueSchemaRegistryJsonSchemaCoder coder = new GlueSchemaRegistryJsonSchemaCoder("test", getBaseConfig());
    GlueSchemaRegistryDeserializationFacade facade = getField("glueSchemaRegistryDeserializationFacade", coder);
    AwsCredentialsProvider credentialsProvider = facade.getCredentialsProvider();
    assertThat(credentialsProvider).isInstanceOf(DefaultCredentialsProvider.class);
}
Also used : AwsCredentialsProvider(software.amazon.awssdk.auth.credentials.AwsCredentialsProvider) GlueSchemaRegistryDeserializationFacade(com.amazonaws.services.schemaregistry.deserializers.GlueSchemaRegistryDeserializationFacade) Test(org.junit.Test)

Example 4 with GlueSchemaRegistryDeserializationFacade

use of com.amazonaws.services.schemaregistry.deserializers.GlueSchemaRegistryDeserializationFacade in project flink by apache.

the class GlueSchemaRegistryJsonSchemaCoderTest method testAwsCredentialsProviderFromConfig.

@Test
public void testAwsCredentialsProviderFromConfig() throws Exception {
    Map<String, Object> config = new HashMap<>(getBaseConfig());
    config.put(AWS_ACCESS_KEY_ID, "ak");
    config.put(AWS_SECRET_ACCESS_KEY, "sk");
    GlueSchemaRegistryJsonSchemaCoder coder = new GlueSchemaRegistryJsonSchemaCoder("test", config);
    GlueSchemaRegistryDeserializationFacade facade = getField("glueSchemaRegistryDeserializationFacade", coder);
    AwsCredentialsProvider credentialsProvider = facade.getCredentialsProvider();
    assertThat(credentialsProvider.resolveCredentials().accessKeyId()).isEqualTo("ak");
    assertThat(credentialsProvider.resolveCredentials().secretAccessKey()).isEqualTo("sk");
}
Also used : HashMap(java.util.HashMap) AwsCredentialsProvider(software.amazon.awssdk.auth.credentials.AwsCredentialsProvider) GlueSchemaRegistryDeserializationFacade(com.amazonaws.services.schemaregistry.deserializers.GlueSchemaRegistryDeserializationFacade) Test(org.junit.Test)

Aggregations

GlueSchemaRegistryDeserializationFacade (com.amazonaws.services.schemaregistry.deserializers.GlueSchemaRegistryDeserializationFacade)4 Test (org.junit.Test)4 AwsCredentialsProvider (software.amazon.awssdk.auth.credentials.AwsCredentialsProvider)4 HashMap (java.util.HashMap)2