From 0d46cd91b8184072e9753e746edf42b1a85e5649 Mon Sep 17 00:00:00 2001 From: Ali Dehghani Date: Mon, 13 May 2019 06:54:21 +0430 Subject: [PATCH] Resolved discussions. --- .../java/com/baeldung/MultipleExtensionsUnitTest.java | 6 +++--- .../java/com/baeldung/ProgrammaticEmployeesUnitTest.java | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/testing-modules/junit-5/src/test/java/com/baeldung/MultipleExtensionsUnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/MultipleExtensionsUnitTest.java index 151e48c551..db37e9a6d2 100644 --- a/testing-modules/junit-5/src/test/java/com/baeldung/MultipleExtensionsUnitTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/MultipleExtensionsUnitTest.java @@ -10,16 +10,16 @@ public class MultipleExtensionsUnitTest { @Order(1) @RegisterExtension 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) @RegisterExtension 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 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 public void justDemonstratingTheIdea() { diff --git a/testing-modules/junit-5/src/test/java/com/baeldung/ProgrammaticEmployeesUnitTest.java b/testing-modules/junit-5/src/test/java/com/baeldung/ProgrammaticEmployeesUnitTest.java index 8a79b92bfc..a29fafd193 100644 --- a/testing-modules/junit-5/src/test/java/com/baeldung/ProgrammaticEmployeesUnitTest.java +++ b/testing-modules/junit-5/src/test/java/com/baeldung/ProgrammaticEmployeesUnitTest.java @@ -20,7 +20,7 @@ public class ProgrammaticEmployeesUnitTest { private EmployeeJdbcDao employeeDao; @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) { this.employeeDao = employeeDao; @@ -30,13 +30,11 @@ public class ProgrammaticEmployeesUnitTest { public void whenAddEmployee_thenGetEmployee() throws SQLException { Employee emp = new Employee(1, "john"); employeeDao.add(emp); - assertEquals(1, employeeDao.findAll() - .size()); + assertEquals(1, employeeDao.findAll().size()); } @Test public void whenGetEmployees_thenEmptyList() throws SQLException { - assertEquals(0, employeeDao.findAll() - .size()); + assertEquals(0, employeeDao.findAll().size()); } }