BAEL-3069 Remove final keyword, add more empty lines for readability.
This commit is contained in:
parent
05e79680cf
commit
ff87d3ecc2
|
@ -9,7 +9,7 @@ import org.springframework.stereotype.Repository;
|
|||
public class EmployeeDAO {
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
public void setDataSource(final DataSource dataSource) {
|
||||
public void setDataSource(DataSource dataSource) {
|
||||
jdbcTemplate = new JdbcTemplate(dataSource);
|
||||
}
|
||||
|
||||
|
|
|
@ -27,10 +27,12 @@ public class EmployeeDAOUnitTest {
|
|||
ReflectionTestUtils.setField(employeeDAO, "jdbcTemplate", jdbcTemplate);
|
||||
Mockito.when(jdbcTemplate.queryForObject("SELECT COUNT(*) FROM EMPLOYEE", Integer.class))
|
||||
.thenReturn(4);
|
||||
|
||||
assertEquals(4, employeeDAO.getCountOfEmployees());
|
||||
|
||||
Mockito.when(jdbcTemplate.queryForObject(Mockito.anyString(), Mockito.eq(Integer.class)))
|
||||
.thenReturn(3);
|
||||
|
||||
assertEquals(3, employeeDAO.getCountOfEmployees());
|
||||
}
|
||||
|
||||
|
@ -40,8 +42,10 @@ public class EmployeeDAOUnitTest {
|
|||
.addScript("classpath:jdbc/schema.sql")
|
||||
.addScript("classpath:jdbc/test-data.sql")
|
||||
.build();
|
||||
|
||||
EmployeeDAO employeeDAO = new EmployeeDAO();
|
||||
employeeDAO.setDataSource(dataSource);
|
||||
|
||||
assertEquals(4, employeeDAO.getCountOfEmployees());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue