How can I mock static methods in Java 1.4?

I am using JUnit with Mockito. PowerMock can mock static methods, but it is not possible to use it with Java 1.4, especially because it needs annotations.

Is there any other alternative?

Thank.

+3
source share
3 answers

(Self-promotion here) There is a PowerMock-Legacy project that allows you to use PowerMock in Java 1.4. It is a little detailed, and not all features are supported, but may be worth a try.

+1
source

mocks. , , unit test. , . , , , , , .

, , , .

+1

jMockit , ( ?). Mockito

Mockito , , . ()

, , .

0

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


All Articles