Class AssertOperations

java.lang.Object
org.mule.tests.internal.AssertOperations

public class AssertOperations extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    assertIntercepting(boolean responseSameTask, org.mule.runtime.extension.api.runtime.route.Chain interceptedChain, org.mule.runtime.extension.api.runtime.process.CompletionCallback<Object,Object> callback)
    Verify that a thread switch on the nested interceptedChain did or did not occur, according to the given responseSameTask flag.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AssertOperations

      public AssertOperations()
  • Method Details

    • assertIntercepting

      @MediaType(value="*/*", strict=false) public void assertIntercepting(@Optional(defaultValue="true") boolean responseSameTask, org.mule.runtime.extension.api.runtime.route.Chain interceptedChain, org.mule.runtime.extension.api.runtime.process.CompletionCallback<Object,Object> callback)
      Verify that a thread switch on the nested interceptedChain did or did not occur, according to the given responseSameTask flag.

      Rather than comparing thread identity (which pooled threads recycle), this detects whether the intercepted chain crossed an asynchronous boundary: a response that resolves synchronously on the request thread before process returns is considered the "same task"; any response that resolves later (on another thread, or on the same pooled thread reassigned as a subsequent task) is considered a thread switch.

      Parameters:
      responseSameTask - true if the intercepted chain must not do any thread switch, false if a thread switch is expected.
      interceptedChain - the chain in which a thread switch is expected or not.
      callback - the callback used to complete the operation.