Closed
Description
Description
Concrete Executor wrongly mocks static methods from different classes but with same signatures.
To Reproduce
Steps to reproduce the behavior:
public class AlsoRandom {
public static int next() {
return -42;
}
public static int foo() {
return 1;
}
}
public class Random {
public static int next() {
return 42;
}
public static int foo() {
return 0;
}
}
public class RandomUsage {
public static int usage() {
int value = Random.next();
int a = Random.foo();
int b = AlsoRandom.foo();
if (value > 50) {
return a + b;
}
return AlsoRandom.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.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done