@Test public void update() throws Exception { final LastNightInteractor lastNightInteractorSpy = spy(lastNightInteractor); final Timeline result = Sync.wrapAfter(lastNightInteractorSpy::update, lastNightInteractorSpy.timeline) .last(); verify(lastNightInteractorSpy).getValidTimeline(any(Timeline.class)); }
@VisibleForTesting @Nullable Timeline getValidTimeline(@Nullable final Timeline timeline) { if(TimelineInteractor.hasValidTimeline(timeline) && TimelineInteractor.hasValidCondition(timeline)) { return timeline; } else { return null; } }
LastNightInteractor extends ValueInteractor<Timeline> { @VisibleForTesting @Nullable Timeline getValidTimeline(@Nullable final Timeline timeline) { if(TimelineInteractor.hasValidTimeline(timeline) && TimelineInteractor.hasValidCondition(timeline)) { return timeline; } else { return null; } } }
LastNightInteractor extends ValueInteractor<Timeline> { @VisibleForTesting @Nullable Timeline getValidTimeline(@Nullable final Timeline timeline) { if(TimelineInteractor.hasValidTimeline(timeline) && TimelineInteractor.hasValidCondition(timeline)) { return timeline; } else { return null; } }  }
LastNightInteractor extends ValueInteractor<Timeline> { @VisibleForTesting @Nullable Timeline getValidTimeline(@Nullable final Timeline timeline) { if(TimelineInteractor.hasValidTimeline(timeline) && TimelineInteractor.hasValidCondition(timeline)) { return timeline; } else { return null; } }   }
LastNightInteractor extends ValueInteractor<Timeline> { @VisibleForTesting @Nullable Timeline getValidTimeline(@Nullable final Timeline timeline) { if(TimelineInteractor.hasValidTimeline(timeline) && TimelineInteractor.hasValidCondition(timeline)) { return timeline; } else { return null; } }   final InteractorSubject<Timeline> timeline; }