### Question:
Bouquet { @Around(value = "methodAnnotatedWithRxLogger(joinPoint)") public Object process(ProceedingJoinPoint joinPoint) throws Throwable { ComponentType componentType = ComponentType.fromClass(((MethodSignature) joinPoint.getSignature()).getReturnType()); if (componentType == null) { Bouquet.messageManager.printWrongMethodReturnType(); return joinPoint.proceed(); } Annotation annotation = ((MethodSignature) joinPoint.getSignature()).getMethod().getAnnotation(RxLogger.class); RxLogger.Scope scope = annotation != null ? ((RxLogger) annotation).value() : RxLogger.Scope.ALL; return Bouquet.weaverFactory.buildWeaverComponent(componentType, scope, joinPoint, Bouquet.messageManager).build(); }  static void setEnabled(boolean enabled); static boolean isEnabled(); static void setLogger(Logger logger); @Pointcut(value = "execution(@com.quanturium.bouquet.annotations.RxLogger * *(..)) && if()") static boolean methodAnnotatedWithRxLogger(ProceedingJoinPoint joinPoint); @Around(value = "methodAnnotatedWithRxLogger(joinPoint)") Object process(ProceedingJoinPoint joinPoint); @Pointcut(value = "execution(* io.reactivex.*.subscribeOn(..)) && if()") static boolean methodSubscribeOn(ProceedingJoinPoint joinPoint); @Around(value = "methodSubscribeOn(joinPoint)") Object processSubscribeOn(ProceedingJoinPoint joinPoint); @Pointcut(value = "execution(* io.reactivex.*.observeOn(..)) && if()") static boolean methodObserveOn(ProceedingJoinPoint joinPoint); @Around(value = "methodObserveOn(joinPoint)") Object processObserveOn(ProceedingJoinPoint joinPoint);  }### Answer:
@Test public void process() throws Throwable { ProceedingJoinPoint proceedingJoinPoint = mock(ProceedingJoinPoint.class); MethodSignature methodSignature = mock(MethodSignature.class); Method testMethod = getClass().getMethod("testMethod"); when(proceedingJoinPoint.getSignature()).thenReturn(methodSignature); when(methodSignature.getReturnType()).thenReturn(Observable.class); when(methodSignature.getMethod()).thenReturn(testMethod); when(proceedingJoinPoint.proceed()).thenReturn(Observable.empty()); Bouquet bouquet = new Bouquet(); Bouquet.setLogger((tag, message) -> { }); assertTrue(bouquet.process(proceedingJoinPoint) instanceof Observable); }
@Test public void process() throws Throwable { ProceedingJoinPoint proceedingJoinPoint = mock(ProceedingJoinPoint.class); MethodSignature methodSignature = mock(MethodSignature.class); Method testMethod = getClass().getMethod("testMethod"); when(proceedingJoinPoint.getSignature()).thenReturn(methodSignature); when(methodSignature.getReturnType()).thenReturn(Observable.class); when(methodSignature.getMethod()).thenReturn(testMethod); when(proceedingJoinPoint.proceed()).thenReturn(Observable.empty()); Bouquet bouquet = new Bouquet(); assertTrue(bouquet.process(proceedingJoinPoint) instanceof Observable); }