diff options
author | 2018-03-14 12:04:50 +0200 | |
---|---|---|
committer | 2018-03-14 12:04:50 +0200 | |
commit | c9d63f49af5455f503ca63395121b7cd4d8c8c88 (patch) | |
tree | 827ed548a95e05b99f35c494d6c6c654840ee90b /vid-app-common/src/test/java/org/onap/vid/aai | |
parent | d5ec7bf55217508e2b5cebe640d586598379f97a (diff) |
Unit tests
Change-Id: I9c63fd607757bbec095c26341af593d9afd73886
Issue-ID: VID-197
Signed-off-by: Sonsino, Ofir (os0695) <os0695@intl.att.com>
Diffstat (limited to 'vid-app-common/src/test/java/org/onap/vid/aai')
5 files changed, 324 insertions, 0 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/AaiClientTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/AaiClientTest.java new file mode 100644 index 000000000..8010447ce --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/aai/AaiClientTest.java @@ -0,0 +1,40 @@ +package org.onap.vid.aai; + +import static org.junit.Assert.*; +import java.util.*; + +import org.json.simple.JSONObject; +import org.junit.Assert; +import org.junit.Test; +import org.onap.vid.aai.model.AaiGetPnfs.Pnf; +import org.onap.vid.model.SubscriberList; + +public class AaiClientTest { + + private AaiClient createTestSubject() { + return new AaiClient(); + } + + + @Test + public void testDoAaiGet() throws Exception { + AaiClient testSubject; + String certiPath = ""; + String uri = ""; + boolean xml = false; + + // default test + testSubject = createTestSubject(); + testSubject.doAaiGet(certiPath, uri, xml); + } + + @Test + public void testParseServiceSubscriptionObjectForTenants() throws Exception { + JSONObject jsonObject = null; + String result; + + // default test + result = AaiClient.parseServiceSubscriptionObjectForTenants(jsonObject); + } + +}
\ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/OperationalEnvironmentTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/OperationalEnvironmentTest.java new file mode 100644 index 000000000..876dedbbd --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/aai/OperationalEnvironmentTest.java @@ -0,0 +1,171 @@ +package org.onap.vid.aai; + +import org.junit.Test; +import org.onap.vid.aai.model.RelationshipList; + +public class OperationalEnvironmentTest { + + private OperationalEnvironment createTestSubject() { + return new OperationalEnvironment(); + } + + @Test + public void testGetOperationalEnvironmentId() throws Exception { + OperationalEnvironment testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getOperationalEnvironmentId(); + } + + @Test + public void testSetOperationalEnvironmentId() throws Exception { + OperationalEnvironment testSubject; + String operationalEnvironmentId = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setOperationalEnvironmentId(operationalEnvironmentId); + } + + @Test + public void testGetOperationalEnvironmentName() throws Exception { + OperationalEnvironment testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getOperationalEnvironmentName(); + } + + @Test + public void testSetOperationalEnvironmentName() throws Exception { + OperationalEnvironment testSubject; + String operationalEnvironmentName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setOperationalEnvironmentName(operationalEnvironmentName); + } + + @Test + public void testGetOperationalEnvironmentType() throws Exception { + OperationalEnvironment testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getOperationalEnvironmentType(); + } + + @Test + public void testSetOperationalEnvironmentType() throws Exception { + OperationalEnvironment testSubject; + String operationalEnvironmentType = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setOperationalEnvironmentType(operationalEnvironmentType); + } + + @Test + public void testGetOperationalEnvironmentStatus() throws Exception { + OperationalEnvironment testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getOperationalEnvironmentStatus(); + } + + @Test + public void testSetOperationalEnvironmentStatus() throws Exception { + OperationalEnvironment testSubject; + String operationalEnvironmentStatus = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setOperationalEnvironmentStatus(operationalEnvironmentStatus); + } + + @Test + public void testGetTenantContext() throws Exception { + OperationalEnvironment testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getTenantContext(); + } + + @Test + public void testSetTenantContext() throws Exception { + OperationalEnvironment testSubject; + String tenantContext = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setTenantContext(tenantContext); + } + + @Test + public void testGetWorkloadContext() throws Exception { + OperationalEnvironment testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getWorkloadContext(); + } + + @Test + public void testSetWorkloadContext() throws Exception { + OperationalEnvironment testSubject; + String workloadContext = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setWorkloadContext(workloadContext); + } + + @Test + public void testGetResourceVersion() throws Exception { + OperationalEnvironment testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getResourceVersion(); + } + + @Test + public void testSetResourceVersion() throws Exception { + OperationalEnvironment testSubject; + String resourceVersion = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setResourceVersion(resourceVersion); + } + + @Test + public void testGetRelationshipList() throws Exception { + OperationalEnvironment testSubject; + RelationshipList result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getRelationshipList(); + } + + @Test + public void testSetRelationshipList() throws Exception { + OperationalEnvironment testSubject; + RelationshipList relationshipList = null; + + // default test + testSubject = createTestSubject(); + testSubject.setRelationshipList(relationshipList); + } +}
\ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/util/AAIRestInterfaceTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/util/AAIRestInterfaceTest.java new file mode 100644 index 000000000..35ebb66e7 --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/aai/util/AAIRestInterfaceTest.java @@ -0,0 +1,76 @@ +package org.onap.vid.aai.util; + +import org.junit.Test; + +public class AAIRestInterfaceTest { + + private AAIRestInterface createTestSubject() { + return new AAIRestInterface(""); + } + + @Test + public void testEncodeURL() throws Exception { + AAIRestInterface testSubject; + String nodeKey = ""; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.encodeURL(nodeKey); + } + + @Test + public void testSetRestSrvrBaseURL() throws Exception { + AAIRestInterface testSubject; + String baseURL = ""; + + // test 1 + testSubject = createTestSubject(); + baseURL = null; + testSubject.SetRestSrvrBaseURL(baseURL); + + // test 2 + testSubject = createTestSubject(); + baseURL = ""; + testSubject.SetRestSrvrBaseURL(baseURL); + } + + @Test + public void testGetRestSrvrBaseURL() throws Exception { + AAIRestInterface testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getRestSrvrBaseURL(); + } + + + @Test + public void testRestPut() throws Exception { + AAIRestInterface testSubject; + String fromAppId = ""; + String transId = ""; + String path = ""; + String payload = ""; + boolean xml = false; + + // default test + testSubject = createTestSubject(); + testSubject.RestPut(fromAppId, transId, path, payload, xml); + } + + @Test + public void testRestPost() throws Exception { + AAIRestInterface testSubject; + String fromAppId = ""; + String transId = ""; + String path = ""; + String payload = ""; + boolean xml = false; + + // default test + testSubject = createTestSubject(); + testSubject.RestPost(fromAppId, transId, path, payload, xml); + } +}
\ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/util/CustomJacksonJaxBJsonProviderTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/util/CustomJacksonJaxBJsonProviderTest.java new file mode 100644 index 000000000..dcd962f1b --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/aai/util/CustomJacksonJaxBJsonProviderTest.java @@ -0,0 +1,19 @@ +package org.onap.vid.aai.util; + +import org.junit.Test; + +public class CustomJacksonJaxBJsonProviderTest { + + private CustomJacksonJaxBJsonProvider createTestSubject() { + return new CustomJacksonJaxBJsonProvider(); + } + + @Test + public void testGetMapper() throws Exception { + CustomJacksonJaxBJsonProvider testSubject; + + // default test + testSubject = createTestSubject(); + testSubject.getMapper(); + } +}
\ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/util/HttpsAuthClientTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/util/HttpsAuthClientTest.java new file mode 100644 index 000000000..88d53c03f --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/aai/util/HttpsAuthClientTest.java @@ -0,0 +1,18 @@ +package org.onap.vid.aai.util; + +import org.junit.Test; + +public class HttpsAuthClientTest { + + private HttpsAuthClient createTestSubject() { + return new HttpsAuthClient(); + } + + @Test + public void testGetClient() throws Exception { + String certFilePath = ""; + + // default test + HttpsAuthClient.getClient(certFilePath); + } +}
\ No newline at end of file |