jdaugherty opened a new pull request, #16466: URL: https://github.com/apache/grails-core/pull/16466
Domain unit tests ignored `grails.gorm.default.nullable`. The `DataTest` setup built its constraint evaluator without the configured default, so mocked domains were always nullable by default, even when the application sets `grails.gorm.default.nullable: false`. Plugins that read the evaluated constraints in unit tests were affected too. For example, build-test-data skipped required associations and later failed with "No constraints found". ### Changes - The `DataTest` evaluator now reads the nullable default from the application config, the same way the running application builds it. - New specs check both settings through `validate()` and `save()`. They cover unconstrained properties, an unconstrained association, explicit `nullable` overrides, and command objects, which stay required in both cases. - The 8.0 upgrade guide now says unit tests read the setting from `application.yml` or `application.groovy`, and shows how a spec sets it with `doWithConfig`. ### Verification - `:grails-testing-support-datamapping:test` passes. - With the fix reverted, `RequiredByDefaultSpec` fails. - `codeStyle`, `validateRepositoryConventions`, and `rat` are clean. -- 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]
