blob: a21c7c854188658c52cdd4dd5e1d174fe9738b03 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
package org.zwobble.mammoth.tests.docx;
import org.junit.Test;
import org.zwobble.mammoth.internal.docx.Relationships;
import org.zwobble.mammoth.internal.xml.XmlElement;
import static org.junit.Assert.assertEquals;
import static org.zwobble.mammoth.internal.docx.RelationshipsXml.readRelationshipsXmlElement;
import static org.zwobble.mammoth.internal.util.MammothLists.list;
import static org.zwobble.mammoth.internal.util.MammothMaps.map;
import static org.zwobble.mammoth.internal.xml.XmlNodes.element;
public class RelationshipsXmlTests {
@Test
public void targetIsReadFromRelationshipElement() {
XmlElement element = element("relationship:Relationships", list(
element("relationships:Relationship", map(
"Id", "rId8",
"Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",
"Target", "http://example.com"))));
Relationships relationships = readRelationshipsXmlElement(element);
assertEquals("http://example.com", relationships.findRelationshipById("rId8").getTarget());
}
}
|