use of org.guvnor.ala.ui.client.events.ProviderTypeListRefreshEvent in project kie-wb-common by kiegroup.
the class ProvisioningManagementBrowserPresenterTest method testOnRefreshProviderTypesWithEnabledProviderTypes.
@Test
public void testOnRefreshProviderTypesWithEnabledProviderTypes() {
when(providerTypeService.getEnabledProviderTypes()).thenReturn(providerTypes);
// pick an arbitrary element as the selected
ProviderType selectedProviderType = providerTypes.iterator().next();
presenter.onRefreshProviderTypes(new ProviderTypeListRefreshEvent(selectedProviderType.getKey()));
// the provider type navigation presenter must have been set properly.
verify(providerTypeNavigationPresenter, times(1)).setup(selectedProviderType, providerTypes);
verify(providerTypeSelectedEvent, times(1)).fire(new ProviderTypeSelectedEvent(selectedProviderType.getKey()));
}
use of org.guvnor.ala.ui.client.events.ProviderTypeListRefreshEvent in project kie-wb-common by kiegroup.
the class ProviderTypePresenterTest method onRemoveProviderTypeTest.
@Test
public void onRemoveProviderTypeTest() {
presenter.setup(providerType, providers, provider);
presenter.onRemoveProviderType();
// emulate user confirmation on screen
verify(view, times(1)).confirmRemove(any(Command.class));
presenter.removeProviderType();
verify(providerTypeService, times(1)).disableProviderType(providerType);
verify(providerTypeListRefreshEvent, times(1)).fire(new ProviderTypeListRefreshEvent());
}
use of org.guvnor.ala.ui.client.events.ProviderTypeListRefreshEvent in project kie-wb-common by kiegroup.
the class EnableProviderTypeWizardTest method testEnableProviderSuccess.
@Test
public void testEnableProviderSuccess() {
// initialize and start the wizard.
wizard.start(providerTypeStatus);
// emulate the user completing the wizard.
preCompleteWizard();
// emulates the user pressing the finish button
wizard.complete();
// verify the provider types has been enabled and the proper notifications were fired.
verify(providerTypeService, times(1)).enableProviderTypes(selectedProviders);
verify(notification, times(1)).fire(new NotificationEvent(SUCCESS_MESSAGE, NotificationEvent.NotificationType.SUCCESS));
verify(providerTypeListRefreshEvent, times(1)).fire(new ProviderTypeListRefreshEvent(selectedProviders.get(0).getKey()));
}
use of org.guvnor.ala.ui.client.events.ProviderTypeListRefreshEvent in project kie-wb-common by kiegroup.
the class ProvisioningManagementBrowserPresenterTest method testOnRefreshProviderTypesWithNOEnabledProviderTypes.
@Test
public void testOnRefreshProviderTypesWithNOEnabledProviderTypes() {
providerTypes.clear();
when(providerTypeService.getEnabledProviderTypes()).thenReturn(providerTypes);
presenter.onRefreshProviderTypes(new ProviderTypeListRefreshEvent());
verify(view, times(1)).setEmptyView(providerTypeEmptyPresenterView);
verify(providerTypeNavigationPresenter, times(1)).clear();
verify(providerTypeNavigationPresenter, times(0)).setup(Mockito.<ProviderType>any(), anyCollectionOf(ProviderType.class));
}
use of org.guvnor.ala.ui.client.events.ProviderTypeListRefreshEvent in project kie-wb-common by kiegroup.
the class ProviderTypeNavigationPresenterTest method testOnRefresh.
@Test
public void testOnRefresh() {
presenter.onRefresh();
verify(providerTypeListRefreshEvent, times(1)).fire(new ProviderTypeListRefreshEvent());
}
Aggregations