jamesfredley opened a new pull request, #15348: URL: https://github.com/apache/grails-core/pull/15348
## Summary This PR significantly expands the integration test coverage in the `grails-test-examples` modules, adding approximately **426 new integration tests** across multiple Grails 7 feature areas. The total test count has grown from ~74 to **500+ tests**. ## Test Coverage Added ### Core Framework Tests (app1 module) | Category | Tests | Description | |----------|-------|-------------| | **Services** | 25 | Service injection, transactions, scoping, Spring bean integration | | **Domain Events** | 37 | GORM lifecycle events (beforeInsert, afterUpdate, etc.) | | **Constraints** | 20 | Validation constraints (nullable, blank, size, email, custom validators) | | **Content Negotiation** | 21 | Format handling via Accept headers, extensions, parameters | | **URL Mappings** | 20 | Path variables, constraints, HTTP methods, redirects | | **Spring Events** | 19 | ApplicationEvent publishing/listening, async events | | **Caching** | 20 | @Cacheable, @CacheEvict, cache manager integration | | **Async/Promises** | 20 | Promise.task, callbacks, PromiseList/Map, timeouts | | **Interceptors** | 20 | Before/after phases, matching patterns, request blocking | | **Data Binding** | 20 | Type coercion, nested objects, collections, dates | | **Codecs** | 15 | HTML, URL, Base64, JavaScript, MD5, SHA encoding | | **i18n** | 17 | Message resolution, locale switching, pluralization | | **TagLib** | 25 | Form tags, iteration, conditionals, custom tags | | **Command Object DI** | 10 | @Autowired services in command objects | | **Error Handling** | 23 | HTTP status codes (400-503), JSON error responses | | **Request/Response** | 20 | Headers, cookies, sessions, request info | | **CORS** | 16 | Preflight requests, cross-origin scenarios | | **File Upload** | 15 | Single/multiple files, validation, content processing | | **GORM Advanced** | 53 | Criteria queries, HQL, dynamic finders, relationships | ### Additional Module Tests | Module | Tests | Description | |--------|-------|-------------| | **gorm** | ~45 | Criteria queries, cascade operations, data services, scaffolding | | **gsp-layout** | 15 | GSP layout tags, g:layoutHead/Body/Title | | **micronaut** | 10 | Micronaut bean integration, qualifiers | | **async-events-pubsub-demo** | 8 | Publisher/subscriber patterns | | **scaffolding-fields** (new) | 30 | Fields plugin CRUD, custom templates, validation | ## Technical Details ### Test Patterns Used All tests follow Grails 7 best practices: - `@Integration(applicationClass = Application)` for integration context - `@Rollback` for transaction management - Micronaut HTTP client for endpoint testing - Spock 2.3 `given/when/then` blocks ### Key Dependencies - Spock 2.3-groovy-4.0 - Micronaut HTTP Client - Geb (for functional tests requiring browser) ## Files Changed - **New Controllers**: 20+ test controllers across feature areas - **New Domains**: 15+ domain classes for testing - **New Services**: 12+ services for integration testing - **New Specs**: 25+ Spock specification files - **New Views**: 50+ GSP views for TagLib testing - **settings.gradle**: Added scaffolding-fields module ## Testing All 500+ tests pass locally: ``` 648 tests completed, 1 failed ``` The single failure is a pre-existing Geb container test (`RedirectWithAndWithoutParamsFunctionalSpec`) that requires a container runtime - not related to this PR. ## Commits This PR is organized into 12 logical commits: 1. Service layer integration tests 2. Domain events and validation constraints tests 3. Content negotiation and URL mappings tests 4. Spring events and caching integration tests 5. Async/promises and interceptor integration tests 6. Data binding, codecs, and i18n integration tests 7. TagLib and command object DI integration tests 8. HTTP error handling, request/response, CORS, and file upload tests 9. Advanced GORM integration tests and scaffolding module 10. GSP layout taglib and Micronaut integration tests 11. Async events integration tests to pubsub demo 12. GORM advanced query and relationship tests to app1 -- 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]
