CSVDataSetEditWorkflow extends DataSetEditWorkflow<CSVDataSetDef, CSVDataSetDefEditor> { @Override protected void afterFlush() { super.afterFlush(); if (!editor.isUsingFilePath()) { dataSetDef.setFilePath(null); } else { dataSetDef.setFileURL(null); } } @Inject  CSVDataSetEditWorkflow(final DataSetClientServices clientServices,
                                   final DataSetValidatorProvider validatorProvider,
                                   final SyncBeanManager beanManager,
                                   final Event<SaveRequestEvent> saveRequestEvent,
                                   final Event<TestDataSetRequestEvent> testDataSetEvent,
                                   final Event<CancelRequestEvent> cancelRequestEvent,
                                   final View view);   }
@Test public void testFlushDriverUsingFileUrl() throws Exception { presenter._setDataSetDef( dataSetDef ); presenter.driver = driver; presenter.editor = csvEditor; when( csvEditor.isUsingFilePath() ).thenReturn( false ); presenter.afterFlush(); verify( dataSetDef, times( 1 ) ).setFilePath( null ); verify( dataSetDef, times( 0 ) ).setFileURL( null ); }
@Test public void testFlushUsingFilePath() throws Exception { presenter._setDataSetDef( dataSetDef ); presenter.driver = driver; presenter.editor = csvEditor; when( csvEditor.isUsingFilePath() ).thenReturn( true ); presenter.afterFlush(); verify( dataSetDef, times( 1 ) ).setFileURL( null ); verify( dataSetDef, times( 0 ) ).setFilePath( null ); }