Resolved discussions.
This commit is contained in:
parent
f7f6bbe79b
commit
0d46cd91b8
|
@ -10,16 +10,16 @@ public class MultipleExtensionsUnitTest {
|
||||||
@Order(1)
|
@Order(1)
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
static EmployeeDatabaseSetupExtension SECOND_DB =
|
static EmployeeDatabaseSetupExtension SECOND_DB =
|
||||||
new EmployeeDatabaseSetupExtension("jdbc:h2:mem:DbTwo;DB_CLOSE_DELAY=-1", "org.h2.Driver", "sa", "");
|
new EmployeeDatabaseSetupExtension("jdbc:h2:mem:DbTwo;DB_CLOSE_DELAY=-1", "org.h2.Driver", "sa", "");
|
||||||
|
|
||||||
@Order(0)
|
@Order(0)
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
static EmployeeDatabaseSetupExtension FIRST_DB =
|
static EmployeeDatabaseSetupExtension FIRST_DB =
|
||||||
new EmployeeDatabaseSetupExtension("jdbc:h2:mem:DbOne;DB_CLOSE_DELAY=-1", "org.h2.Driver", "sa", "");
|
new EmployeeDatabaseSetupExtension("jdbc:h2:mem:DbOne;DB_CLOSE_DELAY=-1", "org.h2.Driver", "sa", "");
|
||||||
|
|
||||||
@RegisterExtension
|
@RegisterExtension
|
||||||
static EmployeeDatabaseSetupExtension LAST_DB =
|
static EmployeeDatabaseSetupExtension LAST_DB =
|
||||||
new EmployeeDatabaseSetupExtension("jdbc:h2:mem:DbLast;DB_CLOSE_DELAY=-1", "org.h2.Driver", "sa", "");
|
new EmployeeDatabaseSetupExtension("jdbc:h2:mem:DbLast;DB_CLOSE_DELAY=-1", "org.h2.Driver", "sa", "");
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void justDemonstratingTheIdea() {
|
public void justDemonstratingTheIdea() {
|
||||||
|
|
|
@ -20,7 +20,7 @@ public class ProgrammaticEmployeesUnitTest {
|
||||||
private EmployeeJdbcDao employeeDao;
|
private EmployeeJdbcDao employeeDao;
|
||||||
|
|
||||||
@RegisterExtension static EmployeeDatabaseSetupExtension DB =
|
@RegisterExtension static EmployeeDatabaseSetupExtension DB =
|
||||||
new EmployeeDatabaseSetupExtension("jdbc:h2:mem:AnotherDb;DB_CLOSE_DELAY=-1", "org.h2.Driver", "sa", "");
|
new EmployeeDatabaseSetupExtension("jdbc:h2:mem:AnotherDb;DB_CLOSE_DELAY=-1", "org.h2.Driver", "sa", "");
|
||||||
|
|
||||||
public ProgrammaticEmployeesUnitTest(EmployeeJdbcDao employeeDao) {
|
public ProgrammaticEmployeesUnitTest(EmployeeJdbcDao employeeDao) {
|
||||||
this.employeeDao = employeeDao;
|
this.employeeDao = employeeDao;
|
||||||
|
@ -30,13 +30,11 @@ public class ProgrammaticEmployeesUnitTest {
|
||||||
public void whenAddEmployee_thenGetEmployee() throws SQLException {
|
public void whenAddEmployee_thenGetEmployee() throws SQLException {
|
||||||
Employee emp = new Employee(1, "john");
|
Employee emp = new Employee(1, "john");
|
||||||
employeeDao.add(emp);
|
employeeDao.add(emp);
|
||||||
assertEquals(1, employeeDao.findAll()
|
assertEquals(1, employeeDao.findAll().size());
|
||||||
.size());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenGetEmployees_thenEmptyList() throws SQLException {
|
public void whenGetEmployees_thenEmptyList() throws SQLException {
|
||||||
assertEquals(0, employeeDao.findAll()
|
assertEquals(0, employeeDao.findAll().size());
|
||||||
.size());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue