@Test public void printOnNextMessageBeforeSubscriberOnNextExecutionWithEmptyValues() { final TestJoinPoint joinPointTest = new TestJoinPoint.Builder(subscriber.getClass()).withParamTypes(String.class) .withParamNames("param") .withParamValues() .build(); logSubscriber.beforeOnNextExecution(joinPointTest); verify(counter).increment(); verify(stopWatch).start(); verify(messageManager).printSubscriberOnNext(eq(subscriber.getClass().getSimpleName()), anyObject(), anyString()); }
@Before("classAnnotatedWithRxLogSubscriber(joinPoint) && onNextMethodExecution()") public void beforeOnNextExecution(JoinPoint joinPoint) { countAndMeasureTime(); final FrodoJoinPoint frodoJoinPoint = new FrodoJoinPoint(joinPoint); final Object value = frodoJoinPoint.getMethodParamValuesList().isEmpty() ? null : frodoJoinPoint.getMethodParamValuesList().get(0); messageManager.printSubscriberOnNext(joinPoint.getTarget().getClass().getSimpleName(), value, Thread.currentThread().getName()); }
LogSubscriber { @Before("classAnnotatedWithRxLogSubscriber(joinPoint) && onNextMethodExecution()") public void beforeOnNextExecution(JoinPoint joinPoint) { countAndMeasureTime(); final FrodoJoinPoint frodoJoinPoint = new FrodoJoinPoint(joinPoint); final Object value = frodoJoinPoint.getMethodParamValuesList().isEmpty() ? null : frodoJoinPoint.getMethodParamValuesList().get(0); messageManager.printSubscriberOnNext(joinPoint.getTarget().getClass().getSimpleName(), value, Thread.currentThread().getName()); } }
LogSubscriber { @Before("classAnnotatedWithRxLogSubscriber(joinPoint) && onNextMethodExecution()") public void beforeOnNextExecution(JoinPoint joinPoint) { countAndMeasureTime(); final FrodoJoinPoint frodoJoinPoint = new FrodoJoinPoint(joinPoint); final Object value = frodoJoinPoint.getMethodParamValuesList().isEmpty() ? null : frodoJoinPoint.getMethodParamValuesList().get(0); messageManager.printSubscriberOnNext(joinPoint.getTarget().getClass().getSimpleName(), value, Thread.currentThread().getName()); } LogSubscriber();  LogSubscriber(Counter counter, StopWatch stopWatch, MessageManager messageManager); }
LogSubscriber { @Before("classAnnotatedWithRxLogSubscriber(joinPoint) && onNextMethodExecution()") public void beforeOnNextExecution(JoinPoint joinPoint) { countAndMeasureTime(); final FrodoJoinPoint frodoJoinPoint = new FrodoJoinPoint(joinPoint); final Object value = frodoJoinPoint.getMethodParamValuesList().isEmpty() ? null : frodoJoinPoint.getMethodParamValuesList().get(0); messageManager.printSubscriberOnNext(joinPoint.getTarget().getClass().getSimpleName(), value, Thread.currentThread().getName()); } 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 { @Before("classAnnotatedWithRxLogSubscriber(joinPoint) && onNextMethodExecution()") public void beforeOnNextExecution(JoinPoint joinPoint) { countAndMeasureTime(); final FrodoJoinPoint frodoJoinPoint = new FrodoJoinPoint(joinPoint); final Object value = frodoJoinPoint.getMethodParamValuesList().isEmpty() ? null : frodoJoinPoint.getMethodParamValuesList().get(0); messageManager.printSubscriberOnNext(joinPoint.getTarget().getClass().getSimpleName(), value, Thread.currentThread().getName()); } 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);  }