blob: e60f634050b5fbdd609a10cd5f5b498f701496de (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
package org.onap.aai.sparky.viewandinspect.entity;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import org.junit.Before;
import org.junit.Test;
import org.onap.aai.sparky.viewandinspect.EntityTypeAggregation;
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
public class GraphMetaTest {
private GraphMeta graphMeta;
private EntityTypeAggregation entitySummary;
private com.fasterxml.jackson.databind.JsonNode aaiEntityNodeDescriptors;
@Before
public void init() throws Exception {
graphMeta = new GraphMeta();
entitySummary = new EntityTypeAggregation();
aaiEntityNodeDescriptors = JsonNodeFactory.instance.objectNode();
}
@Test
public void updateValues() {
graphMeta.setEntitySummary(entitySummary);
assertNotNull(graphMeta.getEntitySummary());
graphMeta.setAaiEntityNodeDescriptors(aaiEntityNodeDescriptors);
assertNotNull(graphMeta.getAaiEntityNodeDescriptors());
graphMeta.setNumNodes(25);
assertEquals(25,graphMeta.getNumNodes());
graphMeta.setNumLinks(3);
assertEquals(3,graphMeta.getNumLinks());
graphMeta.setRenderTimeInMs(25);
assertEquals(25,graphMeta.getRenderTimeInMs());
assertNotNull(graphMeta.toString());
graphMeta.setEntitySummary(null);
assertNull(graphMeta.getEntitySummary());
graphMeta.setAaiEntityNodeDescriptors(null);
assertNull(graphMeta.getAaiEntityNodeDescriptors());
assertNotNull(graphMeta.toString());
}
}
|