Skip to content

How to disable Datasource on certain @MicronautTest-annotated test? #2855

@Nahuel92

Description

@Nahuel92

Issue description

Hi there.

I'm using Micronaut Data in my application, but I would like to disable the Datasource for certain tests I have annotated with @MicronautTest. I haven't seen anything like that in the docs, where the suggested approach is to use a DB such as H2.

In my particular case, what I'm testing right now doesn't use the DB at all, but it still requires it if I want to use the Micronaut context to use its real dependencies (which, in turn, are not DB-related).

I would like to achieve something similar to test slices that can be achieved with Spring Boot so that I can use a context but without a DB (for certain tests).

Is that even possible?
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions