Increasing test coverage
[aai/sparky-be.git] / src / test / java / org / onap / aai / sparky / viewandinspect / entity / NodeProcessingTransactionTest.java
1 package org.onap.aai.sparky.viewandinspect.entity;
2
3 import static org.junit.Assert.assertEquals;
4 import static org.junit.Assert.assertFalse;
5 import static org.junit.Assert.assertNotNull;
6 import static org.junit.Assert.assertNull;
7 import static org.junit.Assert.assertTrue;
8
9 import java.util.ArrayList;
10
11 import org.junit.Before;
12 import org.junit.Test;
13 import org.onap.aai.restclient.client.OperationResult;
14 import org.onap.aai.sparky.config.oxm.OxmEntityLookup;
15 import org.onap.aai.sparky.viewandinspect.config.VisualizationConfigs;
16
17 public class NodeProcessingTransactionTest {
18         
19
20         private NodeProcessingTransaction nodeProcessingTransaction;
21          private ActiveInventoryNode activeInventoryNode; 
22                 private ArrayList<String> lst = new ArrayList<String>();
23                  private OperationResult opResult; 
24                  private VisualizationConfigs visualConfig; 
25                  private OxmEntityLookup oxmEntityLookup;
26         
27         @Before
28           public void init() throws Exception {
29                 
30                  visualConfig = new VisualizationConfigs(); 
31                  oxmEntityLookup = new OxmEntityLookup();
32                  opResult = new OperationResult();
33                 activeInventoryNode = new ActiveInventoryNode(visualConfig,oxmEntityLookup);
34                 nodeProcessingTransaction = new NodeProcessingTransaction();
35               
36           }
37         
38         
39         @Test 
40         public void updateValues() {
41                 
42                 nodeProcessingTransaction.setRequestParameters("");
43                 assertNotNull(nodeProcessingTransaction.getRequestParameters());
44                 nodeProcessingTransaction.setProcessingNode(activeInventoryNode);
45                 assertNotNull(nodeProcessingTransaction.getProcessingNode());
46                 nodeProcessingTransaction.setOpResult(opResult);
47                 assertNotNull(nodeProcessingTransaction.getOpResult());
48                 assertNull(nodeProcessingTransaction.getSelfLink());
49                 assertNotNull(nodeProcessingTransaction.getSelfLinkWithModifiers());
50                 assertTrue(nodeProcessingTransaction.processingErrorOccurred());
51                 assertNotNull(nodeProcessingTransaction.toString());
52                 nodeProcessingTransaction.setProcessingNode(null);
53                 assertNull(nodeProcessingTransaction.getProcessingNode());
54                 nodeProcessingTransaction.setOpResult(null);
55                 assertNull(nodeProcessingTransaction.getOpResult());
56                 assertNull(nodeProcessingTransaction.getSelfLink());
57                 assertNull(nodeProcessingTransaction.getSelfLinkWithModifiers());
58                 assertNotNull(nodeProcessingTransaction.toString());
59                 
60         }
61
62 }