grails.gorm.tests.NullValueEqualSpec.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grails-datastore-gorm-tck Show documentation
Show all versions of grails-datastore-gorm-tck Show documentation
GORM - Grails Data Access Framework
package grails.gorm.tests
class NullValueEqualSpec extends GormDatastoreSpec {
void "test null value in equal and not equal"() {
when:
new TestEntity(name:"Fred", age: null).save(failOnError: true)
new TestEntity(name:"Bob", age: 11).save(failOnError: true)
new TestEntity(name:"Jack", age: null).save(flush:true, failOnError: true)
then:
TestEntity.countByAge(11) == 1
TestEntity.findAllByAge(null).size() == 2
TestEntity.countByAge(null) == 2
TestEntity.countByAgeNotEqual(11) == 2
TestEntity.countByAgeNotEqual(null) == 1
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy