1 package org.onap.aai.sparky.dal;
3 import static org.junit.Assert.assertEquals;
4 import static org.junit.Assert.assertNotNull;
5 import static org.junit.Assert.assertNull;
6 import static org.junit.Assert.assertTrue;
8 import java.util.ArrayList;
10 import org.junit.Before;
11 import org.junit.Test;
12 import org.onap.aai.restclient.client.OperationResult;
13 import org.onap.aai.sparky.config.oxm.OxmEntityDescriptor;
14 import org.onap.aai.sparky.dal.rest.HttpMethod;
16 public class NetworkTransactionTest {
19 private NetworkTransaction networkTransaction;
20 private NetworkTransaction networkTransactions;
21 private OxmEntityDescriptor descriptor;
22 private OperationResult opResult;
25 public void init() throws Exception {
26 opResult = new OperationResult();
27 descriptor = new OxmEntityDescriptor();
28 networkTransaction = new NetworkTransaction();
29 networkTransactions = new NetworkTransaction(HttpMethod.POST,"",opResult);
37 public void updateValues() {
39 networkTransaction.setOperationResult(opResult);
40 assertNotNull(networkTransaction.getOperationResult());
41 networkTransaction.setOperationType(HttpMethod.PUT);
42 assertNotNull(networkTransaction.getOperationType());
43 networkTransaction.setTaskAgeInMs();
44 assertNotNull(networkTransaction.getTaskAgeInMs());
45 networkTransaction.setEntityType("searchedNodeClass");
46 assertNotNull(networkTransaction.getEntityType());
47 networkTransaction.setLink("/etc/aaiEntityNodeDescriptors.json");
48 assertNotNull(networkTransaction.getLink());
49 networkTransaction.setQueryParameters("/etc/aaiEntityNodeDescriptors.json");
50 assertNotNull(networkTransaction.getQueryParameters());
51 networkTransaction.setDescriptor(descriptor);
52 assertNotNull(networkTransaction.getDescriptor());
53 networkTransaction.setOpTimeInMs(3);
54 assertEquals(3,networkTransaction.getOpTimeInMs());
55 assertNotNull(networkTransaction.toString());