本文整理汇总了Java中org.springframework.boot.context.embedded.MockEmbeddedServletContainerFactory类的典型用法代码示例。如果您正苦于以下问题:Java MockEmbeddedServletContainerFactory类的具体用法?Java MockEmbeddedServletContainerFactory怎么用?Java MockEmbeddedServletContainerFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MockEmbeddedServletContainerFactory类属于org.springframework.boot.context.embedded包,在下文中一共展示了MockEmbeddedServletContainerFactory类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testFilterOrdering
import org.springframework.boot.context.embedded.MockEmbeddedServletContainerFactory; //导入依赖的package包/类
@Test
public void testFilterOrdering() {
load();
List<RegisteredFilter> registeredFilters = this.context
.getBean(MockEmbeddedServletContainerFactory.class).getContainer()
.getRegisteredFilters();
List<Filter> filters = new ArrayList<Filter>(registeredFilters.size());
for (RegisteredFilter registeredFilter : registeredFilters) {
filters.add(registeredFilter.getFilter());
}
Iterator<Filter> iterator = filters.iterator();
assertThat(iterator.next()).isInstanceOf(OrderedCharacterEncodingFilter.class);
assertThat(iterator.next()).isInstanceOf(SessionRepositoryFilter.class);
assertThat(iterator.next()).isInstanceOf(Filter.class);
assertThat(iterator.next()).isInstanceOf(Filter.class);
assertThat(iterator.next()).isInstanceOf(OrderedRequestContextFilter.class);
assertThat(iterator.next()).isInstanceOf(FilterChainProxy.class);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:19,代码来源:FilterOrderingIntegrationTests.java
示例2: loadWeb
import org.springframework.boot.context.embedded.MockEmbeddedServletContainerFactory; //导入依赖的package包/类
private void loadWeb(Class<?>... config) {
AnnotationConfigEmbeddedWebApplicationContext context = new AnnotationConfigEmbeddedWebApplicationContext();
if (config.length > 0) {
context.register(config);
}
context.register(DataSourcePoolMetadataProvidersConfiguration.class,
CacheStatisticsAutoConfiguration.class,
PublicMetricsAutoConfiguration.class,
MockEmbeddedServletContainerFactory.class);
context.refresh();
this.context = context;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:13,代码来源:PublicMetricsAutoConfigurationTests.java
示例3: verifyContext
import org.springframework.boot.context.embedded.MockEmbeddedServletContainerFactory; //导入依赖的package包/类
private void verifyContext() {
MockEmbeddedServletContainerFactory containerFactory = getContainerFactory();
Servlet servlet = this.context.getBean(
DispatcherServletAutoConfiguration.DEFAULT_DISPATCHER_SERVLET_BEAN_NAME,
Servlet.class);
verify(containerFactory.getServletContext()).addServlet("dispatcherServlet",
servlet);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:EmbeddedServletContainerAutoConfigurationTests.java
示例4: postProcessBeforeInitialization
import org.springframework.boot.context.embedded.MockEmbeddedServletContainerFactory; //导入依赖的package包/类
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName)
throws BeansException {
if (bean instanceof ConfigurableEmbeddedServletContainer) {
MockEmbeddedServletContainerFactory containerFactory = (MockEmbeddedServletContainerFactory) bean;
assertThat(containerFactory.getServletContext()).isNull();
}
return bean;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:10,代码来源:EmbeddedServletContainerAutoConfigurationTests.java
示例5: postProcessBeforeInitialization
import org.springframework.boot.context.embedded.MockEmbeddedServletContainerFactory; //导入依赖的package包/类
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName)
throws BeansException {
if (bean instanceof ConfigurableEmbeddedServletContainer) {
MockEmbeddedServletContainerFactory containerFactory = (MockEmbeddedServletContainerFactory) bean;
assertNull(containerFactory.getServletContext());
}
return bean;
}
开发者ID:Nephilim84,项目名称:contestparser,代码行数:10,代码来源:EmbeddedServletContainerAutoConfigurationTests.java
示例6: containerFactory
import org.springframework.boot.context.embedded.MockEmbeddedServletContainerFactory; //导入依赖的package包/类
@Bean
public EmbeddedServletContainerFactory containerFactory() {
return new MockEmbeddedServletContainerFactory();
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:5,代码来源:ExampleEmbeddedWebApplicationConfiguration.java
示例7: containerFactory
import org.springframework.boot.context.embedded.MockEmbeddedServletContainerFactory; //导入依赖的package包/类
@Bean
public MockEmbeddedServletContainerFactory containerFactory() {
return new MockEmbeddedServletContainerFactory();
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:5,代码来源:FilterOrderingIntegrationTests.java
示例8: embeddedServletContainerFactory
import org.springframework.boot.context.embedded.MockEmbeddedServletContainerFactory; //导入依赖的package包/类
@Bean
public MockEmbeddedServletContainerFactory embeddedServletContainerFactory() {
return new MockEmbeddedServletContainerFactory();
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:5,代码来源:WelcomePageMockMvcTests.java
示例9: getContainerFactory
import org.springframework.boot.context.embedded.MockEmbeddedServletContainerFactory; //导入依赖的package包/类
private MockEmbeddedServletContainerFactory getContainerFactory() {
return this.context.getBean(MockEmbeddedServletContainerFactory.class);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:4,代码来源:EmbeddedServletContainerAutoConfigurationTests.java