Skip to content

Add support for @Spy annotation #1269

@anuragagarwal561994

Description

@anuragagarwal561994

Feature description

Mockito provides a @Spy annotation, sometimes one needs to verify if on the injected instance of the bean if a specific method is being called.

For example, if I have setup a @PreDestroy hook and I want to verify in my test case that it is working and my instance is a concrete instance, I can't verify if the method was called unless I use @Spy on it.

In test environment we should add a BeanCreatedEventListener to add spy over all the beans created which were annotated with @Spy or some similar control would be helpful.

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