@Test public void testRecyclerview_getObservableFBusersEmployee() { List<Employee> mockEmployees = Arrays .asList(new Employee("andrejd", "1"), new Employee("petere", "2"), new Employee("pavols", "3")); Observable<List<Employee>> mockObservable = Observable.just(mockEmployees); doReturn(mockObservable).when(mDataModel).getObservableFBusersEmployee(); TestSubscriber<List<Employee>> testSubscriber = new TestSubscriber<>(); mMainViewModel.getObservableFBusersEmployee().subscribe(testSubscriber); testSubscriber.assertNoErrors(); testSubscriber.assertUnsubscribed(); testSubscriber.assertTerminalEvent(); String threadname = testSubscriber.getLastSeenThread().getName(); System.out.println("threadname " + threadname); List<List<Employee>> listlistresult = testSubscriber.getOnNextEvents(); List<Employee> listresult = listlistresult.get(0); System.out.println("listresult0 " + listresult.get(0).getUsername()); System.out.println("listresult1 " + listresult.get(1).getUsername()); assertEquals(mockEmployees.get(0).getUsername(), listresult.get(0).getUsername()); assertThat(listresult, hasSize(3)); }
public Observable<List<Employee>> getObservableFBusersEmployee() { return mDataModel.getObservableFBusersEmployee(); }
EmployeeMvvmViewModel { public Observable<List<Employee>> getObservableFBusersEmployee() { return mDataModel.getObservableFBusersEmployee(); } }
EmployeeMvvmViewModel { public Observable<List<Employee>> getObservableFBusersEmployee() { return mDataModel.getObservableFBusersEmployee(); } EmployeeMvvmViewModel(@NonNull final EmployeeIDataModel dataModel,
                         @NonNull final ISchedulerProvider schedulerProvider); }
EmployeeMvvmViewModel { public Observable<List<Employee>> getObservableFBusersEmployee() { return mDataModel.getObservableFBusersEmployee(); } EmployeeMvvmViewModel(@NonNull final EmployeeIDataModel dataModel,
                         @NonNull final ISchedulerProvider schedulerProvider); void saveRxFBemployee(); @NonNull Observable<String> getObservableFob(); Observable<List<Employee>> getObservableEmployees(); Observable<DataSnapshot> getObservableFBabsences(); Observable<DataSnapshot> getObservableFBusers(); Observable<List<Employee>> getObservableFBusersEmployee(); void getBySpinnerEmloyee(String[] conditionsx); @NonNull Observable<List<Employee>> getObservableFBusersEmployeeSpinner(); void saveEditEmloyee(@NonNull final Employee employee, String namexx, String oscxx,
                                              String icoxx, String typxx, String uswxx); @NonNull Observable<String> getObservableKeyEditedEmployee(); @NonNull Observable<String> getObservableGreeting(); @NonNull Observable<List<Language>> getObservableSupportedLanguages(); void emitlanguageSelected(@NonNull final Language language); int getValue(@NonNull int xxx); }
EmployeeMvvmViewModel { public Observable<List<Employee>> getObservableFBusersEmployee() { return mDataModel.getObservableFBusersEmployee(); } EmployeeMvvmViewModel(@NonNull final EmployeeIDataModel dataModel,
                         @NonNull final ISchedulerProvider schedulerProvider); void saveRxFBemployee(); @NonNull Observable<String> getObservableFob(); Observable<List<Employee>> getObservableEmployees(); Observable<DataSnapshot> getObservableFBabsences(); Observable<DataSnapshot> getObservableFBusers(); Observable<List<Employee>> getObservableFBusersEmployee(); void getBySpinnerEmloyee(String[] conditionsx); @NonNull Observable<List<Employee>> getObservableFBusersEmployeeSpinner(); void saveEditEmloyee(@NonNull final Employee employee, String namexx, String oscxx,
                                              String icoxx, String typxx, String uswxx); @NonNull Observable<String> getObservableKeyEditedEmployee(); @NonNull Observable<String> getObservableGreeting(); @NonNull Observable<List<Language>> getObservableSupportedLanguages(); void emitlanguageSelected(@NonNull final Language language); int getValue(@NonNull int xxx);  }