2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017-2018 Amdocs
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
22 package org.onap.aai.sparky.viewandinspect.entity;
24 import static org.junit.Assert.assertEquals;
25 import static org.junit.Assert.assertFalse;
26 import static org.junit.Assert.assertNotNull;
27 import static org.junit.Assert.assertNull;
28 import static org.junit.Assert.assertTrue;
30 import java.util.ArrayList;
32 import org.junit.Before;
33 import org.junit.Test;
34 import org.onap.aai.restclient.client.OperationResult;
35 import org.onap.aai.sparky.config.oxm.OxmEntityLookup;
36 import org.onap.aai.sparky.viewandinspect.config.VisualizationConfigs;
38 public class NodeProcessingTransactionTest {
41 private NodeProcessingTransaction nodeProcessingTransaction;
42 private ActiveInventoryNode activeInventoryNode;
43 private ArrayList<String> lst = new ArrayList<String>();
44 private OperationResult opResult;
45 private VisualizationConfigs visualConfig;
46 private OxmEntityLookup oxmEntityLookup;
49 public void init() throws Exception {
51 visualConfig = new VisualizationConfigs();
52 oxmEntityLookup = new OxmEntityLookup();
53 opResult = new OperationResult();
54 activeInventoryNode = new ActiveInventoryNode(visualConfig,oxmEntityLookup);
55 nodeProcessingTransaction = new NodeProcessingTransaction();
61 public void updateValues() {
63 nodeProcessingTransaction.setRequestParameters("");
64 assertNotNull(nodeProcessingTransaction.getRequestParameters());
65 nodeProcessingTransaction.setProcessingNode(activeInventoryNode);
66 assertNotNull(nodeProcessingTransaction.getProcessingNode());
67 nodeProcessingTransaction.setOpResult(opResult);
68 assertNotNull(nodeProcessingTransaction.getOpResult());
69 assertNull(nodeProcessingTransaction.getSelfLink());
70 assertNotNull(nodeProcessingTransaction.getSelfLinkWithModifiers());
71 assertTrue(nodeProcessingTransaction.processingErrorOccurred());
72 assertNotNull(nodeProcessingTransaction.toString());
73 nodeProcessingTransaction.setProcessingNode(null);
74 assertNull(nodeProcessingTransaction.getProcessingNode());
75 nodeProcessingTransaction.setOpResult(null);
76 assertNull(nodeProcessingTransaction.getOpResult());
77 assertNull(nodeProcessingTransaction.getSelfLink());
78 assertNull(nodeProcessingTransaction.getSelfLinkWithModifiers());
79 assertNotNull(nodeProcessingTransaction.toString());