Add test cases to increase coverage
[aai/sparky-be.git] / sparkybe-onap-service / src / test / java / org / onap / aai / sparky / viewandinspect / entity / GizmoEntityTest.java
1 package org.onap.aai.sparky.viewandinspect.entity;
2
3
4 import static org.junit.Assert.assertNotNull;
5 import static org.junit.Assert.assertNull;
6
7 import java.util.HashMap;
8 import java.util.Map;
9
10 import org.junit.Before;
11 import org.junit.Test;
12
13 public class GizmoEntityTest {
14
15   private GizmoEntity gizmoEntity;
16   private Map<String, String> props;
17   private GizmoRelationshipHint[] gizmoRelationshipHintArr;
18
19
20
21   @Before
22   public void init() throws Exception {
23
24     gizmoEntity = new GizmoEntity();
25     props = new HashMap<String, String>();
26   }
27
28   @Test
29   public void updateValues() {
30
31
32     gizmoEntity.setId("1664646");
33     assertNotNull(gizmoEntity.getId());
34     gizmoEntity.setType("pserver");
35     assertNotNull(gizmoEntity.getType());
36     gizmoEntity.setUrl("https://magicaltest.com:6666/v2/tenant-id/servers/vserver-id");
37     assertNotNull(gizmoEntity.getUrl());
38     gizmoEntity.setProperties(props);
39     assertNotNull(gizmoEntity.getProperties());
40     gizmoEntity.setIn(gizmoRelationshipHintArr);
41     assertNull(gizmoEntity.getIn());
42     gizmoEntity.setOut(gizmoRelationshipHintArr);
43     assertNull(gizmoEntity.getOut());
44     assertNotNull(gizmoEntity.toString());
45
46
47     gizmoEntity.setId(null);
48     assertNull(gizmoEntity.getId());
49     gizmoEntity.setType(null);
50     assertNull(gizmoEntity.getType());
51     gizmoEntity.setUrl(null);
52     assertNull(gizmoEntity.getUrl());
53     gizmoEntity.setProperties(null);
54     assertNull(gizmoEntity.getProperties());
55     gizmoEntity.setIn(null);
56     assertNull(gizmoEntity.getIn());
57     gizmoEntity.setOut(null);
58     assertNull(gizmoEntity.getOut());
59     assertNotNull(gizmoEntity.toString());
60
61   }
62 }