@Test @SuppressWarnings( "unchecked" ) public void testBuildUseCaseObservableReturnCorrectResult() { TestSubscriber<Integer> testSubscriber = new TestSubscriber<>(); TestScheduler testScheduler = new TestScheduler(); given( mockPostExecutionThread.getScheduler() ).willReturn( testScheduler ); useCase.execute( testSubscriber ); assertThat( testSubscriber.getOnNextEvents().size(), is( 0 ) ); }
@SuppressWarnings("unchecked") public void execute( Subscriber UseCaseSubscriber ) { this.subscription = this.buildUseCaseObservable() .subscribeOn( Schedulers.from( threadExecutor ) ) .observeOn( postExecutionThread.getScheduler() ) .subscribe( UseCaseSubscriber ); }
UseCase { @SuppressWarnings("unchecked") public void execute( Subscriber UseCaseSubscriber ) { this.subscription = this.buildUseCaseObservable() .subscribeOn( Schedulers.from( threadExecutor ) ) .observeOn( postExecutionThread.getScheduler() ) .subscribe( UseCaseSubscriber ); } }
UseCase { @SuppressWarnings("unchecked") public void execute( Subscriber UseCaseSubscriber ) { this.subscription = this.buildUseCaseObservable() .subscribeOn( Schedulers.from( threadExecutor ) ) .observeOn( postExecutionThread.getScheduler() ) .subscribe( UseCaseSubscriber ); } protected  UseCase( ThreadExecutor threadExecutor, PostExecutionThread postExecutionThread ); }
UseCase { @SuppressWarnings("unchecked") public void execute( Subscriber UseCaseSubscriber ) { this.subscription = this.buildUseCaseObservable() .subscribeOn( Schedulers.from( threadExecutor ) ) .observeOn( postExecutionThread.getScheduler() ) .subscribe( UseCaseSubscriber ); } protected  UseCase( ThreadExecutor threadExecutor, PostExecutionThread postExecutionThread ); @SuppressWarnings("unchecked") void execute( Subscriber UseCaseSubscriber ); void unsubscribe(); }
UseCase { @SuppressWarnings("unchecked") public void execute( Subscriber UseCaseSubscriber ) { this.subscription = this.buildUseCaseObservable() .subscribeOn( Schedulers.from( threadExecutor ) ) .observeOn( postExecutionThread.getScheduler() ) .subscribe( UseCaseSubscriber ); } protected  UseCase( ThreadExecutor threadExecutor, PostExecutionThread postExecutionThread ); @SuppressWarnings("unchecked") void execute( Subscriber UseCaseSubscriber ); void unsubscribe();  }