Search in sources :

Example 6 with LogResponse

use of org.eclipse.che.api.git.shared.LogResponse in project che by eclipse.

the class HistoryPresenterTest method shouldGetCommitsAndShowDialog.

@Test
public void shouldGetCommitsAndShowDialog() throws Exception {
    LogResponse response = mock(LogResponse.class);
    List<Revision> revisions = singletonList(mock(Revision.class));
    when(response.getCommits()).thenReturn(revisions);
    presenter.show();
    verify(logPromise).then(logCaptor.capture());
    logCaptor.getValue().apply(response);
    verify(view).setRevisions(revisions);
    verify(view).showDialog();
}
Also used : LogResponse(org.eclipse.che.api.git.shared.LogResponse) Revision(org.eclipse.che.api.git.shared.Revision) BaseTest(org.eclipse.che.ide.ext.git.client.BaseTest) Test(org.junit.Test)

Aggregations

LogResponse (org.eclipse.che.api.git.shared.LogResponse)6 Revision (org.eclipse.che.api.git.shared.Revision)5 BaseTest (org.eclipse.che.ide.ext.git.client.BaseTest)4 Test (org.junit.Test)4 ArrayList (java.util.ArrayList)3 Operation (org.eclipse.che.api.promises.client.Operation)1 OperationException (org.eclipse.che.api.promises.client.OperationException)1 PromiseError (org.eclipse.che.api.promises.client.PromiseError)1 Project (org.eclipse.che.ide.api.resources.Project)1 Path (org.eclipse.che.ide.resource.Path)1