public class MockModule extends Object
| Modifier and Type | Field and Description |
|---|---|
protected org.mule.runtime.core.api.MuleContext |
muleContext |
| Constructor and Description |
|---|
MockModule() |
| Modifier and Type | Method and Description |
|---|---|
protected SpyProcess |
createSpy(List<org.mule.runtime.core.api.processor.Processor> processorsFrom) |
protected ProcessorMocker |
mocker() |
void |
setMuleContext(org.mule.runtime.core.api.MuleContext muleContext) |
protected Spy |
spy() |
void |
spy(String processor,
List<org.mule.munit.common.model.Attribute> withAttributes,
List<org.mule.runtime.core.api.NestedProcessor> assertionsBeforeCall,
List<org.mule.runtime.core.api.NestedProcessor> assertionsAfterCall)
Define what the mock must return on a processor call.
|
protected Verifier |
verifier() |
void |
verifyCall(String processor,
List<org.mule.munit.common.model.Attribute> attributes,
Integer times,
Integer atLeast,
Integer atMost)
Check that the processor was called with some specified parameters
|
void |
when(String processor,
List<org.mule.munit.common.model.Attribute> withAttributes,
org.mule.munit.common.model.Event thenReturn)
Define what the mock must return on a message processor call.
|
public void when(String processor, List<org.mule.munit.common.model.Attribute> withAttributes, org.mule.munit.common.model.Event thenReturn)
processor - processor name.thenReturn - Expected return value.withAttributes - Message processor parameters.public void spy(String processor, List<org.mule.munit.common.model.Attribute> withAttributes, List<org.mule.runtime.core.api.NestedProcessor> assertionsBeforeCall, List<org.mule.runtime.core.api.NestedProcessor> assertionsAfterCall)
processor - processor name.withAttributes - Sets of attributes to narrow-down a specific processorassertionsBeforeCall - Expected return value.assertionsAfterCall - processor parameters.public void verifyCall(String processor, List<org.mule.munit.common.model.Attribute> attributes, Integer times, Integer atLeast, Integer atMost)
processor - processor Idattributes - processor parameters.times - Number of times the processor has to be calledatLeast - Number of time the processor has to be called at least.atMost - Number of times the processor has to be called at most.public void setMuleContext(org.mule.runtime.core.api.MuleContext muleContext)
protected SpyProcess createSpy(List<org.mule.runtime.core.api.processor.Processor> processorsFrom)
protected ProcessorMocker mocker()
protected Verifier verifier()
protected Spy spy()
Copyright © 2017. All Rights Reserved.