java.lang.Object
io.helidon.messaging.connectors.mock.MockConnector
- All Implemented Interfaces:
ConnectorFactory
,IncomingConnectorFactory
,OutgoingConnectorFactory
@ApplicationScoped
public class MockConnector
extends Object
implements IncomingConnectorFactory, OutgoingConnectorFactory
Helidon messaging mock connector for testing purposes.
Mock connector for testing Helidon messaging
without the need of connection to actual messaging broker.
-
Field Summary
Fields inherited from interface org.eclipse.microprofile.reactive.messaging.spi.ConnectorFactory
CHANNEL_NAME_ATTRIBUTE, CONNECTOR_ATTRIBUTE, CONNECTOR_PREFIX, INCOMING_PREFIX, OUTGOING_PREFIX
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionPublisherBuilder
<? extends Message<?>> getPublisherBuilder
(Config config) SubscriberBuilder
<? extends Message<?>, Void> getSubscriberBuilder
(Config config) <P> MockIncoming
<P> Retrieve mocker for incoming channel.<P> MockOutgoing
<P> Retrieve mocker for outgoing channel.
-
Field Details
-
CONNECTOR_NAME
Connector name.- See Also:
-
-
Constructor Details
-
MockConnector
public MockConnector()
-
-
Method Details
-
getPublisherBuilder
- Specified by:
getPublisherBuilder
in interfaceIncomingConnectorFactory
-
getSubscriberBuilder
- Specified by:
getSubscriberBuilder
in interfaceOutgoingConnectorFactory
-
incoming
Retrieve mocker for incoming channel. Incoming channel needs to be configured to use MockConnector with:@AddConfig(key = "mp.messaging.incoming.test-channel-incoming", value = MockConnector.CONNECTOR_NAME)
- Type Parameters:
P
- type of the payload- Parameters:
channelName
- Channel name, for exampletest-channel-incoming
type
- Type of the payload- Returns:
- mocker for desired chanel
-
outgoing
Retrieve mocker for outgoing channel. Outgoing channel needs to be configured to use MockConnector with:@AddConfig(key = "mp.messaging.outgoing.test-channel-outgoing", value = MockConnector.CONNECTOR_NAME)
- Type Parameters:
P
- type of the payload- Parameters:
channelName
- Channel name, for exampletest-channel-outgoing
type
- Type of the payload- Returns:
- mocker for desired chanel
-