public class MockModule extends Object
| Modifier and Type | Field and Description |
|---|---|
protected org.mule.runtime.api.artifact.Registry |
registry |
| Constructor and Description |
|---|
MockModule() |
| Modifier and Type | Method and Description |
|---|---|
protected SpyProcess |
createSpy(org.mule.runtime.extension.api.runtime.route.Chain processorsFrom) |
protected ProcessorMocker |
mocker() |
void |
setRegistry(org.mule.runtime.api.artifact.Registry registry) |
protected Spy |
spy() |
void |
spy(String processor,
List<org.mule.munit.common.model.Attribute> withAttributes,
org.mule.runtime.extension.api.runtime.route.Chain beforeCall,
org.mule.runtime.extension.api.runtime.route.Chain afterCall)
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.
|
void |
when(String processor,
List<org.mule.munit.common.model.Attribute> withAttributes,
org.mule.munit.common.model.FlowName thenCall)
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 when(String processor, List<org.mule.munit.common.model.Attribute> withAttributes, org.mule.munit.common.model.FlowName thenCall)
processor - processor name.withAttributes - Message processor parameters.thenCall - flow to call to get event to return.public void spy(String processor, List<org.mule.munit.common.model.Attribute> withAttributes, org.mule.runtime.extension.api.runtime.route.Chain beforeCall, org.mule.runtime.extension.api.runtime.route.Chain afterCall)
processor - processor name.withAttributes - Sets of attributes to narrow-down a specific processorbeforeCall - Chain of processors to be executed before the processorafterCall - Chain of processors to be executed after the processorpublic 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 setRegistry(org.mule.runtime.api.artifact.Registry registry)
protected SpyProcess createSpy(org.mule.runtime.extension.api.runtime.route.Chain processorsFrom)
protected ProcessorMocker mocker()
protected Verifier verifier()
protected Spy spy()
Copyright © 2020. All rights reserved.