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();
}
Aggregations