Search in sources :

Example 11 with MqttPublishMessage

use of io.vertx.mqtt.messages.MqttPublishMessage in project hono by eclipse.

the class VertxBasedMqttProtocolAdapterTest method newMessage.

private static MqttPublishMessage newMessage(final MqttQoS qosLevel, final String topic, final Buffer payload) {
    final MqttPublishMessage message = mock(MqttPublishMessage.class);
    when(message.qosLevel()).thenReturn(qosLevel);
    when(message.topicName()).thenReturn(topic);
    when(message.payload()).thenReturn(payload);
    return message;
}
Also used : MqttPublishMessage(io.vertx.mqtt.messages.MqttPublishMessage)

Aggregations

MqttPublishMessage (io.vertx.mqtt.messages.MqttPublishMessage)11 Buffer (io.vertx.core.buffer.Buffer)8 MqttEndpoint (io.vertx.mqtt.MqttEndpoint)8 ProtocolAdapterProperties (org.eclipse.hono.config.ProtocolAdapterProperties)8 Test (org.junit.Test)8 ResourceIdentifier (org.eclipse.hono.util.ResourceIdentifier)6 MqttQoS (io.netty.handler.codec.mqtt.MqttQoS)5 Future (io.vertx.core.Future)5 Async (io.vertx.ext.unit.Async)5 TestContext (io.vertx.ext.unit.TestContext)5 VertxUnitRunner (io.vertx.ext.unit.junit.VertxUnitRunner)5 MqttContext (org.eclipse.hono.adapter.mqtt.MqttContext)5 Device (org.eclipse.hono.service.auth.device.Device)5 EndpointType (org.eclipse.hono.util.EndpointType)5 EventConstants (org.eclipse.hono.util.EventConstants)5 TelemetryConstants (org.eclipse.hono.util.TelemetryConstants)5 CoreMatchers.is (org.hamcrest.CoreMatchers.is)5 Assert.assertEquals (org.junit.Assert.assertEquals)5 Assert.assertThat (org.junit.Assert.assertThat)5 Rule (org.junit.Rule)5