类 AopTestUtils
java.lang.Object
cn.taketoday.test.util.AopTestUtils
AopTestUtils is a collection of AOP-related utility methods for
use in unit and integration testing scenarios.
For Framework's core AOP utilities, see
AopUtils and
AopProxyUtils.
- 从以下版本开始:
- 4.0
- 作者:
- Sam Brannen, Juergen Hoeller, Harry Yang
- 另请参阅:
-
AopUtilsAopProxyUtilsReflectionTestUtils
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static <T> TgetTargetObject(Object candidate) Get the target object of the suppliedcandidateobject.static <T> TgetUltimateTargetObject(Object candidate) Get the ultimate target object of the suppliedcandidateobject, unwrapping not only a top-level proxy but also any number of nested proxies.
-
字段详细资料
-
isAopPresent
static final boolean isAopPresent
-
-
构造器详细资料
-
AopTestUtils
public AopTestUtils()
-
-
方法详细资料
-
getTargetObject
Get the target object of the suppliedcandidateobject.If the supplied
candidateis a Infra proxy, the target of the proxy will be returned; otherwise, thecandidatewill be returned as is.- 类型参数:
T- the type of the target object- 参数:
candidate- the instance to check (potentially a Infra AOP proxy; nevernull)- 返回:
- the target object or the
candidate(nevernull) - 抛出:
IllegalStateException- if an error occurs while unwrapping a proxy- 另请参阅:
-
Advised.getTargetSource()getUltimateTargetObject(java.lang.Object)
-
getUltimateTargetObject
Get the ultimate target object of the suppliedcandidateobject, unwrapping not only a top-level proxy but also any number of nested proxies.If the supplied
candidateis a Infra proxy, the ultimate target of all nested proxies will be returned; otherwise, thecandidatewill be returned as is.NOTE: If the top-level proxy or a nested proxy is not backed by a static
TargetSource, invocation of this utility method may result in undesired behavior such as infinite recursion leading to aStackOverflowError.- 类型参数:
T- the type of the target object- 参数:
candidate- the instance to check (potentially a Infra AOP proxy; nevernull)- 返回:
- the target object or the
candidate(nevernull) - 抛出:
IllegalStateException- if an error occurs while unwrapping a proxy- 另请参阅:
-
Advised.getTargetSource()TargetSource.isStatic()AopProxyUtils.ultimateTargetClass(java.lang.Object)
-