You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#12311 introduced support for declarative SQL script execution via the @Sql annotation in the Spring TestContext Framework (TCF). @Sql provides attributes for configuring the syntax of the referenced SQL scripts as well as exception handling and transaction behavior.
Early feedback from developers has shown that although this level of configuration (i.e., at the @Sql annotation level) is useful, it is often times a burden on the developer to declare the exact same configuration for each test method within a test class or test class hierarchy. It would therefore be very beneficial to be able to declare common, shared SQL configuration across a test class hierarchy.
Deliverables
Introduce a class-level annotation for declaring common SQL script configuration -- for example, @SqlConfig
Common configuration must be able to be overridden via method-level @Sql configuration.
Avoid unnecessary duplication of code and documentation by replacing existing configuration attributes in @Sql with a single config attribute of type @SqlConfig.
Furthermore, all attributes of @SqlConfig must be either of type String or custom enums in order to support overriding. Empty values would therefore imply use of a default or inherited value.
Sam Brannen opened SPR-11896 and commented
Status Quo
#12311 introduced support for declarative SQL script execution via the
@Sqlannotation in the Spring TestContext Framework (TCF).@Sqlprovides attributes for configuring the syntax of the referenced SQL scripts as well as exception handling and transaction behavior.Early feedback from developers has shown that although this level of configuration (i.e., at the
@Sqlannotation level) is useful, it is often times a burden on the developer to declare the exact same configuration for each test method within a test class or test class hierarchy. It would therefore be very beneficial to be able to declare common, shared SQL configuration across a test class hierarchy.Deliverables
@SqlConfig@Sqlconfiguration.@Sqlwith a singleconfigattribute of type@SqlConfig.@SqlConfigmust be either of typeStringor custom enums in order to support overriding. Empty values would therefore imply use of a default or inherited value.Affects: 4.1 RC1
Issue Links:
@Sqlscript support in the reference manual ("is depended on by")@Sql