CSVDataSetEditWorkflow extends DataSetEditWorkflow<CSVDataSetDef, CSVDataSetDefEditor> { @Override protected Iterable<ConstraintViolation<?>> validate( boolean isCacheEnabled, boolean isPushEnabled, boolean isRefreshEnabled ) { return validatorProvider.validate( dataSetDef, isCacheEnabled, isPushEnabled, isRefreshEnabled, editor.isUsingFilePath() ); } @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 testValidateUsingFilePath() { presenter._setDataSetDef( dataSetDef ); presenter.driver = driver; presenter.editor = csvEditor; when( csvEditor.isUsingFilePath() ).thenReturn( true ); presenter.validate( true, true, true ); verify( csvDataSetDefValidator, times( 1 ) ).validate( dataSetDef, true, true, true, true ); verify( csvDataSetDefValidator, times( 0 ) ).validateCustomAttributes( dataSetDef, true ); }
@Test public void testValidateUsingFileUrl() { presenter._setDataSetDef( dataSetDef ); presenter.driver = driver; presenter.editor = csvEditor; when( csvEditor.isUsingFilePath() ).thenReturn( false ); presenter.validate( true, true, true ); verify( csvDataSetDefValidator, times( 1 ) ).validate( dataSetDef, true, true, true, false ); verify( csvDataSetDefValidator, times( 0 ) ).validateCustomAttributes( dataSetDef, false ); }