Class EntityRemoveRule

java.lang.Object
org.junit.rules.TestWatcher
org.operaton.bpm.engine.test.util.EntityRemoveRule
All Implemented Interfaces:
org.junit.rules.TestRule

public class EntityRemoveRule extends org.junit.rules.TestWatcher
JUnit 4 Rule that performs resource cleanup for methods that require post-method execution cleanup. Currently, the rule supports only clean up of Tasks but the rule can be extended for other resources that might pollute sequential execution of other test methods.
  • Field Details

  • Method Details

    • of

      public static EntityRemoveRule of(ProcessEngineTestRule rule)
    • ofLazyRule

      public static EntityRemoveRule ofLazyRule(Supplier<ProcessEngineTestRule> ruleSupplier)
    • apply

      public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base, org.junit.runner.Description description)
      Specified by:
      apply in interface org.junit.rules.TestRule
      Overrides:
      apply in class org.junit.rules.TestWatcher
    • executePostEvaluate

      protected void executePostEvaluate(RemoveAfter removeAfterAnnotation, boolean methodHasRemoveAfterAnnotation)
    • executePreRemoval

      protected void executePreRemoval()
      Hook method to supp
    • executeRemoval

      protected void executeRemoval(RemoveAfter removeAfterAnnotation)
      Hook method for executing removal.
      Parameters:
      removeAfterAnnotation - the remove after annotation parameter of the executing method.