*
* @return the data service servlet
*/
public static DataServiceServlet getDataServiceServlet(Injector injector) {
// Set data service servlet again to use JPA guice dependencies
DataServiceServlet servlet = new DataServiceServlet();
HandlerRegistry registry = injector.getInstance(HandlerRegistry.class);
registry.addHandlers(
ImmutableSet.<Object>of(ActivityHandler.class, AppDataHandler.class,
PersonHandler.class, MessageHandler.class));
servlet.setHandlerRegistry(registry);
servlet.setBeanConverters(new BeanJsonConverter(injector),
new BeanXStreamConverter(new XStream081Configuration(injector)),
new BeanXStreamAtomConverter(new XStream081Configuration(injector)));
ContainerConfig containerConfig = EasyMock.createMock(ContainerConfig.class);
EasyMock.expect(containerConfig.<String>getList(null, "gadgets.parentOrigins")).andReturn(Collections.<String>singletonList("*")).anyTimes();
EasyMock.replay(containerConfig);
servlet.setContainerConfig(containerConfig);
servlet.setJSONPAllowed(true);
return servlet;
}