Remove Deprecation Warnings

- Address usage of new Integer
- Address missing deprecation markers

Closes gh-793
This commit is contained in:
Josh Cummings
2023-07-13 09:54:15 -06:00
parent b75f818415
commit 7fd89aa794
15 changed files with 51 additions and 29 deletions

View File

@@ -79,7 +79,7 @@ public class ContextSourceAndHibernateTransactionManagerIntegrationTests extends
}
OrgPerson person = new OrgPerson();
person.setId(new Integer(1));
person.setId(1);
person.setLastname("Person");
person.setFullname("Some Person");
person.setDescription("Sweden, Company1, Some Person");
@@ -112,7 +112,7 @@ public class ContextSourceAndHibernateTransactionManagerIntegrationTests extends
public void testCreateWithException() {
OrgPerson person = new OrgPerson();
person.setId(new Integer(2));
person.setId(2);
person.setDescription("some description");
person.setFullname("Some testperson");
person.setLastname("testperson");
@@ -148,7 +148,7 @@ public class ContextSourceAndHibernateTransactionManagerIntegrationTests extends
public void testCreate() {
OrgPerson person = new OrgPerson();
person.setId(new Integer(2));
person.setId(2);
person.setDescription("some description");
person.setFullname("Some testperson");
person.setLastname("testperson");
@@ -161,7 +161,7 @@ public class ContextSourceAndHibernateTransactionManagerIntegrationTests extends
person = null;
log.debug("Verifying result");
Object ldapResult = this.ldapTemplate.lookup("cn=some testperson, ou=company1, ou=Sweden");
OrgPerson fromDb = (OrgPerson) this.hibernateTemplate.get(OrgPerson.class, new Integer(2));
OrgPerson fromDb = (OrgPerson) this.hibernateTemplate.get(OrgPerson.class, 2);
assertThat(ldapResult).isNotNull();
assertThat(fromDb).isNotNull();
}
@@ -169,7 +169,7 @@ public class ContextSourceAndHibernateTransactionManagerIntegrationTests extends
@Test
public void testUpdateWithException() {
String dn = "cn=Some Person,ou=company1,ou=Sweden";
OrgPerson originalPerson = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, new Integer(1));
OrgPerson originalPerson = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, 1);
originalPerson.setLastname("fooo");
try {
this.dummyDao.updateWithException(originalPerson);
@@ -189,7 +189,7 @@ public class ContextSourceAndHibernateTransactionManagerIntegrationTests extends
}
});
OrgPerson notUpdatedPerson = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, new Integer(1));
OrgPerson notUpdatedPerson = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, 1);
assertThat(notUpdatedPerson.getLastname()).isEqualTo("Person");
assertThat(notUpdatedPerson.getDescription()).isEqualTo("Sweden, Company1, Some Person");
@@ -200,7 +200,7 @@ public class ContextSourceAndHibernateTransactionManagerIntegrationTests extends
@Test
public void testUpdate() {
String dn = "cn=Some Person,ou=company1,ou=Sweden";
OrgPerson person = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, new Integer(1));
OrgPerson person = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, 1);
person.setLastname("Updated Person");
person.setDescription("Updated description");
@@ -215,7 +215,7 @@ public class ContextSourceAndHibernateTransactionManagerIntegrationTests extends
}
});
OrgPerson updatedPerson = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, new Integer(1));
OrgPerson updatedPerson = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, 1);
assertThat(updatedPerson.getLastname()).isEqualTo("Updated Person");
assertThat(updatedPerson.getDescription()).isEqualTo("Updated description");
assertThat(ldapResult).isNotNull();
@@ -225,7 +225,7 @@ public class ContextSourceAndHibernateTransactionManagerIntegrationTests extends
public void testUpdateAndRenameWithException() {
String dn = "cn=Some Person2,ou=company1,ou=Sweden";
String newDn = "cn=Some Person2,ou=company2,ou=Sweden";
OrgPerson person = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, new Integer(1));
OrgPerson person = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, 1);
person.setLastname("Updated Person");
person.setDescription("Updated description");
@@ -320,7 +320,7 @@ public class ContextSourceAndHibernateTransactionManagerIntegrationTests extends
@Test
public void testUnbindWithException() {
String dn = "cn=Some Person,ou=company1,ou=Sweden";
OrgPerson person = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, new Integer(1));
OrgPerson person = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, 1);
try {
// Perform test
@@ -340,7 +340,7 @@ public class ContextSourceAndHibernateTransactionManagerIntegrationTests extends
}
});
person = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, new Integer(1)); // will
person = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, 1); // will
// throw
// exception
// of
@@ -356,7 +356,7 @@ public class ContextSourceAndHibernateTransactionManagerIntegrationTests extends
public void testUnbind() {
String dn = "cn=Some Person,ou=company1,ou=Sweden";
// Perform test
OrgPerson person = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, new Integer(1));
OrgPerson person = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, 1);
this.dummyDao.unbind(person);
try {
@@ -368,7 +368,7 @@ public class ContextSourceAndHibernateTransactionManagerIntegrationTests extends
assertThat(true).isTrue();
}
person = (OrgPerson) this.hibernateTemplate.get(OrgPerson.class, new Integer(1));
person = (OrgPerson) this.hibernateTemplate.get(OrgPerson.class, 1);
assertThat(person).isNull();
}

View File

@@ -61,7 +61,7 @@ public class ContextSourceAndHibernateTransactionManagerLdap179IntegrationTests
public void testCreate() {
OrgPerson person = new OrgPerson();
person.setId(new Integer(2));
person.setId(2);
person.setDescription("some description");
person.setFullname("Some testperson");
person.setLastname("testperson");

View File

@@ -80,7 +80,7 @@ public class ContextSourceAndHibernateTransactionManagerNamespaceITests extends
}
OrgPerson person = new OrgPerson();
person.setId(new Integer(1));
person.setId(1);
person.setLastname("Person");
person.setFullname("Some Person");
person.setDescription("Sweden, Company1, Some Person");
@@ -113,7 +113,7 @@ public class ContextSourceAndHibernateTransactionManagerNamespaceITests extends
public void testCreateWithException() {
OrgPerson person = new OrgPerson();
person.setId(new Integer(2));
person.setId(2);
person.setDescription("some description");
person.setFullname("Some testperson");
person.setLastname("testperson");
@@ -149,7 +149,7 @@ public class ContextSourceAndHibernateTransactionManagerNamespaceITests extends
public void testCreate() {
OrgPerson person = new OrgPerson();
person.setId(new Integer(2));
person.setId(2);
person.setDescription("some description");
person.setFullname("Some testperson");
person.setLastname("testperson");
@@ -162,7 +162,7 @@ public class ContextSourceAndHibernateTransactionManagerNamespaceITests extends
person = null;
log.debug("Verifying result");
Object ldapResult = this.ldapTemplate.lookup("cn=some testperson, ou=company1, ou=Sweden");
OrgPerson fromDb = (OrgPerson) this.hibernateTemplate.get(OrgPerson.class, new Integer(2));
OrgPerson fromDb = (OrgPerson) this.hibernateTemplate.get(OrgPerson.class, 2);
assertThat(ldapResult).isNotNull();
assertThat(fromDb).isNotNull();
}
@@ -170,7 +170,7 @@ public class ContextSourceAndHibernateTransactionManagerNamespaceITests extends
@Test
public void testUpdateWithException() {
String dn = "cn=Some Person,ou=company1,ou=Sweden";
OrgPerson originalPerson = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, new Integer(1));
OrgPerson originalPerson = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, 1);
originalPerson.setLastname("fooo");
try {
this.dummyDao.updateWithException(originalPerson);
@@ -190,7 +190,7 @@ public class ContextSourceAndHibernateTransactionManagerNamespaceITests extends
}
});
OrgPerson notUpdatedPerson = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, new Integer(1));
OrgPerson notUpdatedPerson = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, 1);
assertThat(notUpdatedPerson.getLastname()).isEqualTo("Person");
assertThat(notUpdatedPerson.getDescription()).isEqualTo("Sweden, Company1, Some Person");
@@ -201,7 +201,7 @@ public class ContextSourceAndHibernateTransactionManagerNamespaceITests extends
@Test
public void testUpdate() {
String dn = "cn=Some Person,ou=company1,ou=Sweden";
OrgPerson person = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, new Integer(1));
OrgPerson person = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, 1);
person.setLastname("Updated Person");
person.setDescription("Updated description");
@@ -216,7 +216,7 @@ public class ContextSourceAndHibernateTransactionManagerNamespaceITests extends
}
});
OrgPerson updatedPerson = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, new Integer(1));
OrgPerson updatedPerson = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, 1);
assertThat(updatedPerson.getLastname()).isEqualTo("Updated Person");
assertThat(updatedPerson.getDescription()).isEqualTo("Updated description");
assertThat(ldapResult).isNotNull();
@@ -226,7 +226,7 @@ public class ContextSourceAndHibernateTransactionManagerNamespaceITests extends
public void testUpdateAndRenameWithException() {
String dn = "cn=Some Person2,ou=company1,ou=Sweden";
String newDn = "cn=Some Person2,ou=company2,ou=Sweden";
OrgPerson person = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, new Integer(1));
OrgPerson person = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, 1);
person.setLastname("Updated Person");
person.setDescription("Updated description");
@@ -321,7 +321,7 @@ public class ContextSourceAndHibernateTransactionManagerNamespaceITests extends
@Test
public void testUnbindWithException() {
String dn = "cn=Some Person,ou=company1,ou=Sweden";
OrgPerson person = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, new Integer(1));
OrgPerson person = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, 1);
try {
// Perform test
@@ -341,7 +341,7 @@ public class ContextSourceAndHibernateTransactionManagerNamespaceITests extends
}
});
person = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, new Integer(1)); // will
person = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, 1); // will
// throw
// exception
// of
@@ -357,7 +357,7 @@ public class ContextSourceAndHibernateTransactionManagerNamespaceITests extends
public void testUnbind() {
String dn = "cn=Some Person,ou=company1,ou=Sweden";
// Perform test
OrgPerson person = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, new Integer(1));
OrgPerson person = (OrgPerson) this.hibernateTemplate.load(OrgPerson.class, 1);
this.dummyDao.unbind(person);
try {
@@ -369,7 +369,7 @@ public class ContextSourceAndHibernateTransactionManagerNamespaceITests extends
assertThat(true).isTrue();
}
person = (OrgPerson) this.hibernateTemplate.get(OrgPerson.class, new Integer(1));
person = (OrgPerson) this.hibernateTemplate.get(OrgPerson.class, 1);
assertThat(person).isNull();
}