Package org.mule.tests.internal
Class AssertOperations
java.lang.Object
org.mule.tests.internal.AssertOperations
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidassertIntercepting(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 nestedinterceptedChaindid or did not occur, according to the givenresponseSameTaskflag.
-
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 nestedinterceptedChaindid or did not occur, according to the givenresponseSameTaskflag.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
processreturns 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-trueif the intercepted chain must not do any thread switch,falseif 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.
-