@Test public void printRequestedItemsAfterSubscriberRequestMethodCall() { logSubscriber.afterRequestMethodCall(joinPoint, 10); verify(messageManager).printSubscriberRequestedItems(subscriber.getClass().getSimpleName(), 10); }
@After("classAnnotatedWithRxLogSubscriber(joinPoint) && onRequestMethodCall(numberOfItems)") public void afterRequestMethodCall(JoinPoint joinPoint, long numberOfItems) { messageManager.printSubscriberRequestedItems(joinPoint.getTarget().getClass().getSimpleName(), numberOfItems); }
LogSubscriber { @After("classAnnotatedWithRxLogSubscriber(joinPoint) && onRequestMethodCall(numberOfItems)") public void afterRequestMethodCall(JoinPoint joinPoint, long numberOfItems) { messageManager.printSubscriberRequestedItems(joinPoint.getTarget().getClass().getSimpleName(), numberOfItems); } }
LogSubscriber { @After("classAnnotatedWithRxLogSubscriber(joinPoint) && onRequestMethodCall(numberOfItems)") public void afterRequestMethodCall(JoinPoint joinPoint, long numberOfItems) { messageManager.printSubscriberRequestedItems(joinPoint.getTarget().getClass().getSimpleName(), numberOfItems); } LogSubscriber();  LogSubscriber(Counter counter, StopWatch stopWatch, MessageManager messageManager); }
LogSubscriber { @After("classAnnotatedWithRxLogSubscriber(joinPoint) && onRequestMethodCall(numberOfItems)") public void afterRequestMethodCall(JoinPoint joinPoint, long numberOfItems) { messageManager.printSubscriberRequestedItems(joinPoint.getTarget().getClass().getSimpleName(), numberOfItems); } 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 { @After("classAnnotatedWithRxLogSubscriber(joinPoint) && onRequestMethodCall(numberOfItems)") public void afterRequestMethodCall(JoinPoint joinPoint, long numberOfItems) { messageManager.printSubscriberRequestedItems(joinPoint.getTarget().getClass().getSimpleName(), numberOfItems); } 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);  }