public enum Expressions extends Enum<Expressions>
Mocks.register(String, Object) and
Mocks.get(Object) in a type-safe
way.
When mocking JavaDelegate, ExecutionListener or TaskListener, use
DelegateExpressions instead.| Modifier and Type | Method and Description |
|---|---|
static <T> T |
getRegistered(Class<?> type) |
static <T> T |
getRegistered(String name) |
static <T> T |
registerInstance(String name,
T instance)
Delegates to
Mocks.register(String, Object) |
static <T> T |
registerInstance(T instance)
If you already have the instance, register it directly.
|
static void |
registerInstancesForFields(Object instance)
Registers mocks via
Mocks.register(String, Object) for
all attributes with Named-types. |
static <T> T |
registerMockInstance(Class<T> type)
Creates a mock for the given type and registers it.
|
static <T> T |
registerMockInstance(String name,
Class<T> type)
Creates a mock for the given type and registers it.
|
static void |
registerMockInstances(Class<?>... types)
Creates and registers mock instance for every given type.
|
static void |
registerMockInstances(Collection<Class<?>> types)
Creates and registers mock instance for every given type.
|
static void |
registerMockInstancesForNestedTypes(Class<?> parentClass)
Registers mock instances for every public static nested class found in
parentClass.
|
static <T> T |
registerNewInstance(Class<T> type)
Creates a new instance for the given type using the default constructor and
registers it.
|
static <T> T |
registerNewInstance(String name,
Class<T> type)
Creates a new instance for the given type and registers it under the given
name.
|
static void |
registerNewInstancesForNestedTypes(Class<?> parentClass)
Registers new instances for every public static nested class found in
parentClass.
|
static void |
reset() |
static Expressions |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Expressions[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static Expressions[] values()
for (Expressions c : Expressions.values()) System.out.println(c);
public static Expressions valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static void registerMockInstancesForNestedTypes(Class<?> parentClass)
parentClass - the parentClass to scan for nested public static typespublic static void registerInstancesForFields(Object instance)
Mocks.register(String, Object) for
all attributes with Named-types.instance - instance who's fields are registered (maybe Junit test or jbehave
steps).public static void registerNewInstancesForNestedTypes(Class<?> parentClass)
parentClass - the parentClass to scan for nested public static typespublic static void registerMockInstances(Class<?>... types)
types - collection of types to mock and registerregisterMockInstances(java.util.Collection)public static void registerMockInstances(Collection<Class<?>> types)
types - collection of types to mock and registerpublic static <T> T registerMockInstance(String name, Class<T> type)
name - the juel name under which the mock is registeredtype - the type of the mock to createpublic static <T> T registerMockInstance(Class<T> type)
type - the type of the mock to createpublic static <T> T registerNewInstance(String name, Class<T> type)
name - the name for the registered instancetype - the type of the instance to createpublic static <T> T registerNewInstance(Class<T> type)
type - the type of the instance to createregisterNewInstance(String, Class)public static <T> T registerInstance(T instance)
NameForType.instance - the instance or mock to registerpublic static <T> T registerInstance(String name, T instance)
Mocks.register(String, Object)name - the juel name for the registered instanceinstance - the instance to registerpublic static <T> T getRegistered(String name)
name - juel name of the registered instance or mockpublic static <T> T getRegistered(Class<?> type)
type - the type of the registered instance or mockpublic static void reset()
Mocks.reset()Copyright © 2020 Camunda Services GmbH. All rights reserved.