Description
Concrete Executor wrongly mocks static methods from different classes but with same signatures.
To Reproduce
Steps to reproduce the behavior:
publicclassAlsoRandom {
publicstaticintnext() {
return -42;
}
publicstaticintfoo() {
return1;
}
}
publicclassRandom {
publicstaticintnext() {
return42;
}
publicstaticintfoo() {
return0;
}
}
publicclassRandomUsage {
publicstaticintusage() {
intvalue = Random.next();
inta = Random.foo();
intb = AlsoRandom.foo();
if (value > 50) {
returna + b;
}
returnAlsoRandom.next() - value;
}
}- Write some classes described above in new java project in IntelliJ Idea
- Use plugin to generate tests
- Run the generated test
Expected behavior
Tests are passed.
Actual behavior
Tests are failed.
Environment
Mocking static methods from another class.
Description
Concrete Executor wrongly mocks static methods from different classes but with same signatures.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Tests are passed.
Actual behavior
Tests are failed.
Environment
Mocking static methods from another class.