Closed
Description
Description
Without mockito-inline force mocked statics generate NPE in runtime.
To Reproduce
Steps to reproduce the behavior:
Example:
- Open any project in IDEA
- Create such class:
import java.util.Random;
public class Rand {
public boolean rand(int a) {
Random r = new Random();
return r.nextInt() > a;
}
}
- Generate tests with "No static mocking"
Expected behavior
Tests are generated and run without errors.
Actual behavior
NPE is generated for tests where mock statics are forced.
Visual proofs (screenshots, logs, images)
Environment
Not suitable.
Additional context
This case should be treated exactly like force mocking case.
Metadata
Metadata
Assignees
Labels
No labels