forked from D-Net/dnet-hadoop
Compare commits
1 Commits
beta
...
serializeL
Author | SHA1 | Date |
---|---|---|
Alessia Bardi | 300df8b278 |
|
@ -1134,6 +1134,14 @@ public class XmlRecordFactory implements Serializable {
|
|||
.add(
|
||||
XmlSerializationUtils.mapQualifier("accessright", instance.getAccessright()));
|
||||
}
|
||||
if (instance.getLicense() != null
|
||||
&& isNotBlank(instance.getLicense().getValue())) {
|
||||
fields
|
||||
.add(
|
||||
XmlSerializationUtils
|
||||
.asXmlElement(
|
||||
"license", instance.getLicense().getValue()));
|
||||
}
|
||||
if (instance.getCollectedfrom() != null && kvNotBlank(instance.getCollectedfrom())) {
|
||||
fields
|
||||
.add(
|
||||
|
|
|
@ -7,6 +7,8 @@ import java.io.IOException;
|
|||
import java.io.StringReader;
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.constraints.AssertTrue;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentException;
|
||||
|
@ -150,6 +152,8 @@ public class XmlRecordFactoryTest {
|
|||
Dataset d = OBJECT_MAPPER
|
||||
.readValue(IOUtils.toString(getClass().getResourceAsStream("enermaps.json")), Dataset.class);
|
||||
|
||||
assertNotNull(d.getInstance().get(0).getLicense().getValue());
|
||||
|
||||
JoinedEntity je = new JoinedEntity<>(d);
|
||||
|
||||
String xml = xmlRecordFactory.build(je);
|
||||
|
|
Loading…
Reference in New Issue