Search in sources :

Example 16 with MethodMatcher

use of org.springframework.aop.MethodMatcher in project spring-framework by spring-projects.

the class MethodMatchersTests method testUnionEquals.

@Test
public void testUnionEquals() {
    MethodMatcher first = MethodMatchers.union(MethodMatcher.TRUE, MethodMatcher.TRUE);
    MethodMatcher second = new ComposablePointcut(MethodMatcher.TRUE).union(new ComposablePointcut(MethodMatcher.TRUE)).getMethodMatcher();
    assertThat(first.equals(second)).isTrue();
    assertThat(second.equals(first)).isTrue();
}
Also used : MethodMatcher(org.springframework.aop.MethodMatcher) Test(org.junit.jupiter.api.Test)

Aggregations

MethodMatcher (org.springframework.aop.MethodMatcher)16 Test (org.junit.jupiter.api.Test)12 ITestBean (org.springframework.beans.testfixture.beans.ITestBean)5 TestBean (org.springframework.beans.testfixture.beans.TestBean)5 ClassFilter (org.springframework.aop.ClassFilter)4 Pointcut (org.springframework.aop.Pointcut)4 ArrayList (java.util.ArrayList)2 ComposablePointcut (org.springframework.aop.support.ComposablePointcut)2 Method (java.lang.reflect.Method)1 LinkedHashSet (java.util.LinkedHashSet)1 List (java.util.List)1 MethodInterceptor (org.aopalliance.intercept.MethodInterceptor)1 Advisor (org.springframework.aop.Advisor)1 IntroductionAdvisor (org.springframework.aop.IntroductionAdvisor)1 IntroductionAwareMethodMatcher (org.springframework.aop.IntroductionAwareMethodMatcher)1 PointcutAdvisor (org.springframework.aop.PointcutAdvisor)1 AdvisorAdapterRegistry (org.springframework.aop.framework.adapter.AdvisorAdapterRegistry)1 GlobalAdvisorAdapterRegistry (org.springframework.aop.framework.adapter.GlobalAdvisorAdapterRegistry)1 DefaultPointcutAdvisor (org.springframework.aop.support.DefaultPointcutAdvisor)1 StaticMethodMatcher (org.springframework.aop.support.StaticMethodMatcher)1