mockActionInvocation.getAction();
EasyMock.expectLastCall().andReturn(action);
EasyMock.expectLastCall().anyTimes();
mockActionInvocation.getResult();
EasyMock.expectLastCall().andReturn(new ServletActionRedirectResult());
EasyMock.replay(mockActionInvocation);
interceptor.init();
interceptor.intercept(mockActionInvocation);
interceptor.destroy();
assertEquals(3, sessionMap.size());
assertTrue(sessionMap.containsKey(MessageStoreInterceptor.actionErrorsSessionKey));
assertTrue(sessionMap.containsKey(MessageStoreInterceptor.actionMessagesSessionKey));
assertTrue(sessionMap.containsKey(MessageStoreInterceptor.fieldErrorsSessionKey));
List actionErrors = (List) sessionMap.get(MessageStoreInterceptor.actionErrorsSessionKey);
List actionMessages = (List) sessionMap.get(MessageStoreInterceptor.actionMessagesSessionKey);
Map fieldErrors = (Map) sessionMap.get(MessageStoreInterceptor.fieldErrorsSessionKey);
assertEquals(2, actionErrors.size());
assertEquals(2, actionMessages.size());
assertEquals(2, fieldErrors.size());
assertTrue(actionErrors.contains("some action error 1"));
assertTrue(actionErrors.contains("some action error 2"));
assertTrue(actionMessages.contains("some action message 1"));
assertTrue(actionMessages.contains("some action message 2"));
assertTrue(fieldErrors.containsKey("field1"));
assertTrue(fieldErrors.containsKey("field2"));
assertEquals(((List)fieldErrors.get("field1")).size(), 1);
assertEquals(((List)fieldErrors.get("field2")).size(), 1);
assertEquals(((List)fieldErrors.get("field1")).get(0), "some field error 1");
assertEquals(((List)fieldErrors.get("field2")).get(0), "some field error 2");
EasyMock.verify(mockActionInvocation);
action = new ActionSupport();
mockActionInvocation = EasyMock.createControl().createMock(ActionInvocation.class);
mockActionInvocation.invoke();
EasyMock.expectLastCall().andReturn(Action.SUCCESS);
sessionMap.put(MessageStoreInterceptor.actionErrorsSessionKey, actionErrors);
sessionMap.put(MessageStoreInterceptor.actionMessagesSessionKey, actionMessages);
sessionMap.put(MessageStoreInterceptor.fieldErrorsSessionKey, fieldErrors);
actionContext = new ActionContext(new HashMap());
actionContext.put(ActionContext.PARAMETERS, paramMap);
actionContext.put(ActionContext.SESSION, sessionMap);
mockActionInvocation.getInvocationContext();
EasyMock.expectLastCall().andReturn(actionContext);
EasyMock.expectLastCall().anyTimes();
mockActionInvocation.getAction();
EasyMock.expectLastCall().andReturn(action);
EasyMock.expectLastCall().anyTimes();
mockActionInvocation.getResult();
EasyMock.expectLastCall().andReturn(new ServletActionRedirectResult());
EasyMock.replay(mockActionInvocation);
interceptor.init();
interceptor.intercept(mockActionInvocation);