public final class ConfigContext extends Object
TestBean annotations inside a class that is
declared in the test class using TestConfigProvider| Modifier and Type | Field and Description |
|---|---|
static InheritableThreadLocal<Map<String,Object>> |
beansByName
The threadlocal variable that is responsible for containing the bean name to object instance mapping
|
static InheritableThreadLocal<Map<Class,Object>> |
beansByType
The threadlocal variable that is responsible for containing the bean type to object instance mapping
|
| Modifier and Type | Method and Description |
|---|---|
static void |
cleanConfigContext() |
static Object |
getBeanByName(String beanName)
Get the test bean by name.
|
static Object |
getBeanByType(Class beanType)
Get the test bean by type
|
static void |
setTestBeanByName(String beanName,
Object beanInstance)
Set the test bean in the thread local variable by name
|
static void |
setTestBeanByType(Class beanType,
Object beanInstance)
Set the test bean in the threadlocal variable by type
|
public static final InheritableThreadLocal<Map<String,Object>> beansByName
public static final InheritableThreadLocal<Map<Class,Object>> beansByType
public static void setTestBeanByName(String beanName, Object beanInstance)
beanName - the name of the beanbeanInstance - the instance to setpublic static void setTestBeanByType(Class beanType, Object beanInstance)
beanType - the type of the beanbeanInstance - the instance to setpublic static Object getBeanByName(String beanName)
beanName - the name of the bean to get value forpublic static Object getBeanByType(Class beanType)
beanType - the type of bean to getpublic static void cleanConfigContext()
Copyright © 2014. All rights reserved.