public final class MuleTestUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
MuleTestUtils.TestCallback |
| Modifier and Type | Field and Description |
|---|---|
static String |
APPLE_FLOW |
static String |
APPLE_SERVICE |
| Constructor and Description |
|---|
MuleTestUtils() |
| Modifier and Type | Method and Description |
|---|---|
static org.mule.runtime.api.message.Error |
createErrorMock(Exception exception)
Creates an
Error mock that will return the provided exception when calling Error.getCause() |
static Thread |
getRunningThreadByName(String name)
Returns a currently running
Thread of the given name |
static Flow |
getTestFlow(MuleContext context) |
static Injector |
spyInjector(MuleContext muleContext) |
static void |
testWithSystemProperties(Map<String,String> properties,
MuleTestUtils.TestCallback callback)
Executes callback with a given system properties set and replaces the system properties with their original values once done.
|
static void |
testWithSystemProperty(String propertyName,
String propertyValue,
MuleTestUtils.TestCallback callback)
Executes callback with a given system property set and replaces the system property with it's original value once done.
|
public static final String APPLE_SERVICE
public static final String APPLE_FLOW
public static org.mule.runtime.api.message.Error createErrorMock(Exception exception)
Error mock that will return the provided exception when calling Error.getCause()exception - the exception to use to create the mockErrorpublic static Injector spyInjector(MuleContext muleContext)
public static Flow getTestFlow(MuleContext context) throws org.mule.runtime.api.exception.MuleException
org.mule.runtime.api.exception.MuleExceptionpublic static void testWithSystemProperty(String propertyName, String propertyValue, MuleTestUtils.TestCallback callback) throws Exception
propertyName - Name of system property to setpropertyValue - Value of system propertycallback - Callback implementing the the test code and assertions to be run with system property set.Exception - any exception thrown by the execution of callbackpublic static void testWithSystemProperties(Map<String,String> properties, MuleTestUtils.TestCallback callback) throws Exception
Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.