Testcase feedback incorporated (#1)

* Change

* Incorporated feedback
This commit is contained in:
Harsha Veeravalli 2019-08-08 13:48:37 +02:00 committed by GitHub
parent e35a8023ea
commit cefb7e496e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 8 deletions

View File

@ -16,7 +16,7 @@ import com.baeldung.boot.repository.EmployeeRepository;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class)
@Sql({ "/employees_schema.sql", "/import_employees.sql" })
@Sql({"/employees_schema.sql", "/import_employees.sql"})
public class SpringBootInitialLoadIntegrationTest {
@Autowired
@ -24,14 +24,14 @@ public class SpringBootInitialLoadIntegrationTest {
@Test
public void testLoadDataForTestClass() {
assertEquals(employeeRepository.findAll()
.size(), 3);
assertEquals(3, employeeRepository.findAll()
.size());
}
@Test
@Sql(scripts = { "/import_senior_employees.sql" }, config = @SqlConfig(encoding = "utf-8", transactionMode = TransactionMode.ISOLATED))
@Sql(scripts = {"/import_senior_employees.sql"}, config = @SqlConfig(encoding = "utf-8", transactionMode = TransactionMode.ISOLATED))
public void testLoadDataForTestCase() {
assertEquals(employeeRepository.findAll()
.size(), 5);
assertEquals(5, employeeRepository.findAll()
.size());
}
}

View File

@ -26,7 +26,6 @@ public class SpringBootSqlGroupAnnotationIntegrationTest {
@Test
public void testLoadDataForTestCase() {
assertEquals(employeeRepository.findAll()
.size(), 3);
assertEquals(3, employeeRepository.findAll().size());
}
}