PortletUtilsTests.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:spring4-understanding 作者:
public void testGetRealPathInterpretsLocationAsRelativeToWebAppRootIfPathDoesNotBeginWithALeadingSlash() throws Exception {
    final String originalPath = "web/foo";
    final String expectedRealPath = "/" + originalPath;
    PortletContext ctx = mock(PortletContext.class);
    given(ctx.getRealPath(expectedRealPath)).willReturn(expectedRealPath);

    String actualRealPath = PortletUtils.getRealPath(ctx, originalPath);
    assertEquals(expectedRealPath, actualRealPath);

    verify(ctx);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号