1
|
package eu.dnetlib.data.bulktag;
|
2
|
|
3
|
import org.apache.commons.io.IOUtils;
|
4
|
import org.apache.commons.lang3.StringUtils;
|
5
|
import org.dom4j.DocumentException;
|
6
|
import org.junit.Before;
|
7
|
import org.junit.Test;
|
8
|
|
9
|
import java.io.IOException;
|
10
|
|
11
|
import static org.junit.Assert.assertEquals;
|
12
|
import static org.junit.Assert.assertTrue;
|
13
|
|
14
|
/**
|
15
|
* Created by miriam on 03/08/2018.
|
16
|
*/
|
17
|
public class CommunityConfigurationFactoryTest {
|
18
|
|
19
|
private String xml;
|
20
|
|
21
|
@Before
|
22
|
public void setUp() throws IOException, DocumentException {
|
23
|
xml = IOUtils.toString(getClass().getResourceAsStream("community_configuration.xml"));
|
24
|
}
|
25
|
|
26
|
@Test
|
27
|
public void parseTest() throws DocumentException {
|
28
|
|
29
|
final CommunityConfiguration cc = CommunityConfigurationFactory.newInstance(xml);
|
30
|
assertEquals(5,cc.size());
|
31
|
cc.getCommunityList().forEach(c -> assertTrue(StringUtils.isNoneBlank(c.getId())));
|
32
|
|
33
|
|
34
|
}
|
35
|
}
|