@Test
public void portletReturnsMainViewAndApplicationSessionContainsNonvalidatedUserInfo() throws Exception {
Map<String,String> userInfoMap = new HashMap<String, String>();
userInfoMap.put("librarynumber", "TestingA");
userInfoMap.put("sn", "Testing");
PortletMvcResult result = existingApplicationContext(applicationContext).build()
.perform(new CustomMockRenderRequestBuilder().attribute(PortletRequest.USER_INFO,userInfoMap))
.andExpect(view().name("main"))
.andExpect(session().exists())
.andExpect(session().hasAttribute(UserInfo.SESSION_ATTR))
.andReturn();
UserInfo userInfo = (UserInfo) result.getRequest().getPortletSession(false).getAttribute(UserInfo.SESSION_ATTR,PortletSession.APPLICATION_SCOPE);
assertFalse(userInfo.isValidated());
}
PortletIntegrationTest.java 文件源码
java
阅读 17
收藏 0
点赞 0
评论 0
项目:AlmaPortlet
作者:
评论列表
文章目录