SignIn { public Observable<U> execute(@NonNull String userName, @NonNull String password) { return mRepository.query(new SessionQuery.SignIn<>(userName, password)); } SignIn(@NonNull Repository<U> repository); Observable<U> execute(@NonNull String userName, @NonNull String password);  }
@Test public void whenMessagesForChatRequested_thenRepoIsQueriedForCorrectChatId() throws Exception { final String userName = "userName"; final String password = "password"; final BaseUser expectedResult = new BaseUser("id", "displayName"); when(mMockRepository.query(eq(new SessionQuery.SignIn<>(userName, password)))) .thenReturn(Observable.just(expectedResult)); mTarget.execute(userName, password); verify(mMockRepository, times(1)).query(eq(new SessionQuery.SignIn<>(userName, password))); }