The main goal of this project is to show how to feed tests with sqls.
Suppose we have test class path/CustomerRepositoryTest:
- add sqls to
test/resources/path - annotate methods in
CustomerRepositoryTest:@Sql(value = "xxx.sql")- because defaultexecutionPhaseisSql.ExecutionPhase.BEFORE_TEST_METHOD@Sql(value = "xxx.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD)
Remark: it is possible to annotate whole class with @Sql - it's especially valuable for
clearing database before each test method (script will be fired before each method):
@Sql(value = "delete_all_customers.sql")
class CustomerRepositoryTest {
Coverage: 70%