@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),
sameInstance(scope));
assertThat(factory.getRegisteredScope(WebApplicationContext.SCOPE_SESSION),
sameInstance(scope));
assertThat(factory.getRegisteredScope(WebApplicationContext.SCOPE_GLOBAL_SESSION),
sameInstance(scope));
}
EmbeddedWebApplicationContextTests.java 文件源码
java
阅读 23
收藏 0
点赞 0
评论 0
项目:contestparser
作者:
评论列表
文章目录