Fixed formating and removed unused files
This commit is contained in:
parent
8c44ab9b80
commit
29adc66375
|
@ -2,13 +2,11 @@ package com.baeldung.springbootinitialload.tests;
|
|||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.jdbc.Sql;
|
||||
import org.springframework.test.context.jdbc.Sql.ExecutionPhase;
|
||||
import org.springframework.test.context.jdbc.SqlConfig;
|
||||
import org.springframework.test.context.jdbc.SqlConfig.TransactionMode;
|
||||
import org.springframework.test.context.jdbc.SqlGroup;
|
||||
|
@ -19,10 +17,8 @@ import com.baeldung.boot.repository.EmployeeRepository;
|
|||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = Application.class)
|
||||
@SqlGroup({
|
||||
@Sql(scripts = "/employees_schema_with_comments.sql", config = @SqlConfig(encoding = "utf-8", commentPrefix = "\\", transactionMode = TransactionMode.ISOLATED)),
|
||||
@Sql("/import_employees.sql"),
|
||||
@Sql(executionPhase = ExecutionPhase.AFTER_TEST_METHOD, scripts = { "/drop_employees.sql" }) })
|
||||
@SqlGroup({ @Sql(scripts = "/employees_schema.sql", config = @SqlConfig(transactionMode = TransactionMode.ISOLATED)),
|
||||
@Sql("/import_employees.sql")})
|
||||
public class SpringBootSqlGroupAnnotationTest {
|
||||
|
||||
@Autowired
|
||||
|
@ -30,6 +26,7 @@ public class SpringBootSqlGroupAnnotationTest {
|
|||
|
||||
@Test
|
||||
public void testLoadDataForTestCase() {
|
||||
assertEquals(employeeRepository.findAll().size(), 3);
|
||||
assertEquals(employeeRepository.findAll()
|
||||
.size(), 3);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
drop table if exists EMPLOYEES;
|
|
@ -1,10 +0,0 @@
|
|||
--Drop the table
|
||||
drop table EMPLOYEES if exists;
|
||||
|
||||
--Create the table
|
||||
create table EMPLOYEES(
|
||||
ID int not null AUTO_INCREMENT,
|
||||
NAME varchar(100) not null,
|
||||
TITLE varchar(100),
|
||||
PRIMARY KEY ( ID )
|
||||
);
|
Loading…
Reference in New Issue