@Test
public void shouldSerializeErrorMessages() throws Exception {

	Message normal = new ValidationMessage("The message", "category");
	I18nMessage i18ned = new I18nMessage("category", "message");
	i18ned.setBundle(new SingletonResourceBundle("message", "Something else"));
	
	MockSerializationResult result = new MockSerializationResult(XStreamBuilderImpl.cleanInstance(new MessageConverter()));
	DefaultStatus status = new DefaultStatus(response, result, config, new JavassistProxifier(new ObjenesisInstanceCreator()), router);
	
	status.badRequest(Lists.newArrayList(normal, i18ned));
	
	String serialized = result.serializedResult();
	assertThat(serialized, containsString("<message>The message</message>"));
	assertThat(serialized, containsString("<category>category</category>"));
	assertThat(serialized, containsString("<message>Something else</message>"));
	assertThat(serialized, not(containsString("<validationMessage>")));
	assertThat(serialized, not(containsString("<i18nMessage>")));
}