public class MockIntegrationContext extends ObjectSE implements BeanFactoryAware
BeanFactoryAware コンポーネント。 このクラスの Bean は、SpringIntegrationTest アノテーションを介して自動的に登録され、テストクラスにオートワイヤーできます。
SpringIntegrationTest| 修飾子と型 | フィールドと説明 |
|---|---|
static StringSE | MOCK_INTEGRATION_CONTEXT_BEAN_NAME モック統合コンテキストの Bean 名。 |
| コンストラクターと説明 |
|---|
MockIntegrationContext() |
| 修飾子と型 | メソッドと説明 |
|---|---|
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) |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSEpublic void setBeanFactory(BeanFactory beanFactory) throws BeansException
BeanFactoryAware の setBeanFactory BeansExceptionpublic void resetBeans(StringSE... beanNames)
After メソッドから使用されます。beanNames - リセットする Bean 名。null の場合、すべてのモックされた Bean がリセットされます public void substituteMessageSourceFor(StringSE pollingAdapterId, MessageSource<?> mockMessageSource)
SourcePollingChannelAdapter Bean の実際の MessageSource を、提供されている MessageSource インスタンスに置き換えます。モックオブジェクトにすることができます。pollingAdapterId - エンドポイント Bean 名 mockMessageSource - エンドポイント Bean で置き換える MessageSourceMockIntegration.mockMessageSource(T)public void substituteMessageSourceFor(StringSE pollingAdapterId, MessageSource<?> mockMessageSource, boolean autoStartup)
SourcePollingChannelAdapter Bean の実際の MessageSource を、提供されている MessageSource インスタンスに置き換えます。モックオブジェクトにすることができます。autoStartup == false の場合、エンドポイントは開始されません。pollingAdapterId - エンドポイント Bean 名 mockMessageSource - エンドポイント Bean で置き換える MessageSourceautoStartup - MessageSource を交換した後、エンドポイントを開始するかどうか MockIntegration.mockMessageSource(T)public void substituteMessageHandlerFor(StringSE consumerEndpointId, MessageHandler mockMessageHandler)
public void substituteMessageHandlerFor(StringSE consumerEndpointId, MessageHandler mockMessageHandler, boolean autoStartup)