billgonemad opened a new issue, #14436:
URL: https://github.com/apache/grails-core/issues/14436

   ### Background
   Have an existing app that I am trying to upgrade from 2.5 to 4.0.  I have a 
similar kind of domain structure as in my example.  
   
   ### Steps to reproduce
   
   1. Create a new app with the following classes
   
   
   ```
    class Face {
   
       static hasOne = [mouth: Mouth]
   
       static constraints = {
       }
    }
   
    abstract class Mouth {
       Face face
   
       static constraints = {
       }
    }
   
    class BigMouth extends Mouth {
       Integer numberOfTeeth
       Boolean tonsilsRemoved
   
    }
   ```
   2. Add the test case
   
   ```
   import grails.testing.gorm.DomainUnitTest
   import spock.lang.Specification
   
   class FaceSpec extends Specification implements DomainUnitTest<Face> {
   
       def setup() {
       }
   
       def cleanup() {
       }
   
       void "test hasOneValidation"() {
           when:
           domain.mouth = new BigMouth(numberOfTeeth: null)
   
           then:
           !domain.validate()
       }
   }
   ```
   
   ### Expected Behavior
   Test case should pass since the validation should fail on BigMouth 
properties.
   
   ### Actual Behavior
   Properties on BigMouth are not being validated when validation is called on 
a Face object.  Test case is failing.
   
   ### Environment Information
   Winodws 10
   Oracle JDK 11
   Grails 4.0.3
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to