Skip to content

Add support of @Sql in tests of @ApplicationModuleListener #1443

@yerzhant

Description

@yerzhant

Could you please add support of sql scripts in tests of module listeners (org.springframework.modulith.events.ApplicationModuleListener)?

I. e. this:

    @Test
    @Sql("classpath:sql/some-inserts.sql", "classpath:sql/file-abcd.sql")

do inserts rows in one transaction, but this:

    @ApplicationModuleListener
    fun on(event: SomeCoolStuffHappened) {

creates a new txn and does not see inserts from @Sql. W/o this support one need to mock a bunch of stuff.

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions