Skip to content

AspectJ around aspect called twice when using a Mockito Spy #24046

Open
@cdalexndr

Description

@cdalexndr

Spring Boot 2.2.0.RELEASE

Using @Async returning a Future cannot be canceled if the @Async method is called from a @SpyBean.

From debugging, it seems the @Async aspect is called twice, first before mockito handling method call then after Mockito calls method so the returned Future is invalid.

Sample project: https://github.com/cdalexndr/spring-boot-issue-18771

Just run gradlew test

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions