Skip to content

Commit 19738c3

Browse files
committed
Merge pull request citerus#2 from orende/JDBCTemplate-fix
Replaced deprecated JDBCTemplate.queryForInt
2 parents 3775b76 + c937ea4 commit 19738c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/java/se/citerus/dddsample/infrastructure/persistence/hibernate/CargoRepositoryTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public void testSave() {
177177
public void testReplaceItinerary() {
178178
Cargo cargo = cargoRepository.find(new TrackingId("FGH"));
179179
Long cargoId = getLongId(cargo);
180-
assertEquals(3, jdbcTemplate.queryForInt("select count(*) from Leg where cargo_id = ?", cargoId));
180+
assertEquals(3, jdbcTemplate.queryForObject("select count(*) from Leg where cargo_id = ?", new Object[]{cargoId}, Integer.class).intValue());
181181

182182
Location legFrom = locationRepository.find(new UnLocode("FIHEL"));
183183
Location legTo = locationRepository.find(new UnLocode("DEHAM"));
@@ -188,7 +188,7 @@ public void testReplaceItinerary() {
188188
cargoRepository.store(cargo);
189189
flush();
190190

191-
assertEquals(1, jdbcTemplate.queryForInt("select count(*) from Leg where cargo_id = ?", cargoId));
191+
assertEquals(1, jdbcTemplate.queryForObject("select count(*) from Leg where cargo_id = ?", new Object[]{cargoId}, Integer.class).intValue());
192192
}
193193

194194
@Test

0 commit comments

Comments
 (0)