use of sonia.scm.repository.api.LogCommandBuilder in project scm-review-plugin by scm-manager.
the class BranchRevisionResolverTest method mockSingleChangeset.
private void mockSingleChangeset(String branch) throws IOException {
when(repositoryService.getLogCommand()).thenReturn(logCommandBuilder);
LogCommandBuilder subLogCommandBuilder = mock(LogCommandBuilder.class);
lenient().when(logCommandBuilder.setBranch(branch)).thenReturn(subLogCommandBuilder);
lenient().when(subLogCommandBuilder.setPagingStart(0)).thenReturn(subLogCommandBuilder);
lenient().when(subLogCommandBuilder.setPagingLimit(1)).thenReturn(subLogCommandBuilder);
Changeset changeset = new Changeset();
changeset.setId(branch + "Id");
lenient().when(subLogCommandBuilder.getChangesets()).thenReturn(new ChangesetPagingResult(1, singletonList(changeset)));
}
use of sonia.scm.repository.api.LogCommandBuilder in project scm-review-plugin by scm-manager.
the class DefaultPullRequestServiceTest method mockChangesets.
private void mockChangesets(Changeset... changesets) throws IOException {
RepositoryService service = mock(RepositoryService.class);
lenient().when(repositoryService.create(any(Repository.class))).thenReturn(service);
LogCommandBuilder logCommandBuilder = mock(LogCommandBuilder.class, Mockito.RETURNS_SELF);
lenient().when(service.getLogCommand()).thenReturn(logCommandBuilder);
lenient().when(logCommandBuilder.getChangesets()).thenReturn(new ChangesetPagingResult(changesets.length, asList(changesets)));
}
use of sonia.scm.repository.api.LogCommandBuilder in project scm-review-plugin by scm-manager.
the class PullRequestRootResourceTest method mockChangesets.
private void mockChangesets(String sourceBranch, String targetBranch, Changeset... changesets) throws IOException {
when(repositoryService.getLogCommand()).thenReturn(logCommandBuilder);
LogCommandBuilder subLogCommandBuilder = mock(LogCommandBuilder.class);
when(logCommandBuilder.setStartChangeset(sourceBranch)).thenReturn(subLogCommandBuilder);
when(subLogCommandBuilder.setAncestorChangeset(targetBranch)).thenReturn(subLogCommandBuilder);
when(subLogCommandBuilder.setPagingStart(0)).thenReturn(subLogCommandBuilder);
when(subLogCommandBuilder.setPagingLimit(1)).thenReturn(subLogCommandBuilder);
when(subLogCommandBuilder.getChangesets()).thenReturn(new ChangesetPagingResult(changesets.length, asList(changesets)));
}
Aggregations