public class MunitApplicationContextPostProcessor extends Object
This class changes the endpoint factory and inject the mock manager
This is a piece part of the endpoint mocking. By overriding the endpoint factory we can mock all the outbound/inbound endpoints of a mule application
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
mockConnectors
Defines if the app connectors for outbound/inbound endpoints have to be mocked.
|
protected boolean |
mockInbounds
Defines if the inbounds must be mocked or not.
|
protected List<String> |
mockingExcludedFlows
List of flows which we don't want to mock the inbound message sources
|
| Constructor and Description |
|---|
MunitApplicationContextPostProcessor() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isMockConnectors() |
boolean |
isMockInbounds() |
void |
postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory,
Class endpointFactoryClass)
Implementation of the BeanFactoryPostProcessor.
|
void |
setMockConnectors(boolean mockConnectors) |
void |
setMockInbounds(boolean mockInbounds) |
void |
setMockingExcludedFlows(List<String> mockingExcludedFlows) |
protected boolean mockInbounds
Defines if the inbounds must be mocked or not. This is pure Munit configuration
protected boolean mockConnectors
Defines if the app connectors for outbound/inbound endpoints have to be mocked. If they are then all outbound endpoints/inbound endpoints must be mocked.
public MunitApplicationContextPostProcessor()
public void setMockInbounds(boolean mockInbounds)
public boolean isMockInbounds()
public boolean isMockConnectors()
public void setMockConnectors(boolean mockConnectors)
public void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory,
Class endpointFactoryClass)
throws org.springframework.beans.BeansException
Implementation of the BeanFactoryPostProcessor. It removes the message sources of all the flows except for the ones specified in mockingExcludedFlows. Only if mockInbounds is true.
beanFactory - The spring bean factory
org.springframework.beans.BeansException - When post processing fails. Never thrown for this implementation
Copyright © 2016. All rights reserved.