use of org.jboss.resteasy.plugins.server.servlet.ListenerBootstrap in project resteasy by resteasy.
the class ContextParameterInjectionTest method createProxy.
private Object createProxy() {
ServletContext mockServletContext = mock(ServletContext.class);
when(mockServletContext.getAttribute(ResteasyDeployment.class.getName())).thenReturn(null);
ConfigurationBootstrap configBootstrap = new ListenerBootstrap(mockServletContext);
ResteasyContext.pushContext(ResteasyDeployment.class, configBootstrap.createDeployment());
try {
final Class<ContainerRequestFilter> filterClass = ContainerRequestFilter.class;
final ContainerRequestFilter coolInstance = new CoolFilter();
ResteasyProviderFactory mockFactory = mock(ResteasyProviderFactory.class);
when(mockFactory.getContextData(filterClass, filterClass, null, false)).thenReturn(coolInstance);
ResteasyProviderFactory.setInstance(mockFactory);
ContextParameterInjector cpi = new ContextParameterInjector(null, filterClass, filterClass, null, mockFactory);
return cpi.createProxy();
} finally {
ResteasyContext.removeContextDataLevel();
}
}
use of org.jboss.resteasy.plugins.server.servlet.ListenerBootstrap in project brave by openzipkin.
the class TracingBootstrap method contextInitialized.
@Override
public void contextInitialized(ServletContextEvent event) {
ServletContext servletContext = event.getServletContext();
ListenerBootstrap config = new ListenerBootstrap(servletContext);
servletContext.setAttribute(ResteasyDeployment.class.getName(), deployment);
deployment.getDefaultContextObjects().put(ResteasyConfiguration.class, config);
config.createDeployment();
deployment.start();
}
use of org.jboss.resteasy.plugins.server.servlet.ListenerBootstrap in project scm-manager by scm-manager.
the class ResteasyAllInOneServletDispatcher method createDeployment.
private ResteasyDeployment createDeployment(ServletContext servletContext) {
ListenerBootstrap config = new ListenerBootstrap(servletContext);
ResteasyDeployment deployment = config.createDeployment();
deployment.start();
servletContext.setAttribute(ResteasyDeployment.class.getName(), deployment);
return deployment;
}
Aggregations