@Override public String getTitle() { return newContainerFormPresenter.getView().getNewContainerWizardTitle(); }
@Override public boolean error( final Object o, final Throwable throwable ) { notification.fire( new NotificationEvent( newContainerFormPresenter.getView().getNewContainerWizardSaveError(), NotificationEvent.NotificationType.ERROR ) ); NewContainerWizard.this.pageSelected( 0 ); NewContainerWizard.this.start(); return false; } } ).saveContainerSpec( newContainerFormPresenter.getServerTemplate().getId(), newContainer );
@Override public void callback( final Void o ) { notification.fire( new NotificationEvent( newContainerFormPresenter.getView().getNewContainerWizardSaveSuccess(), NotificationEvent.NotificationType.SUCCESS ) ); clear(); NewContainerWizard.super.complete(); serverTemplateSelectedEvent.fire( new ServerTemplateSelected( serverTemplate, newContainer.getId() ) ); } }, new ErrorCallback<Object>() {
@Before public void setup() throws IllegalAccessException, NoSuchFieldException { doNothing().when( notification ).fire( any( NotificationEvent.class ) ); doNothing().when( serverTemplateSelectedEvent ).fire( any( ServerTemplateSelected.class ) ); specManagementServiceCaller = new CallerMock<SpecManagementService>( specManagementService ); when( newContainerFormPresenter.getView() ).thenReturn( newContainerFormPresenterView ); newContainerWizard = spy( new NewContainerWizard( newContainerFormPresenter, processConfigPagePresenter, specManagementServiceCaller, notification, serverTemplateSelectedEvent ) ); final Field field = AbstractWizard.class.getDeclaredField( "view" ); field.setAccessible( true ); field.set( newContainerWizard, view ); }