Assert.assertEquals(xml, "<message from=\"from@domain\" id=\"id\" to=\"to@domain\" type=\"chat\"><body xml:lang=\"de\">body</body><body xml:lang=\"fr\">body2</body></message>");
}
@Test
public void marshalMessageSubject() throws JAXBException, XMLStreamException {
Message message = new Message(new Jid("to", "domain"), Message.Type.CHAT);
message.setId("id");
message.setFrom(new Jid("from", "domain"));
message.getSubjects().add(new AbstractMessage.Subject("subject1", "de"));
AbstractMessage.Subject subject2 = new AbstractMessage.Subject("subject2");
subject2.setLanguage("fr");
message.getSubjects().add(subject2);
String xml = marshal(message);
Assert.assertEquals(xml, "<message from=\"from@domain\" id=\"id\" to=\"to@domain\" type=\"chat\"><subject xml:lang=\"de\">subject1</subject><subject xml:lang=\"fr\">subject2</subject></message>");
}