use of org.jbpm.services.task.impl.model.xml.JaxbI18NText in project jbpm by kiegroup.
the class AbstractTaskSerializationTest method jaxbI18NTextTest.
@Test
public void jaxbI18NTextTest() throws Exception {
Assume.assumeFalse(getType().equals(TestType.YAML));
I18NTextImpl textImpl = new I18NTextImpl();
textImpl.setId(1605l);
textImpl.setLanguage("es-ES");
textImpl.setText("Quixote");
JaxbI18NText jaxbText = new JaxbI18NText(textImpl);
assertEquals("id", textImpl.getId(), jaxbText.getId());
assertEquals("language", textImpl.getLanguage(), jaxbText.getLanguage());
assertEquals("text", textImpl.getText(), jaxbText.getText());
JaxbI18NText copyJaxbText = testRoundTrip(jaxbText);
Assertions.assertThat(jaxbText).isEqualToComparingFieldByFieldRecursively(copyJaxbText);
List<I18NText> intList = new ArrayList<I18NText>();
intList.add(textImpl);
List<JaxbI18NText> jaxbList = JaxbI18NText.convertListFromInterfaceToJaxbImpl(intList, I18NText.class, JaxbI18NText.class);
jaxbText = jaxbList.get(0);
assertEquals("id", textImpl.getId(), jaxbText.getId());
assertEquals("language", textImpl.getLanguage(), jaxbText.getLanguage());
assertEquals("text", textImpl.getText(), jaxbText.getText());
intList = JaxbI18NText.convertListFromJaxbImplToInterface(jaxbList);
I18NText text = intList.get(0);
assertEquals("id", text.getId(), jaxbText.getId());
assertEquals("language", text.getLanguage(), jaxbText.getLanguage());
assertEquals("text", text.getText(), jaxbText.getText());
}
Aggregations