Search in sources :

Example 1 with TelemetryExecutionContext

use of org.eclipse.hono.util.TelemetryExecutionContext in project hono by eclipse.

the class AbstractProtocolAdapterBaseTest method testGetDownstreamPropertiesAddsStandardProperties.

/**
 * Verifies that the adapter's name is set on a downstream message.
 */
@Test
public void testGetDownstreamPropertiesAddsStandardProperties() {
    final TelemetryExecutionContext context = mock(TelemetryExecutionContext.class);
    when(context.getDownstreamMessageProperties()).thenReturn(new HashMap<>());
    final Map<String, Object> props = adapter.getDownstreamMessageProperties(context);
    assertThat(props.get(MessageHelper.APP_PROPERTY_ORIG_ADAPTER)).isEqualTo(ADAPTER_NAME);
}
Also used : TelemetryExecutionContext(org.eclipse.hono.util.TelemetryExecutionContext) TenantObject(org.eclipse.hono.util.TenantObject) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Test(org.junit.jupiter.api.Test)

Aggregations

TelemetryExecutionContext (org.eclipse.hono.util.TelemetryExecutionContext)1 TenantObject (org.eclipse.hono.util.TenantObject)1 Test (org.junit.jupiter.api.Test)1 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)1