use of org.eclipse.hono.client.registry.CredentialsClient in project hono by eclipse.
the class ProtocolAdapterMockSupport method createCredentialsClientMock.
private CredentialsClient createCredentialsClientMock() {
final CredentialsClient client = mock(CredentialsClient.class);
when(client.start()).thenReturn(Future.succeededFuture());
when(client.stop()).thenReturn(Future.succeededFuture());
return client;
}
use of org.eclipse.hono.client.registry.CredentialsClient in project hono by eclipse.
the class AbstractProtocolAdapterBaseTest method setup.
/**
* Sets up the fixture.
*/
@BeforeEach
public void setup() {
tenantClient = mock(TenantClient.class);
when(tenantClient.start()).thenReturn(Future.succeededFuture());
registrationClient = mock(DeviceRegistrationClient.class);
when(registrationClient.start()).thenReturn(Future.succeededFuture());
credentialsClient = mock(CredentialsClient.class);
when(credentialsClient.start()).thenReturn(Future.succeededFuture());
amqpTelemetrySender = mockMessagingClient(TelemetrySender.class, MessagingType.amqp);
when(amqpTelemetrySender.start()).thenReturn(Future.succeededFuture());
kafkaTelemetrySender = mockMessagingClient(TelemetrySender.class, MessagingType.kafka);
when(kafkaTelemetrySender.start()).thenReturn(Future.succeededFuture());
amqpEventSender = mockMessagingClient(EventSender.class, MessagingType.amqp);
when(amqpEventSender.start()).thenReturn(Future.succeededFuture());
kafkaEventSender = mockMessagingClient(EventSender.class, MessagingType.kafka);
when(kafkaEventSender.start()).thenReturn(Future.succeededFuture());
commandConsumerFactory = mock(CommandConsumerFactory.class);
when(commandConsumerFactory.start()).thenReturn(Future.succeededFuture());
amqpCommandResponseSender = mockMessagingClient(CommandResponseSender.class, MessagingType.amqp);
when(amqpCommandResponseSender.start()).thenReturn(Future.succeededFuture());
kafkaCommandResponseSender = mockMessagingClient(CommandResponseSender.class, MessagingType.kafka);
when(kafkaCommandResponseSender.start()).thenReturn(Future.succeededFuture());
final var telemetrySenderProvider = new MessagingClientProvider<TelemetrySender>().setClient(amqpTelemetrySender).setClient(kafkaTelemetrySender);
final var eventSenderProvider = new MessagingClientProvider<EventSender>().setClient(amqpEventSender).setClient(kafkaEventSender);
final var commandResponseSenderProvider = new MessagingClientProvider<CommandResponseSender>().setClient(amqpCommandResponseSender).setClient(kafkaCommandResponseSender);
messagingClientProviders = new MessagingClientProviders(telemetrySenderProvider, eventSenderProvider, commandResponseSenderProvider);
commandRouterClient = mock(CommandRouterClient.class);
when(commandRouterClient.start()).thenReturn(Future.succeededFuture());
properties = new ProtocolAdapterProperties();
adapter = newProtocolAdapter(properties, ADAPTER_NAME);
setCollaborators(adapter);
vertx = mock(Vertx.class);
VertxMockSupport.runTimersImmediately(vertx);
context = mock(Context.class);
adapter.init(vertx, context);
}
use of org.eclipse.hono.client.registry.CredentialsClient in project hono by eclipse.
the class X509AuthProviderTest method setUp.
@BeforeAll
static void setUp() {
final CredentialsClient credentialsClient = mock(CredentialsClient.class);
provider = new X509AuthProvider(credentialsClient, NoopTracerFactory.create());
}
Aggregations