EmbeddedWebApplicationContextTests.java 文件源码

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

项目:spring-boot-concourse 作者:
@Test
public void doesNotReplaceExistingScopes() throws Exception { // gh-2082
    Scope scope = mock(Scope.class);
    ConfigurableListableBeanFactory factory = this.context.getBeanFactory();
    factory.registerScope(WebApplicationContext.SCOPE_REQUEST, scope);
    factory.registerScope(WebApplicationContext.SCOPE_SESSION, scope);
    factory.registerScope(WebApplicationContext.SCOPE_GLOBAL_SESSION, scope);
    addEmbeddedServletContainerFactoryBean();
    this.context.refresh();
    assertThat(factory.getRegisteredScope(WebApplicationContext.SCOPE_REQUEST))
            .isSameAs(scope);
    assertThat(factory.getRegisteredScope(WebApplicationContext.SCOPE_SESSION))
            .isSameAs(scope);
    assertThat(factory.getRegisteredScope(WebApplicationContext.SCOPE_GLOBAL_SESSION))
            .isSameAs(scope);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号