BAEL-3069 Remove final keyword, add more empty lines for readability.

This commit is contained in:
Gang Wu 2020-03-23 22:00:55 -06:00
parent 05e79680cf
commit ff87d3ecc2
2 changed files with 5 additions and 1 deletions

View File

@ -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);
}

View File

@ -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());
}
}