Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-mocking Uni does not work in continuous testing, failing tests that work in normal testing #23109

Closed
famod opened this issue Jan 22, 2022 · 2 comments · Fixed by #23112
Closed
Labels
Milestone

Comments

@famod
Copy link
Member

famod commented Jan 22, 2022

Describe the bug

For normal testing (e.g. via surefire), MutiniyAnswer is auto-registered via a custom configuration, so that you don't have to stub e.g. ReactiveMailer.send(Mail) on your own.

In continuous testing though, this configuration is not present/found so that a test that is running fine via surefire will fail with an NPE in continuous testing.

Expected behavior

Same behavior as normal testing; auto-mocking takes place.

Actual behavior

Auto-mocking Uni doesn't work in cont' testing, a NPE will pop up failing the test.

How to Reproduce?

q_ct-mutinyanswer.zip

  1. mvn clean verify (all tests should pass)
  2. mvn clean quarkustest (all tests should fail)

This reproducer contains three slightly different tests to show that this is a general problem also affecting QuarkusTest.

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.6.3.Final, 2.7.0.CR1 and current 999-SNAPSHOT

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

Maven 3.8.4

Additional information

https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/mockito.2Einternal.2EMutinyAnswer

This is probably related to how org.mockito.internal.configuration.ClassPathLoader is loading such a custom config and to #7872.

@famod famod added the kind/bug Something isn't working label Jan 22, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Jan 22, 2022

/cc @stuartwdouglas

@famod
Copy link
Member Author

famod commented Jan 22, 2022

I have a fix for this, leveraging parent-first. It's not pretty but let's see what you say when I have created the PR (today or tomorrow).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants