Adding UI extensibility
[aai/sparky-be.git] / src / test / java / org / onap / aai / sparky / viewandinspect / entity / NodeMetaTest.java
1 /**
2  * ============LICENSE_START===================================================
3  * SPARKY (AAI UI service)
4  * ============================================================================
5  * Copyright © 2017 AT&T Intellectual Property.
6  * Copyright © 2017 Amdocs
7  * All rights reserved.
8  * ============================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  * ============LICENSE_END=====================================================
21  *
22  * ECOMP and OpenECOMP are trademarks
23  * and service marks of AT&T Intellectual Property.
24  */
25
26 package org.onap.aai.sparky.viewandinspect.entity;
27
28 import static org.junit.Assert.assertEquals;
29 import static org.junit.Assert.assertNotNull;
30 import static org.junit.Assert.assertTrue;
31
32 import org.junit.Before;
33 import org.junit.Test;
34 import org.onap.aai.sparky.viewandinspect.config.VisualizationConfigs;
35 import org.onap.aai.sparky.viewandinspect.enumeration.NodeProcessingState;
36
37 public class NodeMetaTest {
38
39   private NodeMeta nodeMeta;
40   private NodeProcessingState nodeProcessingState;
41   private NodeDebug nodeDebug;
42   private VisualizationConfigs visualizationConfigs;
43
44   @Before
45   public void init() throws Exception {
46     nodeMeta = new NodeMeta(new VisualizationConfigs());
47     nodeDebug = new NodeDebug();
48
49   }
50
51   @Test
52   public void updateValues() {
53
54     nodeMeta.setAtMaxDepth(true);
55     assertTrue(nodeMeta.isAtMaxDepth());
56     nodeMeta.setSelfLinkResolved(true);
57     assertTrue(nodeMeta.isSelfLinkResolved());
58     nodeMeta.setProcessingState(nodeProcessingState.READY);
59     assertNotNull(nodeMeta.getProcessingState());
60     nodeMeta.setProcessingErrorOccurred(true);
61     assertTrue(nodeMeta.isProcessingErrorOccurred());
62     nodeMeta.setHasNeighbors(true);
63     assertTrue(nodeMeta.isHasNeighbors());
64     nodeMeta.setNeighborsProcessed(true);
65     assertTrue(nodeMeta.isNeighborsProcessed());
66     nodeMeta.setNodeDepth(3);
67     assertEquals(3, nodeMeta.getNodeDepth());
68     nodeMeta.setNodeDebug(nodeDebug);
69     assertNotNull(nodeMeta.getNodeDebug());
70     nodeMeta.setClassName("generalNodeClass");
71     assertNotNull(nodeMeta.getClassName());
72     nodeMeta.setNumInboundNeighbors(34);
73     assertEquals(34, nodeMeta.getNumInboundNeighbors());
74     nodeMeta.setNumOutboundNeighbors(43);
75     assertEquals(43, nodeMeta.getNumOutboundNeighbors());
76     nodeMeta.setSelfLinkResponseTimeInMs(43);
77     assertEquals(43, nodeMeta.getSelfLinkResponseTimeInMs());
78     nodeMeta.setNodeIssue(true);
79     assertTrue(nodeMeta.isNodeIssue());
80     nodeMeta.setNodeValidated(true);
81     assertTrue(nodeMeta.isNodeValidated());
82     nodeMeta.setSearchTarget(true);
83     assertTrue(nodeMeta.isSearchTarget());
84
85
86   }
87 }