Search in sources :

Example 6 with MessagingKafkaProducerConfigProperties

use of org.eclipse.hono.client.kafka.producer.MessagingKafkaProducerConfigProperties in project hono by eclipse.

the class KafkaBasedTelemetrySenderTest method setUp.

/**
 * Sets up the fixture.
 */
@BeforeEach
public void setUp() {
    vertxMock = mock(Vertx.class);
    when(vertxMock.eventBus()).thenReturn(mock(EventBus.class));
    tenant = new TenantObject("the-tenant", true);
    kafkaProducerConfig = new MessagingKafkaProducerConfigProperties();
    kafkaProducerConfig.setProducerConfig(new HashMap<>());
}
Also used : TenantObject(org.eclipse.hono.util.TenantObject) MessagingKafkaProducerConfigProperties(org.eclipse.hono.client.kafka.producer.MessagingKafkaProducerConfigProperties) EventBus(io.vertx.core.eventbus.EventBus) Vertx(io.vertx.core.Vertx) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 7 with MessagingKafkaProducerConfigProperties

use of org.eclipse.hono.client.kafka.producer.MessagingKafkaProducerConfigProperties in project hono by eclipse.

the class KafkaBasedCommandResponseSenderTest method setUp.

/**
 * Sets up the fixture.
 */
@BeforeEach
public void setUp() {
    kafkaProducerConfig = new MessagingKafkaProducerConfigProperties();
    kafkaProducerConfig.setProducerConfig(new HashMap<>());
}
Also used : MessagingKafkaProducerConfigProperties(org.eclipse.hono.client.kafka.producer.MessagingKafkaProducerConfigProperties) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 8 with MessagingKafkaProducerConfigProperties

use of org.eclipse.hono.client.kafka.producer.MessagingKafkaProducerConfigProperties in project hono by eclipse.

the class KafkaBasedCommandSenderTest method setUp.

/**
 * Sets up fixture.
 *
 * @param vertx The vert.x instance to use.
 */
@BeforeEach
void setUp(final Vertx vertx) {
    this.vertx = vertx;
    consumerConfig = new MessagingKafkaConsumerConfigProperties();
    mockConsumer = new KafkaMockConsumer(OffsetResetStrategy.LATEST);
    producerConfig = new MessagingKafkaProducerConfigProperties();
    producerConfig.setProducerConfig(Map.of("client.id", "application-test-sender"));
    span = TracingMockSupport.mockSpan();
    tracer = TracingMockSupport.mockTracer(span);
    mockProducer = KafkaClientUnitTestHelper.newMockProducer(true);
    final var producerFactory = CachingKafkaProducerFactory.testFactory(vertx, (n, c) -> KafkaClientUnitTestHelper.newKafkaProducer(mockProducer));
    commandSender = new KafkaBasedCommandSender(vertx, consumerConfig, producerFactory, producerConfig, tracer);
    tenantId = UUID.randomUUID().toString();
    deviceId = UUID.randomUUID().toString();
}
Also used : MessagingKafkaConsumerConfigProperties(org.eclipse.hono.client.kafka.consumer.MessagingKafkaConsumerConfigProperties) MessagingKafkaProducerConfigProperties(org.eclipse.hono.client.kafka.producer.MessagingKafkaProducerConfigProperties) KafkaMockConsumer(org.eclipse.hono.kafka.test.KafkaMockConsumer) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 9 with MessagingKafkaProducerConfigProperties

use of org.eclipse.hono.client.kafka.producer.MessagingKafkaProducerConfigProperties in project hono by eclipse.

the class KafkaBasedEventSenderTest method setUp.

/**
 * Sets up the fixture.
 */
@BeforeEach
public void setUp() {
    vertxMock = mock(Vertx.class);
    when(vertxMock.eventBus()).thenReturn(mock(EventBus.class));
    kafkaProducerConfig = new MessagingKafkaProducerConfigProperties();
    kafkaProducerConfig.setProducerConfig(Map.of("hono.kafka.producerConfig.bootstrap.servers", "localhost:9092"));
}
Also used : MessagingKafkaProducerConfigProperties(org.eclipse.hono.client.kafka.producer.MessagingKafkaProducerConfigProperties) EventBus(io.vertx.core.eventbus.EventBus) Vertx(io.vertx.core.Vertx) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 10 with MessagingKafkaProducerConfigProperties

use of org.eclipse.hono.client.kafka.producer.MessagingKafkaProducerConfigProperties in project hono by eclipse.

the class AbstractKafkaBasedDownstreamSenderTest method setUp.

/**
 * Sets up the fixture.
 */
@BeforeEach
public void setUp() {
    vertxMock = mock(Vertx.class);
    when(vertxMock.eventBus()).thenReturn(mock(EventBus.class));
    config = new MessagingKafkaProducerConfigProperties();
    config.setProducerConfig(Map.of("hono.kafka.producerConfig.bootstrap.servers", "localhost:9092"));
    tenant = new TenantObject(TENANT_ID, true);
    final var mockProducer = KafkaClientUnitTestHelper.newMockProducer(true);
    sender = newSender(mockProducer);
}
Also used : TenantObject(org.eclipse.hono.util.TenantObject) MessagingKafkaProducerConfigProperties(org.eclipse.hono.client.kafka.producer.MessagingKafkaProducerConfigProperties) EventBus(io.vertx.core.eventbus.EventBus) Vertx(io.vertx.core.Vertx) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

MessagingKafkaProducerConfigProperties (org.eclipse.hono.client.kafka.producer.MessagingKafkaProducerConfigProperties)10 BeforeEach (org.junit.jupiter.api.BeforeEach)6 Vertx (io.vertx.core.Vertx)3 EventBus (io.vertx.core.eventbus.EventBus)3 MessagingKafkaConsumerConfigProperties (org.eclipse.hono.client.kafka.consumer.MessagingKafkaConsumerConfigProperties)3 Buffer (io.vertx.core.buffer.Buffer)2 CommonKafkaClientConfigProperties (org.eclipse.hono.client.kafka.CommonKafkaClientConfigProperties)2 KafkaMockConsumer (org.eclipse.hono.kafka.test.KafkaMockConsumer)2 TenantObject (org.eclipse.hono.util.TenantObject)2 ConfigurationProperties (org.springframework.boot.context.properties.ConfigurationProperties)2 Bean (org.springframework.context.annotation.Bean)2 HashMap (java.util.HashMap)1 KafkaApplicationClientImpl (org.eclipse.hono.application.client.kafka.impl.KafkaApplicationClientImpl)1 ObjectFactoryCreatingFactoryBean (org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean)1 Profile (org.springframework.context.annotation.Profile)1