I'm very new to Junit.
I'm writing junit for a interceptor.. It contains SessionMap in that.. while calling the interceptor from the test class I'm getting Null pointer exception at Session Map.
Below is my interceptor..
public String intercept(ActionInvocation actionInv) throws Exception {
    ActionContext context = actionInv.getInvocationContext();
    final HttpServletRequest request = (HttpServletRequest) context.get(ServletActionContext.HTTP_REQUEST);
    String callerAppName = request.getParameter(CustomerPortalConstants.CALLER);
    if(callerAppName == null){
        //caller name is passed in header in case of OnePortal service request
        callerAppName = request.getHeader(CustomerPortalConstants.CALLER);
    }
    SessionMap<String,Object> sessionMap = ((SessionMap<String,Object>)ActionContext.getContext().getSession());
    @SuppressWarnings("unchecked")
    Map<String,AccountBean> accountsMap = (Map<String,AccountBean>)sessionMap.get(CustomerPortalConstants.ACCOUNTSMAP);;
     if(accountsMap == null) {
        accountsMap = new HashMap<String, AccountBean>();
        sessionMap.put(CustomerPortalConstants.ACCOUNTSMAP, accountsMap);
    }
Im getting error at this location
((SessionMap)ActionContext.getContext().getSession());
This is my Test class..
public class MultiAccountInterceptorTest extends StrutsTestCase implements SessionAware  {
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    private Map<String,AccountBean> accountsMap=new HashMap<String, AccountBean>();
    Map<String, Object> sessionMap;
    private String callerAppName="LMP";
    private final HttpServletRequest mockHttpReq = createMock(HttpServletRequest.class);
    MultiAccountInterceptor interceptor = new MultiAccountInterceptor();
    @SuppressWarnings("unchecked")
    @Before
    public void setUp() throws Exception {
         sessionMap = new HashMap<String, Object>();
    }
    @SuppressWarnings("unchecked")
    @Test
    public void testIntercept() throws Exception
    {
        MultiAccountInterceptor mockInterceptor = PowerMock.createNicePartialMockForAllMethodsExcept(MultiAccountInterceptor.class, "intercept");
        final ActionInvocation mockInvocation = createMock(ActionInvocation.class);
        final ActionContext mockContext = createMock(ActionContext.class);
        expect(mockInvocation.getInvocationContext()).andReturn(mockContext);
        System.out.println(mockContext);
        expect( (HttpServletRequest)mockContext.get(ServletActionContext.HTTP_REQUEST)).andReturn(mockHttpReq);
        System.out.println(mockHttpReq);
        expect(mockHttpReq.getParameter(CustomerPortalConstants.CALLER)).andReturn(callerAppName);
        System.out.println("Caller app name is"+ callerAppName);
        System.out.println(sessionMap);
        sessionMap.put(CustomerPortalConstants.ACCOUNTSMAP, accountsMap);
        System.out.println(sessionMap);
        replayAll();
     mockInterceptor.intercept(mockInvocation);
    }
    @Override
    public void setSession(Map<String, Object> sessionMap) {
        this.sessionMap=sessionMap;
    }
}
Can anyone provide me a solution for this problem.. Thanks in advance..