HttpContextFactoryTest.java 文件源码

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

项目:motech 作者:
@Test
public void shouldCreateFileSystemAwareUiHttpContext() {
    HttpContext httpContext = mock(HttpContext.class);
    PowerMockito.mockStatic(ApplicationEnvironment.class);

    MockBundle bundle = new MockBundle("org.motechproject.com-sms-api-bundle");

    when(ApplicationEnvironment.isInDevelopmentMode()).thenReturn(true);
    when(ApplicationEnvironment.getModulePath(new BundleName("org.motechproject.com-sms-api-bundle"))).thenReturn("/Users/s/project/motech/modules/sms/src/main/resources");

    FileSystemAwareUIHttpContext fileSystemAwareUIHttpContext = (FileSystemAwareUIHttpContext) HttpContextFactory.getHttpContext(httpContext, bundle);
    assertThat(fileSystemAwareUIHttpContext, IsNot.not(notNull()));

    assertThat(fileSystemAwareUIHttpContext.getResourceRootDirectoryPath(), Is.is("/Users/s/project/motech/modules/sms/src/main/resources"));
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号