Skip to content

MicronautTest could support NOT starting @Scheduled methods #1235

@sdedic

Description

@sdedic

Feature description

During a @MicronautTest run, a controlled fixture of certain beans and mocks is created to test a specific bean, but the all classpath-reachable beans are defined, and all reachable @Scheduled methods are potentially executed, even though their bean (e.g.) @Singleton is not referenced from the test's beans closure.

This complicates fixture creation (e.g. missing dependencies, ....) , sometimes the bean must be scheduled in other way than @Scheduled annotation because of this.

Micronaut Test infrastructure could support disabling or postponing start of the scheduled code until after e.g. some micronaut test API call that releases the schedulers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: improvementA minor improvement to an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions