@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);
}
EmbeddedWebApplicationContextTests.java 文件源码
java
阅读 25
收藏 0
点赞 0
评论 0
项目:https-github.com-g0t4-jenkins2-course-spring-boot
作者:
评论列表
文章目录