use of com.mockobjects.constraint.IsAnything in project struts by apache.
the class SessionMapTest method testPutObjectOnSessionMapUsesWrappedSessionsSetsAttributeWithStringValue.
public void testPutObjectOnSessionMapUsesWrappedSessionsSetsAttributeWithStringValue() throws Exception {
Object key = new Object();
Object value = new Object();
sessionMock.expect("getAttribute", new Constraint[] { new IsAnything() });
sessionMock.expect("setAttribute", new Constraint[] { new IsEqual(key.toString()), new IsEqual(value) });
SessionMap sessionMap = new SessionMap((HttpServletRequest) requestMock.proxy());
sessionMap.put(key, value);
sessionMock.verify();
}
use of com.mockobjects.constraint.IsAnything in project struts by apache.
the class SessionMapTest method testPutOnSessionMapUsesWrappedSessionsSetsAttribute.
public void testPutOnSessionMapUsesWrappedSessionsSetsAttribute() throws Exception {
Object value = new Object();
sessionMock.expect("getAttribute", new Constraint[] { new IsAnything() });
sessionMock.expect("setAttribute", new Constraint[] { new IsEqual("KEY"), new IsEqual(value) });
SessionMap sessionMap = new SessionMap((HttpServletRequest) requestMock.proxy());
sessionMap.put("KEY", value);
sessionMock.verify();
}
Aggregations