HibernateProxyInitializer initializer = new HibernateProxyInitializer();
XStreamBuilder builder = XStreamBuilderImpl.cleanInstance(new MessageConverter());
XStreamJSONSerialization jsonSerialization = new XStreamJSONSerialization(response, extractor, initializer, builder);
XStreamXMLSerialization xmlSerialization = new XStreamXMLSerialization(response, extractor, initializer, builder);
Container container = mock(Container.class);
when(container.instanceFor(JSONSerialization.class)).thenReturn(jsonSerialization);
when(container.instanceFor(XMLSerialization.class)).thenReturn(xmlSerialization);
MockLocalization mockLocalization = new MockLocalization(new SingletonResourceBundle("message.cat", "Just another {0} in {1}"));
serialization = new I18nMessageSerialization(container , mockLocalization);