Class MockIntegration
java.lang.Object
org.springframework.integration.test.mock.MockIntegration
The factory for integration specific mock components.
- Since:
- 5.0
- Author:
- Artem Bilan
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.mockito.ArgumentCaptor<Message<?>>
static MockMessageHandler
Build aMockMessageHandler
instance.static MockMessageHandler
mockMessageHandler
(org.mockito.ArgumentCaptor<Message<?>> messageArgumentCaptor) Build aMockMessageHandler
instance based on the providedArgumentCaptor
.static MessageSource<?>
mockMessageSource
(Message<?> message) Build a mock for theMessageSource
based on the provided message.static MessageSource<?>
mockMessageSource
(Message<?> message, Message<?>... messages) Build a mock for theMessageSource
based on the provided messages.static <T> MessageSource<T>
mockMessageSource
(T payload) Build a mock for theMessageSource
based on the provided payload.static <T> MessageSource<T>
mockMessageSource
(T payload, T... payloads) Build a mock for theMessageSource
based on the provided payloads.
-
Method Details
-
mockMessageSource
Build a mock for theMessageSource
based on the provided payload. The returned instance is ordinary Mockito mock that is capable of recording interactions with it and further verification.- Type Parameters:
T
- the payload type- Parameters:
payload
- the payload to return by mockedMessageSource
- Returns:
- the mocked
MessageSource
- See Also:
-
Mockito.mock(Class)
-
mockMessageSource
Build a mock for theMessageSource
based on the provided payloads. The returned instance is ordinary Mockito mock that is capable of recording interactions with it and further verification.- Type Parameters:
T
- the payload type- Parameters:
payload
- the first payload to return by mockedMessageSource
payloads
- the next payloads to return by mockedMessageSource
- Returns:
- the mocked
MessageSource
- See Also:
-
Mockito.mock(Class)
-
mockMessageSource
Build a mock for theMessageSource
based on the provided message. The returned instance is ordinary Mockito mock that is capable of recording interactions with it and further verification.- Parameters:
message
- the message to return by mockedMessageSource
- Returns:
- the mocked
MessageSource
- See Also:
-
Mockito.mock(Class)
-
mockMessageSource
Build a mock for theMessageSource
based on the provided messages. The returned instance is ordinary Mockito mock that is capable of recording interactions with it and further verification.- Parameters:
message
- the first message to return by mockedMessageSource
messages
- the next messages to return by mockedMessageSource
- Returns:
- the mocked
MessageSource
- See Also:
-
Mockito.mock(Class)
-
mockMessageHandler
Build aMockMessageHandler
instance.- Returns:
- the
MockMessageHandler
instance ready for interaction
-
mockMessageHandler
public static MockMessageHandler mockMessageHandler(org.mockito.ArgumentCaptor<Message<?>> messageArgumentCaptor) Build aMockMessageHandler
instance based on the providedArgumentCaptor
.- Parameters:
messageArgumentCaptor
- the Mockito ArgumentCaptor to capture incoming messages- Returns:
- the MockMessageHandler instance ready for interaction
-
messageArgumentCaptor
-