クラス 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
ネストされたクラスの要約
インターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたネストクラス / インターフェース
IntegrationManagement.ManagementOverridesフィールドのサマリー
フィールド修飾子と型フィールド説明protected booleanprotected @Nullable FunctionSE<Message<?>, ? extends @Nullable ObjectSE> protected final ListSE<FunctionSE<Message<?>, ? extends @Nullable ObjectSE>> クラス org.springframework.integration.handler.AbstractMessageProducingHandler から継承されたフィールド
messagingTemplateクラス org.springframework.integration.context.IntegrationObjectSupport から継承されたフィールド
EXPRESSION_PARSER, loggerインターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたフィールド
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEインターフェース org.springframework.core.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 をスタックに追加して、次の受信メッセージを処理し、それに対する応答を生成します。クラス org.springframework.integration.handler.AbstractMessageProducingHandler から継承されたメソッド
addNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, onInit, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, setupMessageProcessor, shouldCopyRequestHeaders, shouldSplitOutput, updateNotPropagatedHeadersクラス org.springframework.integration.handler.AbstractMessageHandler から継承されたメソッド
handleMessage, onComplete, onError, onNext, onSubscribe, setObservationConventionクラス org.springframework.integration.handler.MessageHandlerSupport から継承されたメソッド
buildSendTimer, destroy, getComponentType, getIntegrationPatternType, getManagedName, getManagedType, getMetricsCaptor, getObservationRegistry, getOrder, getOverrides, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrackクラス org.springframework.integration.context.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クラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, wait, waitSE, waitSEインターフェース reactor.core.CoreSubscriber から継承されたメソッド
currentContextインターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたメソッド
getThisAsインターフェース org.springframework.integration.support.context.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