Search in sources :

Example 11 with ServerInstanceSelected

use of org.kie.workbench.common.screens.server.management.client.events.ServerInstanceSelected in project kie-wb-common by kiegroup.

the class RemotePresenterTest method testRemoveError.

@Test
public void testRemoveError() {
    final ServerInstanceKey serverInstanceKey = new ServerInstanceKey("templateId", "serverName", "serverInstanceId", "url");
    presenter.onSelect(new ServerInstanceSelected(serverInstanceKey));
    doThrow(new RuntimeException()).when(specManagementService).deleteServerInstance(serverInstanceKey);
    presenter.remove();
    final ArgumentCaptor<NotificationEvent> notificationCaptor = ArgumentCaptor.forClass(NotificationEvent.class);
    verify(notification).fire(notificationCaptor.capture());
    assertEquals(NotificationEvent.NotificationType.ERROR, notificationCaptor.getValue().getType());
}
Also used : NotificationEvent(org.uberfire.workbench.events.NotificationEvent) ServerInstanceKey(org.kie.server.controller.api.model.runtime.ServerInstanceKey) ServerInstanceSelected(org.kie.workbench.common.screens.server.management.client.events.ServerInstanceSelected) Test(org.junit.Test)

Aggregations

ServerInstanceSelected (org.kie.workbench.common.screens.server.management.client.events.ServerInstanceSelected)11 Test (org.junit.Test)9 ServerInstanceKey (org.kie.server.controller.api.model.runtime.ServerInstanceKey)7 Command (org.uberfire.mvp.Command)3 ServerInstanceUpdated (org.kie.server.controller.api.model.events.ServerInstanceUpdated)2 Container (org.kie.server.controller.api.model.runtime.Container)2 ServerInstance (org.kie.server.controller.api.model.runtime.ServerInstance)2 NotificationEvent (org.uberfire.workbench.events.NotificationEvent)2 Message (org.kie.server.api.model.Message)1 ReleaseId (org.kie.server.api.model.ReleaseId)1 RemotePresenter (org.kie.workbench.common.screens.server.management.client.remote.RemotePresenter)1 CardPresenter (org.kie.workbench.common.screens.server.management.client.widget.card.CardPresenter)1 BodyPresenter (org.kie.workbench.common.screens.server.management.client.widget.card.body.BodyPresenter)1 FooterPresenter (org.kie.workbench.common.screens.server.management.client.widget.card.footer.FooterPresenter)1 LinkTitlePresenter (org.kie.workbench.common.screens.server.management.client.widget.card.title.LinkTitlePresenter)1 ParameterizedCommand (org.uberfire.mvp.ParameterizedCommand)1