クラス 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
- 関連事項:
フィールドのサマリー
フィールドコンストラクターの概要
コンストラクターメソッドのサマリー
修飾子と型メソッド説明void
postProcessBeforeInitialization
(ObjectSE bean, StringSE beanName) void
resetBeans
(StringSE... beanNames) テストの実行後、モックされた Bean を実際の状態に戻します。void
setBeanFactory
(BeanFactory beanFactory) void
substituteMessageHandlerFor
(StringSE consumerEndpointId, MessageHandler mockMessageHandler) void
substituteMessageHandlerFor
(StringSE consumerEndpointId, MessageHandler mockMessageHandler, boolean autoStartup) void
substituteMessageSourceFor
(StringSE pollingAdapterId, MessageSource<?> mockMessageSource) void
substituteMessageSourceFor
(StringSE pollingAdapterId, MessageSource<?> mockMessageSource, boolean autoStartup) void
substituteTriggerFor
(StringSE pollingEndpointId, Trigger trigger) AbstractPollingEndpoint
Bean 内の実際のTrigger
を、提供されたインスタンスに置き換えます。void
substituteTriggerFor
(StringSE pollingEndpointId, Trigger trigger, boolean autoStartup) AbstractPollingEndpoint
Bean 内の実際の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) SourcePollingChannelAdapter
Bean の実際のMessageSource
を、提供されているMessageSource
インスタンスに置き換えます。モックオブジェクトにすることができます。- パラメーター:
pollingAdapterId
- エンドポイント Bean 名mockMessageSource
- エンドポイント Bean で置き換えるMessageSource
- 関連事項:
substituteMessageSourceFor
public void substituteMessageSourceFor(StringSE pollingAdapterId, MessageSource<?> mockMessageSource, boolean autoStartup) SourcePollingChannelAdapter
Bean の実際のMessageSource
を、提供されているMessageSource
インスタンスに置き換えます。モックオブジェクトにすることができます。autoStartup == false
の場合、エンドポイントは開始されません。- パラメーター:
pollingAdapterId
- エンドポイント Bean 名mockMessageSource
- エンドポイント Bean で置き換えるMessageSource
autoStartup
-MessageSource
を交換した後、エンドポイントを開始するかどうか- 関連事項:
substituteMessageHandlerFor
public void substituteMessageHandlerFor(StringSE consumerEndpointId, MessageHandler mockMessageHandler) substituteMessageHandlerFor
public void substituteMessageHandlerFor(StringSE consumerEndpointId, MessageHandler mockMessageHandler, boolean autoStartup) substituteTriggerFor
AbstractPollingEndpoint
Bean 内の実際のTrigger
を、提供されたインスタンスに置き換えます。- パラメーター:
pollingEndpointId
- 交換するAbstractPollingEndpoint
Bean IDtrigger
-Trigger
をAbstractPollingEndpoint
に設定する- 導入:
- 6.3
substituteTriggerFor
AbstractPollingEndpoint
Bean 内の実際のTrigger
を指定されたインスタンスに置き換えます。エンドポイントはautoStartup == false
の場合は開始されません。- パラメーター:
pollingEndpointId
- 交換するAbstractPollingEndpoint
Bean IDtrigger
-Trigger
をAbstractPollingEndpoint
に設定するautoStartup
-MessageSource
を交換した後、エンドポイントを開始するかどうか- 導入:
- 6.3