クラス MockIntegrationContext
java.lang.ObjectSE
org.springframework.integration.test.context.MockIntegrationContext
- 実装されているすべてのインターフェース:
Aware、BeanFactoryAware、BeanPostProcessor、SmartInitializingSingleton
public class MockIntegrationContext
extends ObjectSE
implements BeanPostProcessor, SmartInitializingSingleton, BeanFactoryAware
テストコードからアプリケーションコンテキストで実際の Bean をカスタマイズするための API を備えた
BeanFactoryAware コンポーネント。 このクラスの Bean は、SpringIntegrationTest アノテーションを介して自動的に登録され、テストクラスにオートワイヤーできます。
- 導入:
- 5.0
- 作成者:
- Artem Bilan, Yicheng Feng, Alexander Hain
- 関連事項:
フィールドのサマリー
フィールドコンストラクターの概要
コンストラクターメソッドのサマリー
修飾子と型メソッド説明voidpostProcessBeforeInitialization(ObjectSE bean, StringSE beanName) voidresetBeans(StringSE... beanNames) テストの実行後、モックされた Bean を実際の状態に戻します。voidsetBeanFactory(BeanFactory beanFactory) voidsubstituteMessageHandlerFor(StringSE consumerEndpointId, MessageHandler mockMessageHandler) voidsubstituteMessageHandlerFor(StringSE consumerEndpointId, MessageHandler mockMessageHandler, boolean autoStartup) voidsubstituteMessageSourceFor(StringSE pollingAdapterId, MessageSource<?> mockMessageSource) voidsubstituteMessageSourceFor(StringSE pollingAdapterId, MessageSource<?> mockMessageSource, boolean autoStartup) voidsubstituteTriggerFor(StringSE pollingEndpointId, Trigger trigger) AbstractPollingEndpointBean 内の実際のTriggerを、提供されたインスタンスに置き換えます。voidsubstituteTriggerFor(StringSE pollingEndpointId, Trigger trigger, boolean autoStartup) AbstractPollingEndpointBean 内の実際のTriggerを、提供されたインスタンスに置き換えます。クラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSEインターフェース org.springframework.beans.factory.config.BeanPostProcessor から継承されたメソッド
postProcessAfterInitialization
フィールドの詳細
MOCK_INTEGRATION_CONTEXT_BEAN_NAME
コンストラクターの詳細
MockIntegrationContext
public MockIntegrationContext()
メソッドの詳細
setBeanFactory
- 次で指定:
- インターフェース
BeanFactoryAwareのsetBeanFactory - 例外:
BeansException
postProcessBeforeInitialization
public ObjectSE postProcessBeforeInitialization(ObjectSE bean, StringSE beanName) throws BeansException - 次で指定:
- インターフェース
BeanPostProcessorのpostProcessBeforeInitialization - 例外:
BeansException
afterSingletonsInstantiated
public void afterSingletonsInstantiated()- 次で指定:
- インターフェース
SmartInitializingSingletonのafterSingletonsInstantiated
resetBeans
実行テスト後にモック化された Bean を実際の状態に戻します。通常、このメソッドは JUnit クリーンアップメソッドから使用されます。- パラメーター:
beanNames- リセットする Bean 名。nullの場合、すべてのモックされた Bean がリセットされます
substituteMessageSourceFor
public void substituteMessageSourceFor(StringSE pollingAdapterId, MessageSource<?> mockMessageSource) SourcePollingChannelAdapterBean の実際のMessageSourceを、提供されているMessageSourceインスタンスに置き換えます。モックオブジェクトにすることができます。- パラメーター:
pollingAdapterId- エンドポイント Bean 名mockMessageSource- エンドポイント Bean で置き換えるMessageSource- 関連事項:
substituteMessageSourceFor
public void substituteMessageSourceFor(StringSE pollingAdapterId, MessageSource<?> mockMessageSource, boolean autoStartup) SourcePollingChannelAdapterBean の実際のMessageSourceを、提供されているMessageSourceインスタンスに置き換えます。モックオブジェクトにすることができます。autoStartup == falseの場合、エンドポイントは開始されません。- パラメーター:
pollingAdapterId- エンドポイント Bean 名mockMessageSource- エンドポイント Bean で置き換えるMessageSourceautoStartup-MessageSourceを交換した後、エンドポイントを開始するかどうか- 関連事項:
substituteMessageHandlerFor
public void substituteMessageHandlerFor(StringSE consumerEndpointId, MessageHandler mockMessageHandler) substituteMessageHandlerFor
public void substituteMessageHandlerFor(StringSE consumerEndpointId, MessageHandler mockMessageHandler, boolean autoStartup) substituteTriggerFor
AbstractPollingEndpointBean 内の実際のTriggerを、提供されたインスタンスに置き換えます。- パラメーター:
pollingEndpointId- 交換するAbstractPollingEndpointBean IDtrigger-TriggerをAbstractPollingEndpointに設定する- 導入:
- 6.3
substituteTriggerFor
AbstractPollingEndpointBean 内の実際のTriggerを指定されたインスタンスに置き換えます。エンドポイントはautoStartup == falseの場合は開始されません。- パラメーター:
pollingEndpointId- 交換するAbstractPollingEndpointBean IDtrigger-TriggerをAbstractPollingEndpointに設定するautoStartup-MessageSourceを交換した後、エンドポイントを開始するかどうか- 導入:
- 6.3