Skip to content

Commit c11cb3f

Browse files
author
trisberg
committed
fixed test failure due to data polution from other tests
1 parent c362350 commit c11cb3f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-batch-samples/src/test/java/org/springframework/batch/sample/CustomerFilterJobFunctionalTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public void setDataSource(DataSource dataSource) {
6060
@Before
6161
public void onSetUp() throws Exception {
6262
simpleJdbcTemplate.update("delete from TRADE");
63+
simpleJdbcTemplate.update("delete from CUSTOMER where ID > 4");
6364
List<Map<String, Object>> list = simpleJdbcTemplate.queryForList("select name, CREDIT from customer");
6465
for (Map<String, Object> map : list) {
6566
credits.put((String) map.get("NAME"), ((Number) map.get("CREDIT")).doubleValue());
@@ -68,8 +69,8 @@ public void onSetUp() throws Exception {
6869

6970
@After
7071
public void tearDown() throws Exception {
71-
simpleJdbcTemplate.update("delete from CUSTOMER where ID > 4");
7272
simpleJdbcTemplate.update("delete from TRADE");
73+
simpleJdbcTemplate.update("delete from CUSTOMER where ID > 4");
7374
}
7475

7576
@Test
@@ -95,7 +96,6 @@ protected void validatePostConditions() {
9596

9697
public void processRow(ResultSet rs) throws SQLException {
9798
Customer customer = customers.get(activeRow++);
98-
9999
assertEquals(customer.getName(),rs.getString(1));
100100
assertEquals(customer.getCredit(), rs.getDouble(2), .01);
101101
}

0 commit comments

Comments
 (0)