类 AopTestUtils

    • 方法详细资料

      • getUltimateTargetObject

        public static <T> T getUltimateTargetObject​(Object candidate)
        Get the ultimate target object of the supplied candidate object, unwrapping not only a top-level proxy but also any number of nested proxies.

        If the supplied candidate is a Spring proxy, the ultimate target of all nested proxies will be returned; otherwise, the candidate will be returned as is.

        参数:
        candidate - the instance to check (potentially a Spring AOP proxy; never null)
        返回:
        the target object or the candidate (never null)
        抛出:
        IllegalStateException - if an error occurs while unwrapping a proxy
        另请参阅:
        Advised.getTargetSource(), AopProxyUtils.ultimateTargetClass(java.lang.Object)