Class RiderDSL
- java.lang.Object
-
- com.github.database.rider.core.dsl.RiderDSL
-
public class RiderDSL extends Object
- Since:
- 1.13.0 DSL for populating database which is an alternative to `@DataSet` annotation
- Author:
- rmpestano
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRiderDSL.DataSetConfigDSLstatic classRiderDSL.DBUnitConfigDSL
-
Constructor Summary
Constructors Constructor Description RiderDSL()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateDataSet()Creates a dataset in database using the provided connection (Connection), dataset configuration (DataSetConfigand dbunit configuration (DBUnitConfig)voidexpectDataSet()voidexpectDataSet(ExpectedDataSetConfig expectedDataSetConfig)Compares current database state with an expected dataset.static RiderDSL.DataSetConfigDSLwithConnection()Reuses current connection configured in the DSLstatic RiderDSL.DataSetConfigDSLwithConnection(Connection connection)Configures the DSL with provided JDBC connection
-
-
-
Method Detail
-
createDataSet
public void createDataSet()
Creates a dataset in database using the provided connection (Connection), dataset configuration (DataSetConfigand dbunit configuration (DBUnitConfig)
-
expectDataSet
public void expectDataSet() throws org.dbunit.DatabaseUnitException- Throws:
org.dbunit.DatabaseUnitException
-
expectDataSet
public void expectDataSet(ExpectedDataSetConfig expectedDataSetConfig) throws org.dbunit.DatabaseUnitException
Compares current database state with an expected dataset. The same way as in @ExpectedDataSet.- Parameters:
expectedDataSetConfig- expected dataset configuration- Throws:
org.dbunit.DatabaseUnitException- exception when comparison fails- Since:
- 1.15.0
-
withConnection
public static RiderDSL.DataSetConfigDSL withConnection(Connection connection)
Configures the DSL with provided JDBC connection- Parameters:
connection- jdbc connection to be used when populating the database- Returns:
RiderDSL.DataSetConfigDSLinstance
-
withConnection
public static RiderDSL.DataSetConfigDSL withConnection()
Reuses current connection configured in the DSL- Returns:
RiderDSL.DataSetConfigDSLinstance
-
-