Class MockIntegration
java.lang.Object
org.springframework.integration.test.mock.MockIntegration
public final class MockIntegration
extends java.lang.Object
The factory for integration specific mock components.
- Since:
- 5.0
-
Method Summary
Modifier and Type Method Description static org.mockito.ArgumentCaptor<org.springframework.messaging.Message<?>>messageArgumentCaptor()static MockMessageHandlermockMessageHandler()Build aMockMessageHandlerinstance.static MockMessageHandlermockMessageHandler(org.mockito.ArgumentCaptor<org.springframework.messaging.Message<?>> messageArgumentCaptor)Build aMockMessageHandlerinstance based on the providedArgumentCaptor.static org.springframework.integration.core.MessageSource<?>mockMessageSource(org.springframework.messaging.Message<?> message)Build a mock for theMessageSourcebased on the provided message.static org.springframework.integration.core.MessageSource<?>mockMessageSource(org.springframework.messaging.Message<?> message, org.springframework.messaging.Message<?>... messages)Build a mock for theMessageSourcebased on the provided messages.static <T> org.springframework.integration.core.MessageSource<T>mockMessageSource(T payload)Build a mock for theMessageSourcebased on the provided payload.static <T> org.springframework.integration.core.MessageSource<T>mockMessageSource(T payload, T... payloads)Build a mock for theMessageSourcebased on the provided payloads.
-
Method Details
-
mockMessageSource
public static <T> org.springframework.integration.core.MessageSource<T> mockMessageSource(T payload)Build a mock for theMessageSourcebased 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
public static <T> org.springframework.integration.core.MessageSource<T> mockMessageSource(T payload, T... payloads)Build a mock for theMessageSourcebased 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 mockedMessageSourcepayloads- the next payloads to return by mockedMessageSource- Returns:
- the mocked
MessageSource - See Also:
Mockito.mock(Class)
-
mockMessageSource
public static org.springframework.integration.core.MessageSource<?> mockMessageSource(org.springframework.messaging.Message<?> message)Build a mock for theMessageSourcebased 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
public static org.springframework.integration.core.MessageSource<?> mockMessageSource(org.springframework.messaging.Message<?> message, org.springframework.messaging.Message<?>... messages)Build a mock for theMessageSourcebased 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 mockedMessageSourcemessages- the next messages to return by mockedMessageSource- Returns:
- the mocked
MessageSource - See Also:
Mockito.mock(Class)
-
mockMessageHandler
Build aMockMessageHandlerinstance.- Returns:
- the
MockMessageHandlerinstance ready for interaction
-
mockMessageHandler
public static MockMessageHandler mockMessageHandler(org.mockito.ArgumentCaptor<org.springframework.messaging.Message<?>> messageArgumentCaptor)Build aMockMessageHandlerinstance based on the providedArgumentCaptor.- Parameters:
messageArgumentCaptor- the Mockito ArgumentCaptor to capture incoming messages- Returns:
- the MockMessageHandler instance ready for interaction
-
messageArgumentCaptor
public static org.mockito.ArgumentCaptor<org.springframework.messaging.Message<?>> messageArgumentCaptor()
-