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

Mock method invocation expected 1 invocation, actual 2 invocations #59

Open
MosheElisha opened this issue Mar 27, 2021 · 3 comments
Open

Comments

@MosheElisha
Copy link

After upgrading from pitest-junit5-plugin 0.10 to 0.11, a unit test started failing.
The same problem occurs in 0.14 as well.

java.lang.AssertionError:
  Unexpected method
3:00:41 PM PIT >> INFO : MINION : call PrometheusScrapeEndpoint.scrape([]):
    PrometheusScrapeEndpoint.scrape(<any>): expected: 1, actual: 2

EasyMock expected that PrometheusScrapeEndpoint.scrape(<any>) will be invoked only once but it was invoked twice.
When I execute maven with -DskipPitest, all tests pass successfully.

The following ZIP contains maven output with verbose=true for

mvn.pitest-junit5-plugin-0.10.out - pass
mvn.pitest-junit5-plugin-0.11.out - fail
mvn.pitest-junit5-plugin-0.14.out - fail

mvn-out.zip

pitest-maven = 1.6.2
junit-jupiter-api = 5.7.1

@hcoles
Copy link
Contributor

hcoles commented Mar 27, 2021

If you can put together a minimal project that reproduces the issue, I can take a look.

@MosheElisha
Copy link
Author

Thanks, @hcoles ! I'll try to create a minimal project.

@MosheElisha
Copy link
Author

Hi @hcoles ,

I have created a small project that reproduces the issue. With pitest-junit5-plugin=0.10 the command mvn clean install works fine. With 0.11 and 0.14 the command fails on the basis of a failed test.

Failed to execute goal org.pitest:pitest-maven:1.6.2:mutationCoverage (default) on project pitest-junit5-plugin-issue-59: Execution default of goal org.pitest:pitest-maven:1.6.2:mutationCoverage failed: 1 tests did not pass without mutation when calculating line coverage. Mutation testing requires a green suite.

Can you please take a look?

pitest-junit5-plugin-issue-59.zip

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

No branches or pull requests

2 participants