The GitHub Actions job "CI" on 
grails-core.git/feat/testing-bean-registrar-8.0.x has succeeded.
Run started by GitHub user codeconsole (triggered by codeconsole).

Head commit for run:
a3c673ec88feccbb55b5dad1fccd30fe13aa07ba / Scott Murphy Heiberg 
<[email protected]>
Compile a unit test's beans block without an annotation

A beans property on an Application class or a plugin descriptor is compiled
by convention, but a test had to wrap its block in a nested
@GrailsBeans @Configuration class. Annotating the test itself cannot work:
Spring would construct an instance of its own to call the @Bean methods,
outside Spock, where field initializers such as a Mock() cannot run.

A class implementing org.grails.testing.GrailsUnitTest - as every Grails
testing trait does - now gets the convention too. Its beans compile onto a
generated static nested @Configuration(proxyBeanMethods = false) class named
BeansConfiguration, the shape a group(...) already compiles to, and the
testing support registers it like any other nested configuration class, so
a base spec's block applies to the specs that extend it. The trait is matched
by name, so the beans DSL still does not depend on the testing support. A
test that already declares a BeansConfiguration class is reported.

Spock moves a specification's field initializers into a generated method
before this runs. The closure is taken back from the field = value statement
that assigns the beans field - found by the field it assigns, not by Spock's
method name - where the block would otherwise have been found empty and
skipped without a word.

Report URL: https://github.com/apache/grails-core/actions/runs/36102517262

With regards,
GitHub Actions via GitBox

Reply via email to