org.jboss.resteasy.mock.MockDispatcherFactory Maven / Gradle / Ivy
The newest version!
package org.jboss.resteasy.mock;
import org.jboss.resteasy.core.Dispatcher;
import org.jboss.resteasy.core.SynchronousDispatcher;
import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
import org.jboss.resteasy.spi.ResteasyProviderFactory;
/**
* Creates a mock Dispatcher that you can invoke on locally
*
* @author Bill Burke
* @version $Revision: 1 $
*/
public class MockDispatcherFactory
{
public static Dispatcher createDispatcher()
{
Dispatcher dispatcher = new SynchronousDispatcher(new ResteasyProviderFactory());
ResteasyProviderFactory.setInstance(dispatcher.getProviderFactory());
RegisterBuiltin.register(dispatcher.getProviderFactory());
return dispatcher;
}
}