Mocking static methods in Java without annotations

Are there JVM libraries that can mock static methods WITHOUT the need for annotations? I am trying to create this feature in a Clojure testing environment (Midje). Clojure has very poor or non-existent annotation support.

+4
source share
1 answer

Use powermock . This is a great library for ridicule. And here is an example that explains how to mock static methods.

+3
source

Source: https://habr.com/ru/post/1389615/


All Articles