re base code
[sdc.git] / catalog-dao / src / test / java / org / openecomp / sdc / be / dao / jsongraph / GraphVertexTest.java
1 package org.openecomp.sdc.be.dao.jsongraph;
2
3 import com.thinkaurelius.titan.core.TitanVertex;
4 import org.junit.Test;
5 import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum;
6 import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
7 import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum;
8 import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
9 import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
10
11 import java.util.HashMap;
12 import java.util.Map;
13
14
15 public class GraphVertexTest {
16
17         private GraphVertex createTestSubject() {
18                 return new GraphVertex();
19         }
20         
21         @Test
22         public void testCtor() throws Exception {
23                 new GraphVertex(VertexTypeEnum.ADDITIONAL_INFORMATION);
24         }
25         
26         @Test
27         public void testGetUniqueId() throws Exception {
28                 GraphVertex testSubject;
29                 String result;
30
31                 // default test
32                 testSubject = createTestSubject();
33                 result = testSubject.getUniqueId();
34         }
35
36         
37         @Test
38         public void testSetUniqueId() throws Exception {
39                 GraphVertex testSubject;
40                 String uniqueId = "";
41
42                 // default test
43                 testSubject = createTestSubject();
44                 testSubject.setUniqueId(uniqueId);
45         }
46
47         
48         @Test
49         public void testGetJson() throws Exception {
50                 GraphVertex testSubject;
51                 Map<String, ? extends ToscaDataDefinition> result;
52
53                 // default test
54                 testSubject = createTestSubject();
55                 result = testSubject.getJson();
56         }
57
58         
59         @Test
60         public void testSetJson() throws Exception {
61                 GraphVertex testSubject;
62                 Map<String, ? extends ToscaDataDefinition> json = null;
63
64                 // default test
65                 testSubject = createTestSubject();
66                 testSubject.setJson(json);
67         }
68
69         
70         @Test
71         public void testGetVertex() throws Exception {
72                 GraphVertex testSubject;
73                 TitanVertex result;
74
75                 // default test
76                 testSubject = createTestSubject();
77                 result = testSubject.getVertex();
78         }
79
80         
81         @Test
82         public void testSetVertex() throws Exception {
83                 GraphVertex testSubject;
84                 TitanVertex vertex = null;
85
86                 // default test
87                 testSubject = createTestSubject();
88                 testSubject.setVertex(vertex);
89         }
90
91         
92         @Test
93         public void testGetLabel() throws Exception {
94                 GraphVertex testSubject;
95                 VertexTypeEnum result;
96
97                 // default test
98                 testSubject = createTestSubject();
99                 result = testSubject.getLabel();
100         }
101
102         
103         @Test
104         public void testSetLabel() throws Exception {
105                 GraphVertex testSubject;
106                 VertexTypeEnum label = null;
107
108                 // default test
109                 testSubject = createTestSubject();
110                 testSubject.setLabel(label);
111         }
112
113         
114         
115         @Test
116         public void testAddMetadataProperty() throws Exception {
117                 GraphVertex testSubject;
118                 GraphPropertyEnum propName = null;
119                 Object propValue = null;
120
121                 // test 1
122                 testSubject = createTestSubject();
123                 propValue = null;
124                 testSubject.addMetadataProperty(propName, propValue);
125         }
126
127         
128         @Test
129         public void testGetMetadataProperty() throws Exception {
130                 GraphVertex testSubject;
131                 GraphPropertyEnum metadataProperty = null;
132                 Object result;
133
134                 // default test
135                 testSubject = createTestSubject();
136                 result = testSubject.getMetadataProperty(metadataProperty);
137         }
138
139         
140         @Test
141         public void testGetMetadataProperties() throws Exception {
142                 GraphVertex testSubject;
143                 Map<GraphPropertyEnum, Object> result;
144
145                 // default test
146                 testSubject = createTestSubject();
147                 result = testSubject.getMetadataProperties();
148         }
149
150         
151         @Test
152         public void testSetMetadataProperties() throws Exception {
153                 GraphVertex testSubject;
154                 Map<GraphPropertyEnum, Object> metadataProperties = null;
155
156                 // default test
157                 testSubject = createTestSubject();
158                 testSubject.setMetadataProperties(metadataProperties);
159         }
160
161         
162         @Test
163         public void testGetMetadataJson() throws Exception {
164                 GraphVertex testSubject;
165                 Map<String, Object> result;
166
167                 // default test
168                 testSubject = createTestSubject();
169                 result = testSubject.getMetadataJson();
170         }
171
172         
173         @Test
174         public void testSetMetadataJson() throws Exception {
175                 GraphVertex testSubject;
176                 Map<String, Object> metadataJson = null;
177
178                 // default test
179                 testSubject = createTestSubject();
180                 testSubject.setMetadataJson(metadataJson);
181         }
182
183         
184
185         
186         @Test
187         public void testGetJsonMetadataField() throws Exception {
188                 GraphVertex testSubject;
189                 Object result;
190
191                 // default test
192                 testSubject = createTestSubject();
193                 result = testSubject.getJsonMetadataField(JsonPresentationFields.API_URL);
194                 testSubject = createTestSubject();
195                 testSubject.setType(ComponentTypeEnum.RESOURCE);
196                 result = testSubject.getJsonMetadataField(JsonPresentationFields.API_URL);
197         }
198
199         
200         @Test
201         public void testUpdateMetadataJsonWithCurrentMetadataProperties() throws Exception {
202                 GraphVertex testSubject;
203
204                 // default test
205                 testSubject = createTestSubject();
206                 testSubject.updateMetadataJsonWithCurrentMetadataProperties();
207                 Map<GraphPropertyEnum, Object> metadataProperties = new HashMap<>();
208                 metadataProperties.put(GraphPropertyEnum.COMPONENT_TYPE, "mock");
209                 testSubject.setMetadataProperties(metadataProperties );
210                 testSubject.updateMetadataJsonWithCurrentMetadataProperties();
211         }
212         
213         @Test
214         public void testGetType() throws Exception {
215                 GraphVertex testSubject;
216
217                 // default test
218                 testSubject = createTestSubject();
219                 testSubject.setType(ComponentTypeEnum.RESOURCE);
220                 testSubject.getType();
221         }
222         
223         @Test
224         public void testCloneData() throws Exception {
225                 GraphVertex testSubject;
226
227                 // default test
228                 testSubject = createTestSubject();
229                 testSubject.cloneData(new GraphVertex());
230         }
231         
232         @Test
233         public void testSetJsonMetadataField() throws Exception {
234                 GraphVertex testSubject;
235
236                 // default test
237                 testSubject = createTestSubject();
238                 testSubject.setJsonMetadataField(JsonPresentationFields.API_URL, "mock");
239         }
240
241 }