Search in sources :

Example 1 with RefactoringStatusEntry

use of org.eclipse.che.ide.ext.java.shared.dto.refactoring.RefactoringStatusEntry in project che by eclipse.

the class RenamePresenterTest method warningDialogShouldBeDisplayedWhenRefactoringPerformsWithWarning.

@Test
public void warningDialogShouldBeDisplayedWhenRefactoringPerformsWithWarning() throws OperationException {
    renamePresenter.show(session);
    ConfirmDialog dialog = mock(ConfirmDialog.class);
    RefactoringStatusEntry statusEntry = mock(RefactoringStatusEntry.class);
    List<RefactoringStatusEntry> entries = Collections.singletonList(statusEntry);
    when(refactoringStatus.getEntries()).thenReturn(entries);
    when(refactoringStatus.getSeverity()).thenReturn(2);
    when(dialogFactory.createConfirmDialog(anyString(), anyString(), anyString(), anyString(), Matchers.<ConfirmCallback>anyObject(), Matchers.<CancelCallback>anyObject())).thenReturn(dialog);
    renamePresenter.onAcceptButtonClicked();
    verify(changeCreationResultPromise).then(changeCreationResultCaptor.capture());
    changeCreationResultCaptor.getValue().apply(changeCreationResult);
    verify(dialogFactory).createConfirmDialog(anyString(), anyString(), anyString(), anyString(), Matchers.<ConfirmCallback>anyObject(), Matchers.<CancelCallback>anyObject());
    verify(dialog).show();
}
Also used : RefactoringStatusEntry(org.eclipse.che.ide.ext.java.shared.dto.refactoring.RefactoringStatusEntry) ConfirmDialog(org.eclipse.che.ide.api.dialogs.ConfirmDialog) Test(org.junit.Test)

Aggregations

ConfirmDialog (org.eclipse.che.ide.api.dialogs.ConfirmDialog)1 RefactoringStatusEntry (org.eclipse.che.ide.ext.java.shared.dto.refactoring.RefactoringStatusEntry)1 Test (org.junit.Test)1