-
I'm using Gradle 7.4 and applying the For example I have following aspect, classes and tests in package
@Aspect
public class MyAspect {
@AfterReturning("@within(com.example.ShouldBeWoven) && execution(* .new(..))")
public void myAdvice(JoinPoint joinPoint) {
System.out.println("******* MyAspect advised: " + joinPoint.getSignature().getDeclaringTypeName());
}
}
@Documented
@Target({TYPE})
@Retention(RUNTIME)
public @interface ShouldBeWoven {
}
class MyClass {
@ShouldBeWoven
static class WovenClassInMain {
}
}
class MyAspectTest {
@ShouldBeWoven
static class WovenClassInTest {
}
@Test
void instantiateWovenClassInMain() {
new WovenClassInMain();
}
@Test
void instantiateWovenClassInTest() {
new WovenClassInTest();
}
} The result was that |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I got a solution on Stack Overflow. |
Beta Was this translation helpful? Give feedback.
I got a solution on Stack Overflow.