private AspectJExpressionPointcut pointcut(String expression) { AspectJExpressionPointcut pointcut = new AspectJExpressionPointcut(); pointcut.setExpression(expression); return pointcut; }
@Test void args() { assertThat(pointcut("args(String)") .matches(helloMethod, MemberServiceImpl.class)).isTrue(); assertThat(pointcut("args(Object)") .matches(helloMethod, MemberServiceImpl.class)).isTrue(); assertThat(pointcut("args()") .matches(helloMethod, MemberServiceImpl.class)).isFalse(); assertThat(pointcut("args(..)") .matches(helloMethod, MemberServiceImpl.class)).isTrue(); assertThat(pointcut("args(*)") .matches(helloMethod, MemberServiceImpl.class)).isTrue(); assertThat(pointcut("args(String,..)") .matches(helloMethod, MemberServiceImpl.class)).isTrue(); }
|