Skip to content

Cannot mock/spy class error, after adding quarkus-junit5-mockito dependency #37927

@ennishol

Description

@ennishol

Describe the bug

After adding quarkus-junit5-mockito dependency, tests start to fail with Cannot mock/spy class error

Expected behavior

Test should work

Actual behavior

Tests fail

How to Reproduce?

con-testing.tar.gz

  1. Run ./mvnw quarkus:dev and press r to start testing
  2. Tests are failing
  3. When quarkus-junit5-mockito is removed with the test using @InjectMock, the failing tests become green

Output of uname -a or ver

No response

Output of java -version

openjdk version "21.0.1" 2023-10-17 LTS Corretto-21.0.1.12.1 (build 21.0.1+12-LTS)

Quarkus version or git rev

5.6.4

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.6

Additional information

No response

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