Search in sources :

Example 1 with BearerAuthCredentialProvider

use of io.confluent.kafka.schemaregistry.client.security.bearerauth.BearerAuthCredentialProvider in project flink by apache.

the class CachedSchemaCoderProviderTest method testThatBearerAuthIsInitializedForBearerAuthProperties.

@Test
public void testThatBearerAuthIsInitializedForBearerAuthProperties() {
    String token = "123456";
    Map<String, String> configs = new HashMap<>();
    configs.put("bearer.auth.credentials.source", "STATIC_TOKEN");
    configs.put("bearer.auth.token", token);
    CachedSchemaCoderProvider provider = initCachedSchemaCoderProvider(configs);
    BearerAuthCredentialProvider bearerAuthCredentialProvider = getBearerAuthFromProvider(provider);
    assertNotNull(bearerAuthCredentialProvider);
    assertEquals(bearerAuthCredentialProvider.getBearerToken(null), token);
}
Also used : HashMap(java.util.HashMap) BearerAuthCredentialProvider(io.confluent.kafka.schemaregistry.client.security.bearerauth.BearerAuthCredentialProvider) Test(org.junit.Test)

Example 2 with BearerAuthCredentialProvider

use of io.confluent.kafka.schemaregistry.client.security.bearerauth.BearerAuthCredentialProvider in project flink-mirror by flink-ci.

the class CachedSchemaCoderProviderTest method testThatBearerAuthIsInitializedForBearerAuthProperties.

@Test
public void testThatBearerAuthIsInitializedForBearerAuthProperties() {
    String token = "123456";
    Map<String, String> configs = new HashMap<>();
    configs.put("bearer.auth.credentials.source", "STATIC_TOKEN");
    configs.put("bearer.auth.token", token);
    CachedSchemaCoderProvider provider = initCachedSchemaCoderProvider(configs);
    BearerAuthCredentialProvider bearerAuthCredentialProvider = getBearerAuthFromProvider(provider);
    assertNotNull(bearerAuthCredentialProvider);
    assertEquals(bearerAuthCredentialProvider.getBearerToken(null), token);
}
Also used : HashMap(java.util.HashMap) BearerAuthCredentialProvider(io.confluent.kafka.schemaregistry.client.security.bearerauth.BearerAuthCredentialProvider) Test(org.junit.Test)

Example 3 with BearerAuthCredentialProvider

use of io.confluent.kafka.schemaregistry.client.security.bearerauth.BearerAuthCredentialProvider in project flink-mirror by flink-ci.

the class CachedSchemaCoderProviderTest method testThatBearerAuthIsNotInitializedForNoBearerAuthProperties.

@Test
public void testThatBearerAuthIsNotInitializedForNoBearerAuthProperties() {
    CachedSchemaCoderProvider provider = initCachedSchemaCoderProvider(new HashMap<>());
    BearerAuthCredentialProvider bearerAuthCredentialProvider = getBearerAuthFromProvider(provider);
    assertNull(bearerAuthCredentialProvider);
}
Also used : BearerAuthCredentialProvider(io.confluent.kafka.schemaregistry.client.security.bearerauth.BearerAuthCredentialProvider) Test(org.junit.Test)

Example 4 with BearerAuthCredentialProvider

use of io.confluent.kafka.schemaregistry.client.security.bearerauth.BearerAuthCredentialProvider in project flink by splunk.

the class CachedSchemaCoderProviderTest method testThatBearerAuthIsNotInitializedForNoBearerAuthProperties.

@Test
public void testThatBearerAuthIsNotInitializedForNoBearerAuthProperties() {
    CachedSchemaCoderProvider provider = initCachedSchemaCoderProvider(new HashMap<>());
    BearerAuthCredentialProvider bearerAuthCredentialProvider = getBearerAuthFromProvider(provider);
    assertNull(bearerAuthCredentialProvider);
}
Also used : BearerAuthCredentialProvider(io.confluent.kafka.schemaregistry.client.security.bearerauth.BearerAuthCredentialProvider) Test(org.junit.Test)

Example 5 with BearerAuthCredentialProvider

use of io.confluent.kafka.schemaregistry.client.security.bearerauth.BearerAuthCredentialProvider in project flink by apache.

the class CachedSchemaCoderProviderTest method testThatBearerAuthIsNotInitializedForNoBearerAuthProperties.

@Test
public void testThatBearerAuthIsNotInitializedForNoBearerAuthProperties() {
    CachedSchemaCoderProvider provider = initCachedSchemaCoderProvider(new HashMap<>());
    BearerAuthCredentialProvider bearerAuthCredentialProvider = getBearerAuthFromProvider(provider);
    assertNull(bearerAuthCredentialProvider);
}
Also used : BearerAuthCredentialProvider(io.confluent.kafka.schemaregistry.client.security.bearerauth.BearerAuthCredentialProvider) Test(org.junit.Test)

Aggregations

BearerAuthCredentialProvider (io.confluent.kafka.schemaregistry.client.security.bearerauth.BearerAuthCredentialProvider)8 Test (org.junit.Test)7 HashMap (java.util.HashMap)3 SchemaString (io.confluent.kafka.schemaregistry.client.rest.entities.SchemaString)1 BasicAuthCredentialProvider (io.confluent.kafka.schemaregistry.client.security.basicauth.BasicAuthCredentialProvider)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1 ConfigException (org.apache.kafka.common.config.ConfigException)1 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)1