public class TestFlow extends org.mule.runtime.core.privileged.processor.CompositeProcessorChainRouter implements TestComponent
The Test Flow
| Modifier and Type | Class and Description |
|---|---|
protected class |
TestFlow.ExceptionAwareCallable |
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
logger |
static String |
MUNIT_TEST_TIMEOUT_PROPERTY |
protected Optional<MunitModule> |
munitModule |
muleContext| Constructor and Description |
|---|
TestFlow() |
| Modifier and Type | Method and Description |
|---|---|
void |
addProcessingStrategy(String childName,
org.mule.runtime.core.api.processor.strategy.ProcessingStrategy processingStrategy) |
void |
dispose() |
protected org.mule.runtime.api.event.Event |
doExecute(org.mule.runtime.api.event.Event event) |
protected Boolean |
evaluateExpectException(org.mule.runtime.api.event.Event event) |
protected Boolean |
exceptionMatches(Throwable exception) |
String |
getDescription() |
EnableFlowSources |
getEnableFlowSources() |
String |
getExpectedErrorDescription() |
String |
getExpectedErrorType() |
String |
getExpectedException() |
String |
getName() |
Set<String> |
getTags() |
Integer |
getTimeOut() |
void |
initialise() |
protected boolean |
isErrorDescriptionExpected(org.mule.runtime.api.message.Error error) |
protected boolean |
isErrorIdExpected(org.mule.runtime.api.event.Event exceptionEvent) |
protected boolean |
isExceptionExpected(Throwable exception,
org.mule.runtime.api.event.Event exceptionEvent) |
protected boolean |
isExpectingFailure()
Validates if this Test is expecting to fail
|
boolean |
isIgnored() |
protected List<org.mule.runtime.core.api.processor.ReactiveProcessor> |
processorChainsToExecute(List<org.mule.runtime.core.privileged.processor.chain.MessageProcessorChain> chains)
We override this method that is present since Mule Version 4.2.0.
|
org.mule.runtime.api.event.Event |
run(org.mule.runtime.api.event.Event event) |
void |
setDescription(String description) |
void |
setEnableFlowSources(EnableFlowSources enableFlowSources) |
protected void |
setErrorTypeRepository(org.mule.runtime.api.exception.ErrorTypeRepository errorTypeRepository) |
void |
setExpectedErrorDescription(String expectedErrorDescription) |
void |
setExpectedErrorType(String expectedErrorType) |
void |
setExpectedException(String expectedException) |
protected void |
setExtendedExpressionManager(org.mule.runtime.core.api.el.ExtendedExpressionManager extendedExpressionManager) |
void |
setIgnore(String ignore) |
protected void |
setSchedulerService(org.mule.runtime.api.scheduler.SchedulerService schedulerService) |
void |
setTags(String tags) |
void |
setTimeOut(Integer timeout) |
void |
setUp() |
void |
start() |
void |
startFlowSources() |
void |
stop() |
void |
stopFlowSources() |
void |
tearDown() |
protected Optional<org.junit.ComparisonFailure> |
validateExpected(org.mule.runtime.api.message.Error error,
org.mule.runtime.api.event.Event exceptionEvent)
Validates if the MUnit Test Flow is expecting this specific exception
|
getExecutableFunction, setMuleContext, setProcessorChainscreateChildEventContext, createEventContext, execute, executegetAnnotation, getAnnotations, getLocation, getRootContainerLocation, setAnnotationspublic static final String MUNIT_TEST_TIMEOUT_PROPERTY
protected static final transient org.slf4j.Logger logger
@Inject protected Optional<MunitModule> munitModule
public boolean isIgnored()
isIgnored in interface TestComponentpublic void setIgnore(String ignore)
public String getExpectedErrorType()
public void setExpectedErrorType(String expectedErrorType)
public String getExpectedException()
public void setExpectedException(String expectedException)
public String getExpectedErrorDescription()
public void setExpectedErrorDescription(String expectedErrorDescription)
public void setTimeOut(Integer timeout)
public Integer getTimeOut()
public Set<String> getTags()
getTags in interface TestComponentpublic void setTags(String tags)
public String getDescription()
getDescription in interface TestComponentpublic void setDescription(String description)
public EnableFlowSources getEnableFlowSources()
public void setEnableFlowSources(EnableFlowSources enableFlowSources)
public String getName()
getName in interface TestComponentpublic org.mule.runtime.api.event.Event run(org.mule.runtime.api.event.Event event)
throws Throwable
run in interface TestComponentThrowablepublic void setUp()
setUp in interface TestComponentpublic void tearDown()
tearDown in interface TestComponentpublic void startFlowSources()
public void stopFlowSources()
protected org.mule.runtime.api.event.Event doExecute(org.mule.runtime.api.event.Event event)
throws InterruptedException,
ExecutionException
protected boolean isExpectingFailure()
protected Optional<org.junit.ComparisonFailure> validateExpected(org.mule.runtime.api.message.Error error, org.mule.runtime.api.event.Event exceptionEvent) throws org.mule.munit.common.exception.MunitError
error - the error inside the EventexceptionEvent - the event coming with the exceptionorg.mule.munit.common.exception.MunitError - in case of major internal errorprotected boolean isErrorIdExpected(org.mule.runtime.api.event.Event exceptionEvent)
throws org.mule.munit.common.exception.MunitError
org.mule.munit.common.exception.MunitErrorprotected boolean isExceptionExpected(Throwable exception, org.mule.runtime.api.event.Event exceptionEvent) throws org.mule.munit.common.exception.MunitError
org.mule.munit.common.exception.MunitErrorprotected boolean isErrorDescriptionExpected(org.mule.runtime.api.message.Error error)
throws org.mule.munit.common.exception.MunitError
org.mule.munit.common.exception.MunitErrorprotected Boolean evaluateExpectException(org.mule.runtime.api.event.Event event) throws org.mule.munit.common.exception.MunitError
org.mule.munit.common.exception.MunitErrorprotected Boolean exceptionMatches(Throwable exception) throws org.mule.munit.common.exception.MunitError
org.mule.munit.common.exception.MunitErrorprotected void setErrorTypeRepository(org.mule.runtime.api.exception.ErrorTypeRepository errorTypeRepository)
protected void setExtendedExpressionManager(org.mule.runtime.core.api.el.ExtendedExpressionManager extendedExpressionManager)
protected void setSchedulerService(org.mule.runtime.api.scheduler.SchedulerService schedulerService)
public void addProcessingStrategy(String childName, org.mule.runtime.core.api.processor.strategy.ProcessingStrategy processingStrategy)
public void initialise()
throws org.mule.runtime.api.lifecycle.InitialisationException
initialise in interface org.mule.runtime.api.lifecycle.Initialisableinitialise in class org.mule.runtime.core.privileged.processor.CompositeProcessorChainRouterorg.mule.runtime.api.lifecycle.InitialisationExceptionpublic void start()
throws org.mule.runtime.api.exception.MuleException
start in interface org.mule.runtime.api.lifecycle.Startablestart in class org.mule.runtime.core.privileged.processor.CompositeProcessorChainRouterorg.mule.runtime.api.exception.MuleExceptionpublic void stop()
throws org.mule.runtime.api.exception.MuleException
stop in interface org.mule.runtime.api.lifecycle.Stoppablestop in class org.mule.runtime.core.privileged.processor.CompositeProcessorChainRouterorg.mule.runtime.api.exception.MuleExceptionpublic void dispose()
dispose in interface org.mule.runtime.api.lifecycle.Disposabledispose in class org.mule.runtime.core.privileged.processor.CompositeProcessorChainRouterprotected List<org.mule.runtime.core.api.processor.ReactiveProcessor> processorChainsToExecute(List<org.mule.runtime.core.privileged.processor.chain.MessageProcessorChain> chains)
Copyright © 2019. All rights reserved.