@Override public void complete() { final Collection<ProviderType> providerTypes = enableProviderTypePage.getSelectedProviderTypes(); providerTypeService.call((Void aVoid) -> onEnableTypesSuccess(providerTypes), (message, throwable) -> onEnableTypesError()).enableProviderTypes(providerTypes); }
@Override public void complete() { final Collection<ProviderType> providerTypes = enableProviderTypePage.getSelectedProviderTypes(); providerTypeService.call((Void aVoid) -> onEnableTypesSuccess(providerTypes), (message, throwable) -> onEnableTypesError()).enableProviderTypes(providerTypes); }
@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())); }
@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())); }
@Test public void testEnableProviderFailure() { //initialize and start the wizard. wizard.start(providerTypeStatus); //emulate the user completing the wizard. preCompleteWizard(); prepareServiceCallerError(providerTypeService, providerTypeServiceCaller); //emulates the user pressing the finish button wizard.complete(); verify(providerTypeService, times(1)).enableProviderTypes(selectedProviders); verify(notification, times(1)).fire(new NotificationEvent(ERROR_MESSAGE, NotificationEvent.NotificationType.ERROR)); }
@Test public void testEnableProviderFailure() { //initialize and start the wizard. wizard.start(providerTypeStatus); //emulate the user completing the wizard. preCompleteWizard(); prepareServiceCallerError(providerTypeService, providerTypeServiceCaller); //emulates the user pressing the finish button wizard.complete(); verify(providerTypeService, times(1)).enableProviderTypes(selectedProviders); verify(notification, times(1)).fire(new NotificationEvent(ERROR_MESSAGE, NotificationEvent.NotificationType.ERROR)); }