use of org.springframework.web.context.ServletContextAware in project spring-security by spring-projects.
the class AutowireBeanFactoryObjectPostProcessorTests method postProcessWhenServletContextAwareThenAwareInvoked.
@Test
public void postProcessWhenServletContextAwareThenAwareInvoked() {
this.spring.register(Config.class).autowire();
ServletContextAware toPostProcess = mock(ServletContextAware.class);
this.objectObjectPostProcessor.postProcess(toPostProcess);
verify(toPostProcess).setServletContext(isNotNull());
}
use of org.springframework.web.context.ServletContextAware in project spring-boot by spring-projects.
the class ServletWebServerApplicationContextTests method servletContextAwareBeansAreInjected.
@Test
void servletContextAwareBeansAreInjected() {
addWebServerFactoryBean();
ServletContextAware bean = mock(ServletContextAware.class);
this.context.registerBeanDefinition("bean", beanDefinition(bean));
this.context.refresh();
then(bean).should().setServletContext(getWebServerFactory().getServletContext());
}
Aggregations