use of com.khmelenko.lab.varis.network.response.RequestData in project Varis-Android by dkhmelenko.
the class TestRepoDetailsPresenter method testLoadData.
@Test
public void testLoadData() {
final String slug = "test";
final List<Build> builds = new ArrayList<>();
final List<Commit> commits = new ArrayList<>();
final List<RequestData> requestData = new ArrayList<>();
final Requests requests = new Requests();
requests.setCommits(commits);
requests.setRequests(requestData);
final BuildHistory buildHistory = new BuildHistory();
buildHistory.setBuilds(builds);
buildHistory.setCommits(commits);
final List<Branch> branch = new ArrayList<>();
final Branches branches = new Branches();
branches.setBranches(branch);
branches.setCommits(commits);
when(mTravisRestClient.getApiService().getBuilds(slug)).thenReturn(buildHistory);
when(mTravisRestClient.getApiService().getBranches(slug)).thenReturn(branches);
when(mTravisRestClient.getApiService().getRequests(slug)).thenReturn(requests);
when(mTravisRestClient.getApiService().getPullRequestBuilds(slug)).thenReturn(buildHistory);
mRepoDetailsPresenter.setRepoSlug(slug);
mRepoDetailsPresenter.loadData();
verify(mRepoDetailsPresenter).loadBuildsHistory();
verify(mRepoDetailsPresenter).loadBranches();
verify(mRepoDetailsPresenter).loadRequests();
}
use of com.khmelenko.lab.varis.network.response.RequestData in project Varis-Android by dkhmelenko.
the class PullRequestsListAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(BuildViewHolder holder, int position) {
if (mRequests != null) {
RequestData request = mPullRequests.get(position);
bindPullRequest(holder, request);
}
}
use of com.khmelenko.lab.varis.network.response.RequestData in project Varis-Android by dkhmelenko.
the class TestRepoDetailsPresenter method testLoadRequests.
@Test
public void testLoadRequests() {
final String slug = "test";
final List<Build> builds = new ArrayList<>();
final List<Commit> commits = new ArrayList<>();
final List<RequestData> requestData = new ArrayList<>();
final Requests requests = new Requests();
requests.setCommits(commits);
requests.setRequests(requestData);
final BuildHistory buildHistory = new BuildHistory();
buildHistory.setBuilds(builds);
buildHistory.setCommits(commits);
when(mTravisRestClient.getApiService().getRequests(slug)).thenReturn(requests);
when(mTravisRestClient.getApiService().getPullRequestBuilds(slug)).thenReturn(buildHistory);
mRepoDetailsPresenter.setRepoSlug(slug);
mRepoDetailsPresenter.loadRequests();
verify(mTaskManager).getRequests(slug);
verify(mRepoDetailsView).updatePullRequests(requests);
}
use of com.khmelenko.lab.varis.network.response.RequestData in project Varis-Android by dkhmelenko.
the class PullRequestsFragment method onItemSelected.
@Override
public void onItemSelected(int position) {
if (mListener != null) {
RequestData requestData = mPullRequests.get(position);
mListener.onPullRequestSelected(requestData.getBuildId());
}
}
Aggregations