SEC-3029: Fix Compatibility with Spring 4.2.x
This commit is contained in:
@@ -30,7 +30,7 @@ public class DocumentDaoImpl extends JdbcDaoSupport implements DocumentDao {
|
||||
private Long obtainPrimaryKey() {
|
||||
Assert.isTrue(TransactionSynchronizationManager.isSynchronizationActive(),
|
||||
"Transaction must be running");
|
||||
return new Long(getJdbcTemplate().queryForLong(SELECT_IDENTITY));
|
||||
return getJdbcTemplate().queryForObject(SELECT_IDENTITY, Long.class);
|
||||
}
|
||||
|
||||
public void create(AbstractElement element) {
|
||||
|
||||
@@ -40,8 +40,8 @@ public class DmsIntegrationTests extends AbstractTransactionalJUnit4SpringContex
|
||||
|
||||
@Test
|
||||
public void testBasePopulation() {
|
||||
assertEquals(9, jdbcTemplate.queryForInt("select count(id) from DIRECTORY"));
|
||||
assertEquals(90, jdbcTemplate.queryForInt("select count(id) from FILE"));
|
||||
assertEquals(9, (int) jdbcTemplate.queryForObject("select count(id) from DIRECTORY", Integer.class));
|
||||
assertEquals(90, (int) jdbcTemplate.queryForObject("select count(id) from FILE", Integer.class));
|
||||
assertEquals(3, documentDao.findElements(Directory.ROOT_DIRECTORY).length);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,18 +15,23 @@ public class SecureDmsIntegrationTests extends DmsIntegrationTests {
|
||||
|
||||
@Test
|
||||
public void testBasePopulation() {
|
||||
assertEquals(9, jdbcTemplate.queryForInt("select count(id) from DIRECTORY"));
|
||||
assertEquals(90, jdbcTemplate.queryForInt("select count(id) from FILE"));
|
||||
assertEquals(4, jdbcTemplate.queryForInt("select count(id) from ACL_SID")); // 3
|
||||
// users
|
||||
// + 1
|
||||
// role
|
||||
assertEquals(2, jdbcTemplate.queryForInt("select count(id) from ACL_CLASS")); // Directory
|
||||
// and
|
||||
// File
|
||||
assertEquals(9,
|
||||
(int) jdbcTemplate.queryForObject("select count(id) from DIRECTORY", Integer.class));
|
||||
assertEquals(90,
|
||||
(int) jdbcTemplate.queryForObject("select count(id) from FILE", Integer.class));
|
||||
assertEquals(4,
|
||||
(int) jdbcTemplate.queryForObject("select count(id) from ACL_SID", Integer.class)); // 3
|
||||
// users
|
||||
// + 1
|
||||
// role
|
||||
assertEquals(2,
|
||||
(int) jdbcTemplate.queryForObject("select count(id) from ACL_CLASS", Integer.class)); // Directory
|
||||
// and
|
||||
// File
|
||||
assertEquals(100,
|
||||
jdbcTemplate.queryForInt("select count(id) from ACL_OBJECT_IDENTITY"));
|
||||
assertEquals(115, jdbcTemplate.queryForInt("select count(id) from ACL_ENTRY"));
|
||||
(int) jdbcTemplate.queryForObject("select count(id) from ACL_OBJECT_IDENTITY", Integer.class));
|
||||
assertEquals(115,
|
||||
(int) jdbcTemplate.queryForObject("select count(id) from ACL_ENTRY", Integer.class));
|
||||
}
|
||||
|
||||
public void testMarissaRetrieval() {
|
||||
|
||||
Reference in New Issue
Block a user