Raise JUnit coverage asdctool
[sdc.git] / asdctool / src / test / java / org / openecomp / sdc / asdctool / impl / ArtifactUuidFixTest.java
1 package org.openecomp.sdc.asdctool.impl;
2
3 import java.util.List;
4 import java.util.Map;
5
6 import org.junit.Assert;
7 import org.junit.Test;
8 import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum;
9 import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum;
10 import org.openecomp.sdc.be.model.Component;
11
12 public class ArtifactUuidFixTest {
13
14         private ArtifactUuidFix createTestSubject() {
15                 return new ArtifactUuidFix();
16         }
17
18         @Test(expected=NullPointerException.class)
19         public void testDoFix() throws Exception {
20                 ArtifactUuidFix testSubject;
21                 String fixComponent = "";
22                 String runMode = "";
23                 boolean result;
24
25                 // test 1
26                 testSubject = createTestSubject();
27                 fixComponent = "vf_only";
28                 result = testSubject.doFix(fixComponent, runMode);
29                 Assert.assertEquals(false, result);
30
31                 // test 2
32                 testSubject = createTestSubject();
33                 runMode = "service_vf";
34                 result = testSubject.doFix(fixComponent, runMode);
35                 Assert.assertEquals(false, result);
36
37                 // test 3
38                 testSubject = createTestSubject();
39                 runMode = "fix";
40                 result = testSubject.doFix(fixComponent, runMode);
41                 Assert.assertEquals(false, result);
42
43                 // test 4
44                 testSubject = createTestSubject();
45                 runMode = "fix";
46                 result = testSubject.doFix(fixComponent, runMode);
47                 Assert.assertEquals(false, result);
48
49                 // test 5
50                 testSubject = createTestSubject();
51                 runMode = "fix_only_services";
52                 result = testSubject.doFix(fixComponent, runMode);
53                 Assert.assertEquals(false, result);
54         }
55
56         @Test
57         public void testDoFixTosca() throws Exception {
58                 ArtifactUuidFix testSubject;
59                 Map<String, List<Component>> nodeToFix = null;
60                 Map<String, List<Component>> vfToFix = null;
61                 Map<String, List<Component>> serviceToFix = null;
62                 boolean result;
63
64                 // default test
65                 testSubject = createTestSubject();
66         }
67
68         @Test(expected=NullPointerException.class)
69         public void testGetVerticesToValidate() throws Exception {
70                 ArtifactUuidFix testSubject;
71                 VertexTypeEnum type = null;
72                 Map<GraphPropertyEnum, Object> hasProps = null;
73                 Map<String, List<Component>> result;
74
75                 // default test
76                 testSubject = createTestSubject();
77                 result = testSubject.getVerticesToValidate(type, hasProps);
78         }
79
80         @Test(expected=NullPointerException.class)
81         public void testValidateTosca() throws Exception {
82                 ArtifactUuidFix testSubject;
83                 Map<String, List<Component>> vertices = null;
84                 Map<String, List<Component>> compToFix = null;
85                 String name = "";
86                 boolean result;
87
88                 // default test
89                 testSubject = createTestSubject();
90                 result = testSubject.validateTosca(vertices, compToFix, name);
91         }
92 }