@Test public void testProviderTypeEdition() { DataSetDef def = mock( DataSetDef.class ); presenter.edit( def ).providerTypeEdition(); verify( beanManager, times( 1 ) ).lookupBean( DataSetDefProviderTypeDriver.class ); verify( dataSetDefProviderTypeDriver, times( 1 ) ).initialize( providerTypeEditor ); verify( dataSetDefProviderTypeDriver, times( 1 ) ).edit( any( DataSetDef.class ) ); verify( view, times( 2 ) ).clearView(); verify( view, times( 1 ) ).add( any( IsWidget.class ) ); verify( view, times( 0 ) ).init( presenter ); verify( view, times( 0 ) ).addButton( anyString(), anyString(), anyBoolean(), any( Command.class ) ); verify( view, times( 0 ) ).clearButtons(); }
public DataSetProviderTypeWorkflow providerTypeEdition() { checkDataSetDefNotNull(); dataSetDefProviderTypeDriver = beanManager.lookupBean(DataSetDefProviderTypeDriver.class).newInstance(); dataSetDefProviderTypeDriver.initialize(providerTypeEditor); dataSetDefProviderTypeDriver.edit(getDataSetDef()); this.flushCommand = () -> { flush(dataSetDefProviderTypeDriver); }; this.stepValidator = () -> { Iterable<ConstraintViolation<?>> violations = validatorProvider.validateProviderType(getDataSetDef()); dataSetDefProviderTypeDriver.setConstraintViolations(violations); addViolations(violations); }; view.clearView(); view.add(providerTypeEditor.asWidget()); return this; }
DataSetProviderTypeWorkflow extends DataSetEditorWorkflow<DataSetDef> { public DataSetProviderTypeWorkflow providerTypeEdition() { checkDataSetDefNotNull(); dataSetDefProviderTypeDriver = beanManager.lookupBean(DataSetDefProviderTypeDriver.class).newInstance(); dataSetDefProviderTypeDriver.initialize(providerTypeEditor); dataSetDefProviderTypeDriver.edit(getDataSetDef()); this.flushCommand = () -> { flush(dataSetDefProviderTypeDriver); }; this.stepValidator = () -> { Iterable<ConstraintViolation<?>> violations = validatorProvider.validateProviderType(getDataSetDef()); dataSetDefProviderTypeDriver.setConstraintViolations(violations); addViolations(violations); }; view.clearView(); view.add(providerTypeEditor.asWidget()); return this; } }
DataSetProviderTypeWorkflow extends DataSetEditorWorkflow<DataSetDef> { public DataSetProviderTypeWorkflow providerTypeEdition() { checkDataSetDefNotNull(); dataSetDefProviderTypeDriver = beanManager.lookupBean(DataSetDefProviderTypeDriver.class).newInstance(); dataSetDefProviderTypeDriver.initialize(providerTypeEditor); dataSetDefProviderTypeDriver.edit(getDataSetDef()); this.flushCommand = () -> { flush(dataSetDefProviderTypeDriver); }; this.stepValidator = () -> { Iterable<ConstraintViolation<?>> violations = validatorProvider.validateProviderType(getDataSetDef()); dataSetDefProviderTypeDriver.setConstraintViolations(violations); addViolations(violations); }; view.clearView(); view.add(providerTypeEditor.asWidget()); return this; } @Inject  DataSetProviderTypeWorkflow(final DataSetClientServices clientServices,
                                       final DataSetValidatorProvider validatorProvider,
                                       final SyncBeanManager beanManager,
                                       final DataSetDefProviderTypeEditor providerTypeEditor,
                                       final Event<SaveRequestEvent> saveRequestEvent,
                                       final Event<CancelRequestEvent> cancelRequestEvent,
                                       final Event<TestDataSetRequestEvent> testDataSetEvent,
                                       final View view); }
DataSetProviderTypeWorkflow extends DataSetEditorWorkflow<DataSetDef> { public DataSetProviderTypeWorkflow providerTypeEdition() { checkDataSetDefNotNull(); dataSetDefProviderTypeDriver = beanManager.lookupBean(DataSetDefProviderTypeDriver.class).newInstance(); dataSetDefProviderTypeDriver.initialize(providerTypeEditor); dataSetDefProviderTypeDriver.edit(getDataSetDef()); this.flushCommand = () -> { flush(dataSetDefProviderTypeDriver); }; this.stepValidator = () -> { Iterable<ConstraintViolation<?>> violations = validatorProvider.validateProviderType(getDataSetDef()); dataSetDefProviderTypeDriver.setConstraintViolations(violations); addViolations(violations); }; view.clearView(); view.add(providerTypeEditor.asWidget()); return this; } @Inject  DataSetProviderTypeWorkflow(final DataSetClientServices clientServices,
                                       final DataSetValidatorProvider validatorProvider,
                                       final SyncBeanManager beanManager,
                                       final DataSetDefProviderTypeEditor providerTypeEditor,
                                       final Event<SaveRequestEvent> saveRequestEvent,
                                       final Event<CancelRequestEvent> cancelRequestEvent,
                                       final Event<TestDataSetRequestEvent> testDataSetEvent,
                                       final View view); @PostConstruct void init(); DataSetProviderTypeWorkflow edit(final DataSetDef def); DataSetProviderType getProviderType(); DataSetProviderTypeWorkflow providerTypeEdition(); }
DataSetProviderTypeWorkflow extends DataSetEditorWorkflow<DataSetDef> { public DataSetProviderTypeWorkflow providerTypeEdition() { checkDataSetDefNotNull(); dataSetDefProviderTypeDriver = beanManager.lookupBean(DataSetDefProviderTypeDriver.class).newInstance(); dataSetDefProviderTypeDriver.initialize(providerTypeEditor); dataSetDefProviderTypeDriver.edit(getDataSetDef()); this.flushCommand = () -> { flush(dataSetDefProviderTypeDriver); }; this.stepValidator = () -> { Iterable<ConstraintViolation<?>> violations = validatorProvider.validateProviderType(getDataSetDef()); dataSetDefProviderTypeDriver.setConstraintViolations(violations); addViolations(violations); }; view.clearView(); view.add(providerTypeEditor.asWidget()); return this; } @Inject  DataSetProviderTypeWorkflow(final DataSetClientServices clientServices,
                                       final DataSetValidatorProvider validatorProvider,
                                       final SyncBeanManager beanManager,
                                       final DataSetDefProviderTypeEditor providerTypeEditor,
                                       final Event<SaveRequestEvent> saveRequestEvent,
                                       final Event<CancelRequestEvent> cancelRequestEvent,
                                       final Event<TestDataSetRequestEvent> testDataSetEvent,
                                       final View view); @PostConstruct void init(); DataSetProviderTypeWorkflow edit(final DataSetDef def); DataSetProviderType getProviderType(); DataSetProviderTypeWorkflow providerTypeEdition();  }