@Override public void complete() { final ProviderConfiguration providerConfiguration = providerConfigurationPage.buildProviderConfiguration(); providerService.call((Void aVoid) -> onCreateProviderSuccess(providerConfiguration), popupHelper.getPopupErrorCallback()).createProvider(providerType, providerConfiguration); }
@Override public void complete() { final ProviderConfiguration providerConfiguration = providerConfigurationPage.buildProviderConfiguration(); providerService.call((Void aVoid) -> onCreateProviderSuccess(providerConfiguration), popupHelper.getPopupErrorCallback()).createProvider(providerType, providerConfiguration); }
@Test public void testCreateProviderFailure() { //initialize and start the wizard. wizard.start(providerType); //emulate the user completing the wizard. preCompleteWizard(); prepareServiceCallerError(providerService, providerServiceCaller); //emulate the user pressing the finish button. wizard.complete(); verify(providerService, times(1)).createProvider(providerType, providerConfiguration); verify(popupHelper, times(1)).getPopupErrorCallback(); verify(defaultErrorCallback, times(1)).error(any(Message.class), any(Throwable.class)); verify(providerTypeSelectedEvent, never()).fire(any(ProviderTypeSelectedEvent.class)); }
@Test public void testCreateProviderFailure() { //initialize and start the wizard. wizard.start(providerType); //emulate the user completing the wizard. preCompleteWizard(); prepareServiceCallerError(providerService, providerServiceCaller); //emulate the user pressing the finish button. wizard.complete(); verify(providerService, times(1)).createProvider(providerType, providerConfiguration); verify(popupHelper, times(1)).getPopupErrorCallback(); verify(defaultErrorCallback, times(1)).error(any(Message.class), any(Throwable.class)); verify(providerTypeSelectedEvent, never()).fire(any(ProviderTypeSelectedEvent.class)); }
@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())); }
@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())); }