Search in sources :

Example 1 with AuthenticationBasic

use of org.apache.pulsar.client.impl.auth.AuthenticationBasic in project incubator-pulsar by apache.

the class AuthenticatedProducerConsumerTest method testBasicCryptSyncProducerAndConsumer.

@Test(dataProvider = "batch")
public void testBasicCryptSyncProducerAndConsumer(int batchMessageDelayMs) throws Exception {
    log.info("-- Starting {} test --", methodName);
    AuthenticationBasic authPassword = new AuthenticationBasic();
    authPassword.configure("{\"userId\":\"superUser\",\"password\":\"supepass\"}");
    internalSetup(authPassword);
    admin.properties().createProperty("my-property", new PropertyAdmin(Lists.newArrayList(), Sets.newHashSet("use")));
    admin.namespaces().createNamespace("my-property/use/my-ns");
    testSyncProducerAndConsumer(batchMessageDelayMs);
    log.info("-- Exiting {} test --", methodName);
}
Also used : PropertyAdmin(org.apache.pulsar.common.policies.data.PropertyAdmin) AuthenticationBasic(org.apache.pulsar.client.impl.auth.AuthenticationBasic) Test(org.testng.annotations.Test)

Example 2 with AuthenticationBasic

use of org.apache.pulsar.client.impl.auth.AuthenticationBasic in project incubator-pulsar by apache.

the class AuthenticatedProducerConsumerTest method testBasicArp1SyncProducerAndConsumer.

@Test(dataProvider = "batch")
public void testBasicArp1SyncProducerAndConsumer(int batchMessageDelayMs) throws Exception {
    log.info("-- Starting {} test --", methodName);
    AuthenticationBasic authPassword = new AuthenticationBasic();
    authPassword.configure("{\"userId\":\"superUser2\",\"password\":\"superpassword\"}");
    internalSetup(authPassword);
    admin.properties().createProperty("my-property", new PropertyAdmin(Lists.newArrayList(), Sets.newHashSet("use")));
    admin.namespaces().createNamespace("my-property/use/my-ns");
    testSyncProducerAndConsumer(batchMessageDelayMs);
    log.info("-- Exiting {} test --", methodName);
}
Also used : PropertyAdmin(org.apache.pulsar.common.policies.data.PropertyAdmin) AuthenticationBasic(org.apache.pulsar.client.impl.auth.AuthenticationBasic) Test(org.testng.annotations.Test)

Aggregations

AuthenticationBasic (org.apache.pulsar.client.impl.auth.AuthenticationBasic)2 PropertyAdmin (org.apache.pulsar.common.policies.data.PropertyAdmin)2 Test (org.testng.annotations.Test)2