@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

Comment From: mp911de

@sbrannen is that something worth considering in spring-test?

Comment From: sbrannen

@sbrannen is that something worth considering in spring-test?

Yes, I think so.

And as you pointed out, spring-projects/spring-data-r2dbc#313 is related.