GetSelectedDemoUserListUseCase extends UseCase<UserDemoEntity> { @Override public Observable<UserDemoEntity> react() { return repository.getSelectedUserDemoList(); } @Inject  GetSelectedDemoUserListUseCase(UI ui, UserDemoRepository repository); @Override Observable<UserDemoEntity> react();  }
@Test public void When_Execute_Get_User() { when(userDemoRepositoryMock.getSelectedUserDemoList()).thenReturn(Observable.just(userDemoEntityMock)); TestSubscriber<UserDemoEntity> subscriberMock = new TestSubscriber<>(); getSelectedDemoUserListUseCaseUT.react().subscribe(subscriberMock); subscriberMock.awaitTerminalEvent(); assertThat(subscriberMock.getOnCompletedEvents().size(), is(1)); }