Added the missing test.
This commit is contained in:
parent
4f8327e0b4
commit
8cab3f616e
|
@ -0,0 +1,28 @@
|
||||||
|
package com.baeldung;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.junit.jupiter.api.Order;
|
||||||
|
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||||
|
import com.baeldung.extensions.EmployeeDatabaseSetupExtension;
|
||||||
|
|
||||||
|
public class MultipleExtensionsUnitTest {
|
||||||
|
|
||||||
|
@Order(1)
|
||||||
|
@RegisterExtension
|
||||||
|
static EmployeeDatabaseSetupExtension SECOND_DB =
|
||||||
|
new EmployeeDatabaseSetupExtension("jdbc:h2:mem:DbTwo;DB_CLOSE_DELAY=-1", "org.h2.Driver", "sa", "");
|
||||||
|
|
||||||
|
@Order(0)
|
||||||
|
@RegisterExtension
|
||||||
|
static EmployeeDatabaseSetupExtension FIRST_DB =
|
||||||
|
new EmployeeDatabaseSetupExtension("jdbc:h2:mem:DbOne;DB_CLOSE_DELAY=-1", "org.h2.Driver", "sa", "");
|
||||||
|
|
||||||
|
@RegisterExtension
|
||||||
|
static EmployeeDatabaseSetupExtension LAST_DB =
|
||||||
|
new EmployeeDatabaseSetupExtension("jdbc:h2:mem:DbLast;DB_CLOSE_DELAY=-1", "org.h2.Driver", "sa", "");
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void justDemonstratingTheIdea() {
|
||||||
|
// empty test
|
||||||
|
}
|
||||||
|
}
|
|
@ -19,7 +19,7 @@ public class EmployeeJdbcDao {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createTable() throws SQLException {
|
public void createTable() throws SQLException {
|
||||||
String createQuery = "CREATE TABLE employees(id long primary key, firstName varchar(50))";
|
String createQuery = "CREATE TABLE IF NOT EXISTS employees(id long primary key, firstName varchar(50))";
|
||||||
PreparedStatement pstmt = con.prepareStatement(createQuery);
|
PreparedStatement pstmt = con.prepareStatement(createQuery);
|
||||||
|
|
||||||
pstmt.execute();
|
pstmt.execute();
|
||||||
|
|
Loading…
Reference in New Issue