クラス MockMessageHandler
java.lang.ObjectSE
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.handler.AbstractMessageProducingHandler
org.springframework.integration.test.mock.MockMessageHandler
- 実装済みのインターフェース一覧:
org.reactivestreams.Subscriber<Message<?>>, Aware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, Ordered, ComponentSourceAware, ExpressionCapable, Orderable, MessageProducer, HeaderPropagationAware, IntegrationPattern, NamedComponent, IntegrationManagement, TrackableComponent, MessageHandler, reactor.core.CoreSubscriber<Message<?>>
テストでのモック用の
AbstractMessageProducingHandler 拡張。 提供された ConsumerSE および FunctionSE は、最後のメッセージまで一度に 1 つずつ受信メッセージに適用され、後続のすべてのメッセージに適用されます。同様の動作が Mockito.doReturn(Object toBeReturned, Object... toBeReturnedNext) に存在します。
通常、スタブアクションのチェーンとして使用されます。
MockIntegration.mockMessageHandler()
.handleNext(...)
.handleNext(...)
.handleNextAndReply(...)
.handleNextAndReply(...)
.handleNext(...)
.handleNextAndReply(...);
- 導入:
- 5.0
- 作成者:
- Artem Bilan, Christian Tzolov, Glenn Renfro
ネストされたクラスの概要
インターフェース IntegrationManagement から継承されたネストクラス / インターフェース
IntegrationManagement.ManagementOverridesフィールド概要
フィールド修飾子と型フィールド説明protected booleanprotected @Nullable FunctionSE<Message<?>, ? extends @Nullable ObjectSE> protected final ListSE<FunctionSE<Message<?>, ? extends @Nullable ObjectSE>> クラス AbstractMessageProducingHandler から継承されたフィールド
messagingTemplateクラス IntegrationObjectSupport から継承されたフィールド
EXPRESSION_PARSER, loggerインターフェース IntegrationManagement から継承されたフィールド
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEインターフェース Ordered から継承されたフィールド
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCEコンストラクター概要
コンストラクター修飾子コンストラクター説明protectedMockMessageHandler(@Nullable org.mockito.ArgumentCaptor<Message<?>> messageArgumentCaptor) 方法の概要
修飾子と型メソッド説明protected voidhandleMessageInternal(Message<?> message) handleNext(ConsumerSE<Message<?>> nextMessageConsumer) ConsumerSE をスタックに追加して、次の受信メッセージを処理します。handleNextAndReply(FunctionSE<Message<?>, ? extends @Nullable ObjectSE> nextMessageFunction) FunctionSE をスタックに追加して、次の受信メッセージを処理し、それに対する応答を生成します。クラス AbstractMessageProducingHandler から継承されたメソッド
addNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, onInit, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, setupMessageProcessor, shouldCopyRequestHeaders, shouldSplitOutput, updateNotPropagatedHeadersクラス AbstractMessageHandler から継承されたメソッド
handleMessage, onComplete, onError, onNext, onSubscribe, setObservationConventionクラス MessageHandlerSupport から継承されたメソッド
buildSendTimer, destroy, getComponentType, getIntegrationPatternType, getManagedName, getManagedType, getMetricsCaptor, getObservationRegistry, getOrder, getOverrides, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrackクラス IntegrationObjectSupport から継承されたメソッド
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringクラス ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, wait, waitSE, waitSEインターフェース reactor.core.CoreSubscriber から継承されたメソッド
currentContextインターフェース IntegrationManagement から継承されたメソッド
getThisAsインターフェース NamedComponent から継承されたメソッド
getBeanName, getComponentName
フィールドの詳細
messageFunctions
lastFunction
hasReplies
protected boolean hasReplies
コンストラクターの詳細
MockMessageHandler
protected MockMessageHandler(@Nullable org.mockito.ArgumentCaptor<Message<?>> messageArgumentCaptor)
方法の詳細
handleNext
ConsumerSE をスタックに追加して、次の受信メッセージを処理します。- パラメーター:
nextMessageConsumer- 次の受信メッセージを処理するコンシューマー。- 戻り値:
- this
handleNextAndReply
public MockMessageHandler handleNextAndReply(FunctionSE<Message<?>, ? extends @Nullable ObjectSE> nextMessageFunction) FunctionSE をスタックに追加して、次の受信メッセージを処理し、それに対する応答を生成します。- パラメーター:
nextMessageFunction- 次の受信メッセージを処理する関数。- 戻り値:
- this
handleMessageInternal
- 次で指定:
- クラス
AbstractMessageHandlerのhandleMessageInternal