I am very new to Mockito framework and got blocked in the following scenario. I have two classes A and B
Class A{
public HttpServletRequest getHttpReq() {
return httpReq;
}
}
Class B extends A{
public void prepare() throws Exception{
HttpSession session = getHttpReq().getSession();
}
}
I am trying to mock the prepare() in the test class. Tried different ways and none of them works. Could anyone please help me out in how to mock getHttpReq().getSession() in the test class. Thanks in advance