use of org.uberfire.workbench.events.NotificationEvent in project kie-wb-common by kiegroup.
the class RuntimePresenterActionsTest method testStartRuntimeFailed.
@Test
public void testStartRuntimeFailed() {
prepareRuntime();
RuntimeKey currentKey = runtime.getKey();
doThrow(new RuntimeException(ERROR_MESSAGE)).when(runtimeService).startRuntime(currentKey);
when(translationService.getTranslation(RuntimePresenter_RuntimeStartingMessage)).thenReturn(BUSY_POPUP_MESSAGE);
presenter.startRuntime();
verify(popupHelper, times(1)).showBusyIndicator(BUSY_POPUP_MESSAGE);
verify(popupHelper, times(1)).hideBusyIndicator();
verify(notificationEvent, times(0)).fire(any(NotificationEvent.class));
verify(defaultErrorCallback, times(1)).error(Mockito.<Message>any(), exceptionCaptor.capture());
assertEquals(ERROR_MESSAGE, exceptionCaptor.getValue().getMessage());
}
use of org.uberfire.workbench.events.NotificationEvent in project kie-wb-common by kiegroup.
the class RuntimePresenterActionsTest method testDeleteRuntimeConfirmYesAndSuccessful.
@Test
public void testDeleteRuntimeConfirmYesAndSuccessful() {
prepareRuntimeDelete();
RuntimeKey currentKey = runtime.getKey();
when(translationService.format(RuntimePresenter_RuntimeDeleteSuccessMessage, item.getRuntime().getKey().getId())).thenReturn(SUCCESS_MESSAGE);
when(translationService.getTranslation(RuntimePresenter_RuntimeDeletingMessage)).thenReturn(BUSY_POPUP_MESSAGE);
yesCommandCaptor.getValue().execute();
verify(runtimeService, times(1)).deleteRuntime(currentKey, false);
verify(popupHelper, times(1)).showBusyIndicator(BUSY_POPUP_MESSAGE);
verify(popupHelper, times(1)).hideBusyIndicator();
verify(notificationEvent, times(1)).fire(new NotificationEvent(SUCCESS_MESSAGE, NotificationEvent.NotificationType.SUCCESS));
}
use of org.uberfire.workbench.events.NotificationEvent in project kie-wb-common by kiegroup.
the class RuntimePresenterActionsTest method testStopPipelineConfirmYesAndSuccessful.
@Test
public void testStopPipelineConfirmYesAndSuccessful() {
preparePipelineStop();
PipelineExecutionTraceKey currentKey = trace.getKey();
when(translationService.format(RuntimePresenter_PipelineExecutionStopSuccessMessage, currentKey.getId())).thenReturn(SUCCESS_MESSAGE);
yesCommandCaptor.getValue().execute();
verify(runtimeService, times(1)).stopPipelineExecution(currentKey);
verify(notificationEvent, times(1)).fire(new NotificationEvent(SUCCESS_MESSAGE, NotificationEvent.NotificationType.SUCCESS));
}
use of org.uberfire.workbench.events.NotificationEvent in project kie-wb-common by kiegroup.
the class NewProviderWizardTest method testCreateProviderSuccess.
@Test
public void testCreateProviderSuccess() {
// initialize and start the wizard.
wizard.start(providerType);
// emulate the user completing the wizard.
preCompleteWizard();
// emulate the user pressing the finish button.
wizard.complete();
// verify that the provider has been created and the proper notifications were fired.
verify(providerService, times(1)).createProvider(providerType, providerConfiguration);
verify(notification, times(1)).fire(new NotificationEvent(SUCCESS_MESSAGE, NotificationEvent.NotificationType.SUCCESS));
verify(providerTypeSelectedEvent, times(1)).fire(new ProviderTypeSelectedEvent(providerType.getKey(), providerConfiguration.getId()));
}
use of org.uberfire.workbench.events.NotificationEvent in project kie-wb-common by kiegroup.
the class DataModelerScreenPresenter method getCopySuccessCallback.
private RemoteCallback<Path> getCopySuccessCallback(final CopyPopUpPresenter.View copyPopupView) {
return new RemoteCallback<Path>() {
@Override
public void callback(final Path response) {
copyPopupView.hide();
view.hideBusyIndicator();
notification.fire(new NotificationEvent(org.kie.workbench.common.widgets.client.resources.i18n.CommonConstants.INSTANCE.ItemCopiedSuccessfully(), NotificationEvent.NotificationType.SUCCESS));
}
};
}
Aggregations