LoggableObservableFactory { LoggableObservable create(Annotation annotation) { final Class observableType = joinPoint.getGenericReturnTypes().get(0); if (annotation != null) { switch (((RxLogObservable) annotation).value()) { case NOTHING: return new LogNothingObservable(joinPoint, messageManager, observableInfo); case STREAM: return new LogStreamObservable(joinPoint, messageManager, observableInfo); case SCHEDULERS: return new LogSchedulersObservable(joinPoint, messageManager, observableInfo); case EVENTS: return new LogEventsObservable(joinPoint, messageManager, observableInfo); case EVERYTHING: default: return new LogEverythingObservable(joinPoint, messageManager, observableInfo); } } else { return new LogNothingObservable(joinPoint, messageManager, observableInfo); } } LoggableObservableFactory(FrodoProceedingJoinPoint joinPoint,
      MessageManager messageManager, ObservableInfo observableInfo);   }
@Test public void shouldCreateLogEverythingObservable() { final RxLogObservable annotation = mock(RxLogObservable.class); given(annotation.value()).willReturn(RxLogObservable.Scope.EVERYTHING); final LoggableObservable loggableObservable = observableFactory.create(annotation); assertThat(loggableObservable).isInstanceOf(LogEverythingObservable.class); }
@Test public void shouldCreateLogStreamObservable() { final RxLogObservable annotation = mock(RxLogObservable.class); given(annotation.value()).willReturn(RxLogObservable.Scope.STREAM); final LoggableObservable loggableObservable = observableFactory.create(annotation); assertThat(loggableObservable).isInstanceOf(LogStreamObservable.class); }
@Test public void shouldCreateLogEventsObservable() { final RxLogObservable annotation = mock(RxLogObservable.class); given(annotation.value()).willReturn(RxLogObservable.Scope.EVENTS); final LoggableObservable loggableObservable = observableFactory.create(annotation); assertThat(loggableObservable).isInstanceOf(LogEventsObservable.class); }
@Test public void shouldCreateLogSchedulersObservable() { final RxLogObservable annotation = mock(RxLogObservable.class); given(annotation.value()).willReturn(RxLogObservable.Scope.SCHEDULERS); final LoggableObservable loggableObservable = observableFactory.create(annotation); assertThat(loggableObservable).isInstanceOf(LogSchedulersObservable.class); }
@Test public void shouldCreateLogNothingObservable() { final RxLogObservable annotation = mock(RxLogObservable.class); given(annotation.value()).willReturn(RxLogObservable.Scope.NOTHING); final LoggableObservable loggableObservable = observableFactory.create(annotation); assertThat(loggableObservable).isInstanceOf(LogNothingObservable.class); }