@Test public void shouldWeaveClassOfTypeSubscriber() { final TestJoinPoint joinPoint = new TestJoinPoint.Builder(subscriber.getClass()).build(); final TestProceedingJoinPoint proceedingJoinPoint = new TestProceedingJoinPoint(joinPoint); assertThat(LogSubscriber.classAnnotatedWithRxLogSubscriber(proceedingJoinPoint)).isTrue(); }
@Pointcut(CLASS) public static boolean classAnnotatedWithRxLogSubscriber(JoinPoint joinPoint) { return joinPoint.getTarget() instanceof Subscriber; }
LogSubscriber { @Pointcut(CLASS) public static boolean classAnnotatedWithRxLogSubscriber(JoinPoint joinPoint) { return joinPoint.getTarget() instanceof Subscriber; } }
LogSubscriber { @Pointcut(CLASS) public static boolean classAnnotatedWithRxLogSubscriber(JoinPoint joinPoint) { return joinPoint.getTarget() instanceof Subscriber; } LogSubscriber();  LogSubscriber(Counter counter, StopWatch stopWatch, MessageManager messageManager); }
LogSubscriber { @Pointcut(CLASS) public static boolean classAnnotatedWithRxLogSubscriber(JoinPoint joinPoint) { return joinPoint.getTarget() instanceof Subscriber; } LogSubscriber();  LogSubscriber(Counter counter, StopWatch stopWatch, MessageManager messageManager); @Pointcut(CLASS) static boolean classAnnotatedWithRxLogSubscriber(JoinPoint joinPoint); @Pointcut(METHOD_ON_START) void onStartMethodExecution(); @Pointcut(METHOD_ON_NEXT) void onNextMethodExecution(); @Pointcut(METHOD_ON_ERROR) void onErrorMethodExecution(Throwable throwable); @Pointcut(METHOD_ON_COMPLETED) void onCompletedMethodExecution(); @Pointcut(METHOD_REQUEST) void onRequestMethodCall(long numberOfItems); @Pointcut(METHOD_UN_SUBSCRIBE) void onUnsubscribeMethodCall(); @Before("classAnnotatedWithRxLogSubscriber(joinPoint) && onStartMethodExecution()") void beforeOnStartExecution(JoinPoint joinPoint); @Before("classAnnotatedWithRxLogSubscriber(joinPoint) && onNextMethodExecution()") void beforeOnNextExecution(JoinPoint joinPoint); @After(value = "classAnnotatedWithRxLogSubscriber(joinPoint) && onErrorMethodExecution(throwable)", argNames = "joinPoint,throwable") void afterOnErrorExecution(JoinPoint joinPoint, Throwable throwable); @Before("classAnnotatedWithRxLogSubscriber(joinPoint) && onCompletedMethodExecution()") void beforeOnCompletedExecution(JoinPoint joinPoint); @After("classAnnotatedWithRxLogSubscriber(joinPoint) && onUnsubscribeMethodCall()") void afterUnsubscribeMethodCall(JoinPoint joinPoint); @After("classAnnotatedWithRxLogSubscriber(joinPoint) && onRequestMethodCall(numberOfItems)") void afterRequestMethodCall(JoinPoint joinPoint, long numberOfItems); }
LogSubscriber { @Pointcut(CLASS) public static boolean classAnnotatedWithRxLogSubscriber(JoinPoint joinPoint) { return joinPoint.getTarget() instanceof Subscriber; } LogSubscriber();  LogSubscriber(Counter counter, StopWatch stopWatch, MessageManager messageManager); @Pointcut(CLASS) static boolean classAnnotatedWithRxLogSubscriber(JoinPoint joinPoint); @Pointcut(METHOD_ON_START) void onStartMethodExecution(); @Pointcut(METHOD_ON_NEXT) void onNextMethodExecution(); @Pointcut(METHOD_ON_ERROR) void onErrorMethodExecution(Throwable throwable); @Pointcut(METHOD_ON_COMPLETED) void onCompletedMethodExecution(); @Pointcut(METHOD_REQUEST) void onRequestMethodCall(long numberOfItems); @Pointcut(METHOD_UN_SUBSCRIBE) void onUnsubscribeMethodCall(); @Before("classAnnotatedWithRxLogSubscriber(joinPoint) && onStartMethodExecution()") void beforeOnStartExecution(JoinPoint joinPoint); @Before("classAnnotatedWithRxLogSubscriber(joinPoint) && onNextMethodExecution()") void beforeOnNextExecution(JoinPoint joinPoint); @After(value = "classAnnotatedWithRxLogSubscriber(joinPoint) && onErrorMethodExecution(throwable)", argNames = "joinPoint,throwable") void afterOnErrorExecution(JoinPoint joinPoint, Throwable throwable); @Before("classAnnotatedWithRxLogSubscriber(joinPoint) && onCompletedMethodExecution()") void beforeOnCompletedExecution(JoinPoint joinPoint); @After("classAnnotatedWithRxLogSubscriber(joinPoint) && onUnsubscribeMethodCall()") void afterUnsubscribeMethodCall(JoinPoint joinPoint); @After("classAnnotatedWithRxLogSubscriber(joinPoint) && onRequestMethodCall(numberOfItems)") void afterRequestMethodCall(JoinPoint joinPoint, long numberOfItems);  }