Raise JUnit coverage asdctool
[sdc.git] / asdctool / src / test / java / org / openecomp / sdc / asdctool / impl / validator / executers / ArtifactValidatorExecuterTest.java
1 package org.openecomp.sdc.asdctool.impl.validator.executers;
2
3 import java.util.HashMap;
4 import java.util.LinkedList;
5 import java.util.List;
6 import java.util.Map;
7
8 import org.junit.Test;
9 import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum;
10 import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum;
11 import org.openecomp.sdc.be.model.Component;
12 import org.openecomp.sdc.be.model.Resource;
13
14 public class ArtifactValidatorExecuterTest {
15
16         private ArtifactValidatorExecuter createTestSubject() {
17                 return new ArtifactValidatorExecuter();
18         }
19
20         @Test
21         public void testGetName() throws Exception {
22                 ArtifactValidatorExecuter testSubject;
23                 String result;
24
25                 // default test
26                 testSubject = createTestSubject();
27                 result = testSubject.getName();
28         }
29
30         @Test(expected=NullPointerException.class)
31         public void testGetVerticesToValidate() throws Exception {
32                 ArtifactValidatorExecuter testSubject;
33                 VertexTypeEnum type = null;
34                 Map<GraphPropertyEnum, Object> hasProps = null;
35
36                 // default test
37                 testSubject = createTestSubject();
38                 testSubject.getVerticesToValidate(type, hasProps);
39         }
40
41         @Test
42         public void testSetName() throws Exception {
43                 ArtifactValidatorExecuter testSubject;
44                 String name = "";
45
46                 // default test
47                 testSubject = createTestSubject();
48                 testSubject.setName(name);
49         }
50
51         @Test(expected=NullPointerException.class)
52         public void testValidate() throws Exception {
53                 ArtifactValidatorExecuter testSubject;
54                 Map<String, List<Component>> vertices = new HashMap<>();
55                 LinkedList<Component> linkedList = new LinkedList<Component>();
56                 linkedList.add(new Resource());
57                 vertices.put("stam", linkedList);
58                 boolean result;
59
60                 // default test
61                 testSubject = createTestSubject();
62                 result = testSubject.validate(vertices);
63         }
64 }