If you search setReturnValueAt, it is introduced as DJUnit code, not JUnit.Is DJUnit syntax acceptable? I don't think jUnit alone provides Mock.
If DJUnit is, first of all, the development of DJUnit has already stopped, and it is not easy to follow Java 7 or later specifications.This kind of library will be affected when Java 8 changes the specifications, so I've been urged to deal with it, but I don't think so either.
Currently, it is common to use Mockito.
動作I am afraid that I will not be able to use the test code when I change the specifications of Java in the future, so I will be suspicious of collecting the cost of creating the test code.
Also, as Yukihane said, the setReturnValueAt method does not need to exist in the mocking target code.
(There is no point in separating the test target from the test code.)
© 2024 OneMinuteCode. All rights reserved.