Search in sources :

Example 1 with CredentialsClient

use of org.eclipse.hono.client.CredentialsClient in project hono by eclipse.

the class CredentialsAmqpIT method prepareDeviceRegistry.

/**
 * Starts the device registry and connects a client.
 *
 * @param ctx The vert.x test context.
 */
@BeforeClass
public static void prepareDeviceRegistry(final TestContext ctx) {
    client = DeviceRegistryAmqpTestSupport.prepareDeviceRegistryClient(vertx);
    client.connect(new ProtonClientOptions()).compose(c -> c.getOrCreateCredentialsClient(Constants.DEFAULT_TENANT)).setHandler(ctx.asyncAssertSuccess(r -> {
        credentialsClient = r;
    }));
}
Also used : CoreMatchers.is(org.hamcrest.CoreMatchers.is) HttpURLConnection(java.net.HttpURLConnection) TestContext(io.vertx.ext.unit.TestContext) BeforeClass(org.junit.BeforeClass) LocalDateTime(java.time.LocalDateTime) RunWith(org.junit.runner.RunWith) ServiceInvocationException(org.eclipse.hono.client.ServiceInvocationException) Constants(org.eclipse.hono.util.Constants) CredentialsClient(org.eclipse.hono.client.CredentialsClient) ProtonClientOptions(io.vertx.proton.ProtonClientOptions) Timeout(org.junit.rules.Timeout) JsonObject(io.vertx.core.json.JsonObject) HonoClient(org.eclipse.hono.client.HonoClient) AfterClass(org.junit.AfterClass) Vertx(io.vertx.core.Vertx) Test(org.junit.Test) VertxUnitRunner(io.vertx.ext.unit.junit.VertxUnitRunner) StandardCharsets(java.nio.charset.StandardCharsets) CredentialsConstants(org.eclipse.hono.util.CredentialsConstants) TimeUnit(java.util.concurrent.TimeUnit) JsonArray(io.vertx.core.json.JsonArray) Base64(java.util.Base64) Rule(org.junit.Rule) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) DateTimeFormatter(java.time.format.DateTimeFormatter) Assert(org.junit.Assert) CredentialsObject(org.eclipse.hono.util.CredentialsObject) ProtonClientOptions(io.vertx.proton.ProtonClientOptions) BeforeClass(org.junit.BeforeClass)

Aggregations

Vertx (io.vertx.core.Vertx)1 JsonArray (io.vertx.core.json.JsonArray)1 JsonObject (io.vertx.core.json.JsonObject)1 TestContext (io.vertx.ext.unit.TestContext)1 VertxUnitRunner (io.vertx.ext.unit.junit.VertxUnitRunner)1 ProtonClientOptions (io.vertx.proton.ProtonClientOptions)1 HttpURLConnection (java.net.HttpURLConnection)1 StandardCharsets (java.nio.charset.StandardCharsets)1 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1 LocalDateTime (java.time.LocalDateTime)1 DateTimeFormatter (java.time.format.DateTimeFormatter)1 Base64 (java.util.Base64)1 TimeUnit (java.util.concurrent.TimeUnit)1 CredentialsClient (org.eclipse.hono.client.CredentialsClient)1 HonoClient (org.eclipse.hono.client.HonoClient)1 ServiceInvocationException (org.eclipse.hono.client.ServiceInvocationException)1 Constants (org.eclipse.hono.util.Constants)1 CredentialsConstants (org.eclipse.hono.util.CredentialsConstants)1 CredentialsObject (org.eclipse.hono.util.CredentialsObject)1 CoreMatchers.is (org.hamcrest.CoreMatchers.is)1