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 Details

    • DEFAULT_QUEUE_NAME

      public static final String 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:
      apply in interface org.mule.munit.runner.component.rules.TestRule
    • push

      public void push(Serializable value, String queueName)
    • pop

      public Serializable pop(String queueName, Long timeOut)
    • size

      public static int size(String queueName)
      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:
      reset in interface org.mule.munit.runner.component.rules.TestRule
    • initialise

      public void initialise()
      Specified by:
      initialise in interface org.mule.runtime.api.lifecycle.Initialisable