@Test public void testValidateUsingTable() { final boolean isCacheEnabled = true; final boolean isPushEnabled = true; final boolean isRefreshEnabled = true; final boolean isUsingQuery = false; tested.validate(sqlDataSetDef, isCacheEnabled, isPushEnabled, isRefreshEnabled, isUsingQuery); verify(validator, times(1)).validate(sqlDataSetDef, DataSetDefBasicAttributesGroup.class, DataSetDefProviderTypeGroup.class, DataSetDefCacheRowsValidation.class, DataSetDefPushSizeValidation.class, DataSetDefRefreshIntervalValidation.class, SQLDataSetDefValidation.class, SQLDataSetDefDbTableValidation.class); }
@Override public Iterable<ConstraintViolation<?>> validate( SQLDataSetDef dataSetDef, boolean isCacheEnabled, boolean isPushEnabled, boolean isRefreshEnabled, Object... params ) { assert params != null && params.length == 1; final Boolean isQuery = (Boolean) params[0]; Set<ConstraintViolation<SQLDataSetDef>> _violations = validator.validate( dataSetDef, getValidationGroups( isCacheEnabled, isPushEnabled, isRefreshEnabled, SQLDataSetDefValidation.class, isQuery ? SQLDataSetDefDbSQLValidation.class : SQLDataSetDefDbTableValidation.class ) ); return toIterable( _violations ); }
SQLDataSetDefValidator extends AbstractDataSetDefValidator<SQLDataSetDef> { @Override public Iterable<ConstraintViolation<?>> validate( SQLDataSetDef dataSetDef, boolean isCacheEnabled, boolean isPushEnabled, boolean isRefreshEnabled, Object... params ) { assert params != null && params.length == 1; final Boolean isQuery = (Boolean) params[0]; Set<ConstraintViolation<SQLDataSetDef>> _violations = validator.validate( dataSetDef, getValidationGroups( isCacheEnabled, isPushEnabled, isRefreshEnabled, SQLDataSetDefValidation.class, isQuery ? SQLDataSetDefDbSQLValidation.class : SQLDataSetDefDbTableValidation.class ) ); return toIterable( _violations ); } }
SQLDataSetDefValidator extends AbstractDataSetDefValidator<SQLDataSetDef> { @Override public Iterable<ConstraintViolation<?>> validate( SQLDataSetDef dataSetDef, boolean isCacheEnabled, boolean isPushEnabled, boolean isRefreshEnabled, Object... params ) { assert params != null && params.length == 1; final Boolean isQuery = (Boolean) params[0]; Set<ConstraintViolation<SQLDataSetDef>> _violations = validator.validate( dataSetDef, getValidationGroups( isCacheEnabled, isPushEnabled, isRefreshEnabled, SQLDataSetDefValidation.class, isQuery ? SQLDataSetDefDbSQLValidation.class : SQLDataSetDefDbTableValidation.class ) ); return toIterable( _violations ); } @Inject  SQLDataSetDefValidator( Validator validator ); }
SQLDataSetDefValidator extends AbstractDataSetDefValidator<SQLDataSetDef> { @Override public Iterable<ConstraintViolation<?>> validate( SQLDataSetDef dataSetDef, boolean isCacheEnabled, boolean isPushEnabled, boolean isRefreshEnabled, Object... params ) { assert params != null && params.length == 1; final Boolean isQuery = (Boolean) params[0]; Set<ConstraintViolation<SQLDataSetDef>> _violations = validator.validate( dataSetDef, getValidationGroups( isCacheEnabled, isPushEnabled, isRefreshEnabled, SQLDataSetDefValidation.class, isQuery ? SQLDataSetDefDbSQLValidation.class : SQLDataSetDefDbTableValidation.class ) ); return toIterable( _violations ); } @Inject  SQLDataSetDefValidator( Validator validator ); @Override DataSetProviderType getSupportedProvider(); @Override Iterable<ConstraintViolation<?>> validateCustomAttributes( SQLDataSetDef dataSetDef, Object... params ); @Override Iterable<ConstraintViolation<?>> validate( SQLDataSetDef dataSetDef,
                                                      boolean isCacheEnabled,
                                                      boolean isPushEnabled,
                                                      boolean isRefreshEnabled,
                                                      Object... params ); }
SQLDataSetDefValidator extends AbstractDataSetDefValidator<SQLDataSetDef> { @Override public Iterable<ConstraintViolation<?>> validate( SQLDataSetDef dataSetDef, boolean isCacheEnabled, boolean isPushEnabled, boolean isRefreshEnabled, Object... params ) { assert params != null && params.length == 1; final Boolean isQuery = (Boolean) params[0]; Set<ConstraintViolation<SQLDataSetDef>> _violations = validator.validate( dataSetDef, getValidationGroups( isCacheEnabled, isPushEnabled, isRefreshEnabled, SQLDataSetDefValidation.class, isQuery ? SQLDataSetDefDbSQLValidation.class : SQLDataSetDefDbTableValidation.class ) ); return toIterable( _violations ); } @Inject  SQLDataSetDefValidator( Validator validator ); @Override DataSetProviderType getSupportedProvider(); @Override Iterable<ConstraintViolation<?>> validateCustomAttributes( SQLDataSetDef dataSetDef, Object... params ); @Override Iterable<ConstraintViolation<?>> validate( SQLDataSetDef dataSetDef,
                                                      boolean isCacheEnabled,
                                                      boolean isPushEnabled,
                                                      boolean isRefreshEnabled,
                                                      Object... params );  }