Skip to content

Schedulers.immediate() in tests limits capabilities #6

@artemik

Description

@artemik

For tests, Schedulers.immediate() is used instead of Schedulers.io() and Schedulers.mainThread(). It makes impossible to test that repoListPresenter.onSearchButtonClick() doesn't call view.hideLoading() until it loads result from the model.

The current RepoListPresenterTest.testShowLoading() show look like this:

@Test
public void testShowLoading() {
	repoListPresenter.onSearchButtonClick();

	verify(mockView).showLoading();
	verify(mockView, never()).hideLoading();
}

But it's impossible now. Invocation of repoListPresenter.onSearchButtonClick() is blocking and will trigger view.hideLoading() upon completion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions