More codenarc fixes

This commit is contained in:
Will Gittoes 2019-03-01 13:53:51 +11:00
parent ffa140f444
commit 9e3fda549d
No known key found for this signature in database
GPG Key ID: 521026A02DB0BB42
2 changed files with 4 additions and 4 deletions

View File

@ -12,7 +12,7 @@ class CriteriaTest extends AbstractHibernateTest {
setup: setup:
Session session = sessionFactory.openSession() Session session = sessionFactory.openSession()
session.beginTransaction() session.beginTransaction()
Criteria criteria = session.createCriteria(Value.class) Criteria criteria = session.createCriteria(Value)
.add(Restrictions.like("name", "Hello")) .add(Restrictions.like("name", "Hello"))
.addOrder(Order.desc("name")) .addOrder(Order.desc("name"))
interaction.call(criteria) interaction.call(criteria)

View File

@ -15,7 +15,7 @@ class SessionTest extends AbstractHibernateTest {
def setupSpec() { def setupSpec() {
// Test two different types of Session. Groovy doesn't allow testing the cross-product/combinations of two data // Test two different types of Session. Groovy doesn't allow testing the cross-product/combinations of two data
// tables, so we get this hack instead. // tables, so we get this hack instead.
sessionBuilders = new HashMap<>(); sessionBuilders = new HashMap<>()
sessionBuilders.put("Session", { return sessionFactory.openSession() }) sessionBuilders.put("Session", { return sessionFactory.openSession() })
sessionBuilders.put("StatelessSession", { return sessionFactory.openStatelessSession() }) sessionBuilders.put("StatelessSession", { return sessionFactory.openStatelessSession() })
} }
@ -373,7 +373,7 @@ class SessionTest extends AbstractHibernateTest {
Session session = sessionFactory.openSession() Session session = sessionFactory.openSession()
session.beginTransaction() session.beginTransaction()
Query query = queryBuildMethod(session) Query query = queryBuildMethod(session)
List result = query.list() query.list()
session.getTransaction().commit() session.getTransaction().commit()
session.close() session.close()
@ -457,7 +457,7 @@ class SessionTest extends AbstractHibernateTest {
session1.close() session1.close()
session3.close() session3.close()
scope.close(); scope.close()
expect: expect: