Added a new constructor for employee extension.
This commit is contained in:
parent
104b0d597f
commit
97022ca7d3
|
@ -15,10 +15,20 @@ import com.baeldung.helpers.JdbcConnectionUtil;
|
|||
|
||||
public class EmployeeDatabaseSetupExtension implements BeforeAllCallback, AfterAllCallback, BeforeEachCallback, AfterEachCallback {
|
||||
|
||||
private Connection con = JdbcConnectionUtil.getConnection();
|
||||
private EmployeeJdbcDao employeeDao = new EmployeeJdbcDao(con);
|
||||
private Connection con;
|
||||
private EmployeeJdbcDao employeeDao;
|
||||
private Savepoint savepoint;
|
||||
|
||||
public EmployeeDatabaseSetupExtension() {
|
||||
con = JdbcConnectionUtil.getConnection();
|
||||
employeeDao = new EmployeeJdbcDao(con);
|
||||
}
|
||||
|
||||
public EmployeeDatabaseSetupExtension(String jdbcUrl, String driver, String username, String password) {
|
||||
con = JdbcConnectionUtil.getConnection(jdbcUrl, driver, username, password);
|
||||
employeeDao = new EmployeeJdbcDao(con);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterAll(ExtensionContext context) throws SQLException {
|
||||
if (con != null) {
|
||||
|
|
Loading…
Reference in New Issue