1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.openehealth.ipf.commons.xml;
17
18 import org.junit.Before;
19 import org.junit.Test;
20
21 import javax.xml.transform.Source;
22 import javax.xml.transform.stream.StreamSource;
23 import java.io.IOException;
24
25 import static org.junit.Assert.assertNotNull;
26
27
28
29
30 public class XsltTransmogrifierTest {
31
32 private XsltTransmogrifier<String> transformer;
33
34 @Before
35 public void setUp() throws Exception {
36 transformer = new XsltTransmogrifier<>(String.class);
37 }
38
39 @Test
40 public void testConvertString() throws IOException {
41 Source source = new StreamSource(getClass().getResourceAsStream("/xslt/createPatient.xml"));
42 String result = transformer.zap(source, "/xslt/createPatient.xslt");
43 assertNotNull(result);
44 }
45
46 }