A bad system design can lead to much hard work. In order to increase the unit tests coverage, I recently started to work on writing unit tests for some classes. One of the case is I want to test a method as follow:
1 | public final ReturnType getMethod (SomeRequest someRequest) { |
The main purpose of this test is testing the process with someValue
, so I should just mock the .getValue()
method. But the thing is not that easy. Let me put more related classes here:
SomeService.class
1 | public final class SomeService { |
SomeResponse.class
1 | public class SomeResponse { |
SomeValue.class
1 | public class SomeValue { |