DeviceDelegatingViewResolverAutoConfigurationTests.java 文件源码

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

项目:contestparser 作者:
@Test(expected = NoSuchBeanDefinitionException.class)
public void deviceDelegatingInternalResourceViewResolverDisabled() throws Exception {
    this.context = new AnnotationConfigEmbeddedWebApplicationContext();
    EnvironmentTestUtils.addEnvironment(this.context,
            "spring.mobile.devicedelegatingviewresolver.enabled:false");
    this.context.register(Config.class, WebMvcAutoConfiguration.class,
            HttpMessageConvertersAutoConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class,
            DeviceDelegatingViewResolverConfiguration.class);
    this.context.refresh();
    assertNotNull(this.context.getBean(InternalResourceViewResolver.class));
    try {
        this.context.getBean(ThymeleafViewResolver.class);
    }
    catch (NoSuchBeanDefinitionException ex) {
        // expected. ThymeleafViewResolver shouldn't be defined.
    }
    this.context.getBean("deviceDelegatingViewResolver",
            AbstractDeviceDelegatingViewResolver.class);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号