Your clerkReviewPackageHelper
mock doesn't seem to be associated with your call to executeProcess
in any way. It's not passed in, and it doesn't seem to be returned, directly or indirectly, from any method calls on any mocks that are passed in to executeProcess
. It therefore hardly seems reasonable to expect one of its methods to get called by executeProcess
.
What you need to do is look through the call to executeProcess
and find the object, if any, on which addSubmissionQueue
is called. Without seeing the code for executeProcess
, I can't really offer assistance with this. It may be but there is no such method call, as @JeffBowman has conjectured in his answer. But there are also other possibilities.
- If the object on which
addSubmissionQueue
is called is one of the parameters to executeProcess
, then you should use clerkReviewPackageHelper
as the corresponding argument in the test.
- If the object on which
addSubmissionQueue
is called is an a field in the one of the parameters to the executeProcess
, then inject clerkReviewPackageHelper
, either in the constructor of crFilingToQueuesAction
, or a setter, or even with @InjectMocks
.
- If the object on which
addSubmissionQueue
is called is obtained from a method call on one of the other parameters to executeProcess
, then you need to make that call return clerkReviewPackageHelper
. This might mean injecting that value into some object, or it might mean stubbing a method call on a mock. For example, if the method that you're testing obtains clerkReviewPackageHelper
by calling a line like crFilingToQueuesForm.getHelper()
, then you need to write when(crFilingToQueuesForm.getHelper()).thenReturn(clerkReviewPackageHelper);
or something similar. It may turn out to be more complex than this of course. I can't tell without seeing your code.
If you need more help, then please post the code of your executeProcess
method.