@Test public void stringPropertyUpdateXmlSaveLoad() throws PropertyValidationException, JAXBException { String value = RandomStringUtils.randomAlphabetic(20); StringProperty stringProperty = new StringProperty("name", "description", "logical-name", "balbla", false, false); AbstractPropertyUpdate<String> stringPropertyUpdate = stringProperty.createAndValidatePropertyUpdate(value); JAXBContext context = JAXBContext.newInstance(StringPropertyUpdate.class); Marshaller marshaller = context.createMarshaller(); Unmarshaller unmarshaller = context.createUnmarshaller(); marshaller.marshal(stringPropertyUpdate, f); Object object = unmarshaller.unmarshal(f); assertThat(object, is(instanceOf(StringPropertyUpdate.class))); StringPropertyUpdate unmarsalled = (StringPropertyUpdate) object; assertThat(stringProperty.canUpdate(unmarsalled), is(true)); stringProperty.setValue(unmarsalled.getUpdateValue()); assertThat(stringProperty.getValue(), is(value)); }