Class TemporaryQueueRule
java.lang.Object
org.mule.munit.tools.util.queue.api.TemporaryQueueRule
- All Implemented Interfaces:
org.mule.munit.runner.component.rules.TestRule,org.mule.runtime.api.lifecycle.Initialisable
public class TemporaryQueueRule
extends Object
implements org.mule.munit.runner.component.rules.TestRule, org.mule.runtime.api.lifecycle.Initialisable
Rule to manage temporary queues
- Since:
- 1.0.0
- Author:
- Mulesoft Inc.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected org.mule.runtime.core.api.util.queue.QueueManagerFields inherited from interface org.mule.runtime.api.lifecycle.Initialisable
PHASE_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(org.mule.munit.runner.component.rules.TestDescription testDescription) voidvoidpush(Serializable value, String queueName) voidreset()static intReturns the size of the queue associated with the give name.
-
Field Details
-
DEFAULT_QUEUE_NAME
- See Also:
-
queueManager
@Inject @Named("_muleQueueManager") protected org.mule.runtime.core.api.util.queue.QueueManager queueManager
-
-
Constructor Details
-
TemporaryQueueRule
public TemporaryQueueRule()
-
-
Method Details
-
apply
public void apply(org.mule.munit.runner.component.rules.TestDescription testDescription) - Specified by:
applyin interfaceorg.mule.munit.runner.component.rules.TestRule
-
push
-
pop
-
size
Returns the size of the queue associated with the give name. Method is static since it must be able to be called from a expression language function- Parameters:
queueName- name of the queue- Returns:
- size of the queue
-
reset
public void reset()- Specified by:
resetin interfaceorg.mule.munit.runner.component.rules.TestRule
-
initialise
public void initialise()- Specified by:
initialisein interfaceorg.mule.runtime.api.lifecycle.Initialisable
-