Search in sources :

Example 6 with RecordImpl

use of org.apache.qpid.proton.engine.impl.RecordImpl in project hono by eclipse.

the class HonoMessagingTest method newConnection.

private static ProtonConnection newConnection(final HonoUser user) {
    final Record attachments = new RecordImpl();
    attachments.set(Constants.KEY_CONNECTION_ID, String.class, CON_ID);
    attachments.set(Constants.KEY_CLIENT_PRINCIPAL, HonoUser.class, user);
    final ProtonConnection con = mock(ProtonConnection.class);
    when(con.attachments()).thenReturn(attachments);
    when(con.getRemoteContainer()).thenReturn("test-client");
    return con;
}
Also used : ProtonConnection(io.vertx.proton.ProtonConnection) Record(org.apache.qpid.proton.engine.Record) RecordImpl(org.apache.qpid.proton.engine.impl.RecordImpl)

Aggregations

ProtonConnection (io.vertx.proton.ProtonConnection)6 RecordImpl (org.apache.qpid.proton.engine.impl.RecordImpl)6 Handler (io.vertx.core.Handler)4 Record (org.apache.qpid.proton.engine.Record)4 ProtonReceiver (io.vertx.proton.ProtonReceiver)3 Async (io.vertx.ext.unit.Async)2 ProtonDelivery (io.vertx.proton.ProtonDelivery)2 ProtonMessageHandler (io.vertx.proton.ProtonMessageHandler)2 Source (org.apache.qpid.proton.amqp.transport.Source)2 Message (org.apache.qpid.proton.message.Message)2 ClientConfigProperties (org.eclipse.hono.config.ClientConfigProperties)2 Future (io.vertx.core.Future)1 Vertx (io.vertx.core.Vertx)1 TestContext (io.vertx.ext.unit.TestContext)1 Timeout (io.vertx.ext.unit.junit.Timeout)1 VertxUnitRunner (io.vertx.ext.unit.junit.VertxUnitRunner)1 ProtonHelper (io.vertx.proton.ProtonHelper)1 ProtonQoS (io.vertx.proton.ProtonQoS)1 ProtonSender (io.vertx.proton.ProtonSender)1 BiConsumer (java.util.function.BiConsumer)1