Skip to content

Mockito @Captor property null on @WebMvc test after migrating from Spring Boot 3 to 4-M3 #47281

@springframeworkguru

Description

@springframeworkguru

I'm migrating a project from Spring Boot 3, to 4.0.0.M3 with an existing test class using @WebMvc which has an Mockito argument captor as:

@Captor
ArgumentCaptor<UUID> uuidArgumentCaptor;

Under Spring Boot 4, the captor is not initialized. Work around is to annotate the test class with @ExtendWith(MockitoExtension.class)

Unexpected behavior, not sure if this is a bug, or intentional change?

Example here

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions