How do I verify that a protected method in a parent class is run?
<p>I am trying to capture a response string for a child controller class when the method that sends the response exists in the parent class. </p>

<p>I have tried mocking the parent class and verifying that the method gets called but since the method is referenced in class the verify is not picking up the that the messaging method is being called. How can I verify that this method is called so I can capture the response content?</p>

<p>This is an abstract version of my code but it explains the situation I believe.</p>

<pre><code>public class AbstractController {
    public void handleRequest(HttpServletResponse response, 
         String forward, HttpMethod method, MessageRequest request){
        //the method process request then sends response back using this
        sendJsonResponse(response,HttpStatus.CREATED,messageResponse);
    }

    protected  sendJsonResponse(HttpServletResponse response, HttpStatus status, String msg){
        //send the message 
    }
}

public class StartController extends AbstractController {
    public void start(String arg1, String arg2, String arg3, HttpSevletResponse response){
        handleRequest(reponse,"actor1",HttpMethod.POST,new MessageRequest(arg1,arg2,arg3));
    }
}

public class TestStartController{
    // several mocked services declared here
    @Test
    public void testStart(){

        String expectResult = "some string";

        when(mockservc.sendMessageDeeper(~)).thenReturn("raw response"); 

        ArgumentCaptor&lt;String&gt; bodyCaptor = ArgumentCaptor.forClass(String.class);

        StartController sc = new StartController(); 

        sc.start(anyString(),anyString(),anyString,(),responseMock);

        verify(mockServc).sendMessageDeeper(~);

        //this is the method that I need to make sure runs since the method below is 
        //statically reference it is not registering being executed by the verify need help here             
        verify(abstractControllerMock).sendJsonReponse(same(responeMock),eq(HttpStatus.CREATED),bodyCaptor.capture()); 

        assertJsonEquals(expectResult,bodyCaptor.getValue());
    }
}
</code></pre>