Mockito: is it possible to combine mock with a method name to create a methodCall inside a when() call?
问题 my first question on StackOverflow. I'd like to be able to do something like: SomeClass mock = mock(SomeClass.class); String methodName = "someMethod"; OR Method method = ...someMethod... Both of these things (the mock and the method) would combine to do the following: when(mock.someMethod()).thenReturn(null); Of course, the 'null' value will be changed accordingly for my needs, but I am trying to determine two things: 1) Is it even possible to do something like this in Java? This = combining