Skip to content

Add @Sql equivalent support to R2DBC #27485

Closed as not planned
Closed as not planned
@yerzhant

Description

@yerzhant

@Sql annotation is from jdbc package (org.springframework.test.context.jdbc). Could you please make it more general (from jdbc & r2dbc perspective) so that one can do like this:

@DataR2dbcTest
@Sql("scripts/normalize-sheet.sql")

Right now it gives this exception:

...
java.lang.IllegalStateException: Failed to execute SQL scripts for test context [DefaultTestContext@32a13034 testClass
...
contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.event.ApplicationEventsTestExecutionListener.recordApplicationEvents' -> false]]: supply at least a DataSource or PlatformTransactionManager.

At the moment one of the workarounds is manual script execution: https://stackoverflow.com/a/64118434/4456087

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: testIssues in the test modulestatus: supersededAn issue that has been superseded by anothertype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions