From d5ec7bf55217508e2b5cebe640d586598379f97a Mon Sep 17 00:00:00 2001 From: "Sonsino, Ofir (os0695)" Date: Tue, 13 Mar 2018 18:31:21 +0200 Subject: Unit tests Change-Id: Ib9f73b7ba5a509610896b8bbdc02c180e60ee959 Issue-ID: VID-197 Signed-off-by: Sonsino, Ofir (os0695) --- .gitignore | 9 ++ .../org/onap/vid/asdc/beans/tosca/Property.java | 2 +- .../org/onap/vid/asdc/beans/tosca/Requirement.java | 2 +- .../src/main/java/org/onap/vid/utils/Logging.java | 2 +- .../onap/vid/aai/model/AaiGetPnfResponseTest.java | 43 ++++++ .../org/onap/vid/aai/model/AaiGetPnfs/PnfTest.java | 150 +++++++++++++++++++++ .../vid/aai/model/AaiRelationResponseTest.java | 50 +++++++ ...viceModelsByDistributionStatusResponseTest.java | 32 +++++ .../vid/aai/model/LogicalLinkResponseTest.java | 130 ++++++++++++++++++ .../java/org/onap/vid/aai/model/ModelTest.java | 90 +++++++++++++ .../java/org/onap/vid/aai/model/ModelVerTest.java | 130 ++++++++++++++++++ .../java/org/onap/vid/aai/model/ModelVersTest.java | 32 +++++ .../org/onap/vid/aai/model/OwningEntityTest.java | 50 +++++++ .../org/onap/vid/aai/model/PnfPropertiesTest.java | 33 +++++ .../java/org/onap/vid/aai/model/PnfResultTest.java | 33 +++++ .../onap/vid/aai/model/ProjectResponseTest.java | 32 +++++ .../java/org/onap/vid/aai/model/ProjectTest.java | 30 +++++ .../java/org/onap/vid/aai/model/ResultTest.java | 30 +++++ .../onap/vid/asdc/beans/SecureServicesTest.java | 52 +++++++ .../org/onap/vid/asdc/beans/tosca/ImportTest.java | 30 +++++ .../onap/vid/asdc/beans/tosca/PropertyTest.java | 130 ++++++++++++++++++ .../onap/vid/asdc/beans/tosca/RequirementTest.java | 92 +++++++++++++ .../org/onap/vid/asdc/beans/tosca/SchemaTest.java | 30 +++++ .../category/CategoryParameterOptionRepTest.java | 50 +++++++ .../category/CategoryParametersResponseTest.java | 33 +++++ .../org/onap/vid/client/HttpBasicClientTest.java | 16 +++ .../org/onap/vid/client/HttpsBasicClientTest.java | 17 +++ .../onap/vid/controllers/LoggerControllerTest.java | 54 ++++++++ .../vid/controllers/MaintenanceControllerTest.java | 66 +++++++++ .../java/org/onap/vid/dao/FnAppDoaImplTest.java | 97 +++++++++++++ .../onap/vid/factories/MsoRequestFactoryTest.java | 20 +++ .../org/onap/vid/logging/VidLoggerAspectTest.java | 23 ++++ .../src/test/java/org/onap/vid/roles/RoleTest.java | 60 +++++++++ .../java/org/onap/vid/roles/RoleValidatorTest.java | 101 +++++++------- .../org/onap/vid/scheduler/RestObjectTest.java | 70 ++++++++++ .../SchedulerRestInterfaceFactoryTest.java | 18 +++ .../test/java/org/onap/vid/utils/LoggingTest.java | 43 ++++++ 37 files changed, 1829 insertions(+), 53 deletions(-) create mode 100644 vid-app-common/src/test/java/org/onap/vid/aai/model/AaiGetPnfResponseTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/aai/model/AaiGetPnfs/PnfTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/aai/model/AaiRelationResponseTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/aai/model/GetServiceModelsByDistributionStatusResponseTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/aai/model/LogicalLinkResponseTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/aai/model/ModelTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/aai/model/ModelVerTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/aai/model/ModelVersTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/aai/model/OwningEntityTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/aai/model/PnfPropertiesTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/aai/model/PnfResultTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/aai/model/ProjectResponseTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/aai/model/ProjectTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/aai/model/ResultTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/asdc/beans/SecureServicesTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/ImportTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/PropertyTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/RequirementTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/SchemaTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/category/CategoryParameterOptionRepTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/category/CategoryParametersResponseTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/client/HttpBasicClientTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/client/HttpsBasicClientTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/controllers/LoggerControllerTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/controllers/MaintenanceControllerTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/dao/FnAppDoaImplTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/factories/MsoRequestFactoryTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/logging/VidLoggerAspectTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/roles/RoleTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/scheduler/RestObjectTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/scheduler/SchedulerRestInterfaceFactoryTest.java create mode 100644 vid-app-common/src/test/java/org/onap/vid/utils/LoggingTest.java diff --git a/.gitignore b/.gitignore index eb1a75572..74296e504 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,12 @@ epsdk-app-onap/target/ vid-app-common/target/ vid-parent_bdio.jsonld deliveries/target/ +/vid-app-common/debug-logs/EELF/debug.log +/vid-app-common/logs/EELF/application.log +/vid-app-common/logs/EELF/audit.log +/vid-app-common/logs/EELF/error.log +/vid-app-common/logs/EELF/metrics.log +/vid-app-common/logs/EELF/performance.log +/vid-app-common/logs/EELF/policy.log +/vid-app-common/logs/EELF/security.log +/vid-app-common/logs/EELF/server.log diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Property.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Property.java index 107f5c82f..4bebe8b8a 100644 --- a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Property.java +++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Property.java @@ -43,7 +43,7 @@ public class Property { /** * Instantiates a new property. */ - private Property() {} + Property() {} /** * Gets the type. diff --git a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Requirement.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Requirement.java index 0c2f88493..202e88f1e 100644 --- a/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Requirement.java +++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Requirement.java @@ -42,7 +42,7 @@ public class Requirement { /** * Instantiates a new requirement. */ - private Requirement() {} + Requirement() {} /** * Gets the occurrences. diff --git a/vid-app-common/src/main/java/org/onap/vid/utils/Logging.java b/vid-app-common/src/main/java/org/onap/vid/utils/Logging.java index 1425f1496..61cf09561 100644 --- a/vid-app-common/src/main/java/org/onap/vid/utils/Logging.java +++ b/vid-app-common/src/main/java/org/onap/vid/utils/Logging.java @@ -19,7 +19,7 @@ import static org.onap.vid.utils.Streams.not; public class Logging { - private Logging() { + Logging() { } public static final String HTTP_REQUESTS_OUTGOING = "http.requests.outgoing."; diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/model/AaiGetPnfResponseTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/model/AaiGetPnfResponseTest.java new file mode 100644 index 000000000..bf248a396 --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/aai/model/AaiGetPnfResponseTest.java @@ -0,0 +1,43 @@ +package org.onap.vid.aai.model; + +import java.util.Map; + +import org.junit.Test; + +public class AaiGetPnfResponseTest { + + private AaiGetPnfResponse createTestSubject() { + return new AaiGetPnfResponse(); + } + + @Test + public void testGetAdditionalProperties() throws Exception { + AaiGetPnfResponse testSubject; + Map result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getAdditionalProperties(); + } + + @Test + public void testSetAdditionalProperty() throws Exception { + AaiGetPnfResponse testSubject; + String name = ""; + Object value = null; + + // default test + testSubject = createTestSubject(); + testSubject.setAdditionalProperty(name, value); + } + + @Test + public void testToString() throws Exception { + AaiGetPnfResponse testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.toString(); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/model/AaiGetPnfs/PnfTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/model/AaiGetPnfs/PnfTest.java new file mode 100644 index 000000000..22aad6eae --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/aai/model/AaiGetPnfs/PnfTest.java @@ -0,0 +1,150 @@ +package org.onap.vid.aai.model.AaiGetPnfs; + +import org.junit.Test; + +public class PnfTest { + + private Pnf createTestSubject() { + return new Pnf(); + } + + @Test + public void testGetPnfName() throws Exception { + Pnf testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getPnfName(); + } + + @Test + public void testSetPnfName() throws Exception { + Pnf testSubject; + String pnfName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setPnfName(pnfName); + } + + @Test + public void testGetEquipType() throws Exception { + Pnf testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getEquipType(); + } + + @Test + public void testSetEquipType() throws Exception { + Pnf testSubject; + String equipType = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setEquipType(equipType); + } + + @Test + public void testGetEquipVendor() throws Exception { + Pnf testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getEquipVendor(); + } + + @Test + public void testSetEquipVendor() throws Exception { + Pnf testSubject; + String equipVendor = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setEquipVendor(equipVendor); + } + + @Test + public void testGetPnfName2() throws Exception { + Pnf testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getPnfName2(); + } + + @Test + public void testSetPnfName2() throws Exception { + Pnf testSubject; + String pnfName2 = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setPnfName2(pnfName2); + } + + @Test + public void testGetPnfId() throws Exception { + Pnf testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getPnfId(); + } + + @Test + public void testSetPnfId() throws Exception { + Pnf testSubject; + String pnfId = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setPnfId(pnfId); + } + + @Test + public void testGetEquipModel() throws Exception { + Pnf testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getEquipModel(); + } + + @Test + public void testSetEquipModel() throws Exception { + Pnf testSubject; + String equipModel = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setEquipModel(equipModel); + } + + @Test + public void testGetPnfName2Source() throws Exception { + Pnf testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getPnfName2Source(); + } + + @Test + public void testSetPnfName2Source() throws Exception { + Pnf testSubject; + String pnfName2Source = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setPnfName2Source(pnfName2Source); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/model/AaiRelationResponseTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/model/AaiRelationResponseTest.java new file mode 100644 index 000000000..d9f3fe522 --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/aai/model/AaiRelationResponseTest.java @@ -0,0 +1,50 @@ +package org.onap.vid.aai.model; + +import org.junit.Test; + +public class AaiRelationResponseTest { + + private AaiRelationResponse createTestSubject() { + return new AaiRelationResponse(); + } + + @Test + public void testGetResourceVersion() throws Exception { + AaiRelationResponse testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getResourceVersion(); + } + + @Test + public void testSetResourceVersion() throws Exception { + AaiRelationResponse testSubject; + String resourceVersion = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setResourceVersion(resourceVersion); + } + + @Test + public void testGetRelationshipList() throws Exception { + AaiRelationResponse testSubject; + RelationshipList result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getRelationshipList(); + } + + @Test + public void testSetRelationshipList() throws Exception { + AaiRelationResponse 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/model/GetServiceModelsByDistributionStatusResponseTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/model/GetServiceModelsByDistributionStatusResponseTest.java new file mode 100644 index 000000000..748a18187 --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/aai/model/GetServiceModelsByDistributionStatusResponseTest.java @@ -0,0 +1,32 @@ +package org.onap.vid.aai.model; + +import java.util.List; + +import org.junit.Test; + +public class GetServiceModelsByDistributionStatusResponseTest { + + private GetServiceModelsByDistributionStatusResponse createTestSubject() { + return new GetServiceModelsByDistributionStatusResponse(); + } + + @Test + public void testGetResults() throws Exception { + GetServiceModelsByDistributionStatusResponse testSubject; + List result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getResults(); + } + + @Test + public void testSetResults() throws Exception { + GetServiceModelsByDistributionStatusResponse testSubject; + List results = null; + + // default test + testSubject = createTestSubject(); + testSubject.setResults(results); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/model/LogicalLinkResponseTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/model/LogicalLinkResponseTest.java new file mode 100644 index 000000000..99ee59584 --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/aai/model/LogicalLinkResponseTest.java @@ -0,0 +1,130 @@ +package org.onap.vid.aai.model; + +import org.junit.Test; + +public class LogicalLinkResponseTest { + + private LogicalLinkResponse createTestSubject() { + return new LogicalLinkResponse(); + } + + @Test + public void testGetLinkName() throws Exception { + LogicalLinkResponse testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getLinkName(); + } + + @Test + public void testSetLinkName() throws Exception { + LogicalLinkResponse testSubject; + String linkName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setLinkName(linkName); + } + + @Test + public void testGetInMaint() throws Exception { + LogicalLinkResponse testSubject; + Boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getInMaint(); + } + + @Test + public void testSetInMaint() throws Exception { + LogicalLinkResponse testSubject; + Boolean inMaint = null; + + // default test + testSubject = createTestSubject(); + testSubject.setInMaint(inMaint); + } + + @Test + public void testGetLinkType() throws Exception { + LogicalLinkResponse testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getLinkType(); + } + + @Test + public void testSetLinkType() throws Exception { + LogicalLinkResponse testSubject; + String linkType = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setLinkType(linkType); + } + + @Test + public void testGetResourceVersion() throws Exception { + LogicalLinkResponse testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getResourceVersion(); + } + + @Test + public void testSetResourceVersion() throws Exception { + LogicalLinkResponse testSubject; + String resourceVersion = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setResourceVersion(resourceVersion); + } + + @Test + public void testGetPurpose() throws Exception { + LogicalLinkResponse testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getPurpose(); + } + + @Test + public void testSetPurpose() throws Exception { + LogicalLinkResponse testSubject; + String purpose = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setPurpose(purpose); + } + + @Test + public void testGetRelationshipList() throws Exception { + LogicalLinkResponse testSubject; + RelationshipList result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getRelationshipList(); + } + + @Test + public void testSetRelationshipList() throws Exception { + LogicalLinkResponse 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/model/ModelTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/model/ModelTest.java new file mode 100644 index 000000000..413c0b33e --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/aai/model/ModelTest.java @@ -0,0 +1,90 @@ +package org.onap.vid.aai.model; + +import org.junit.Test; + +public class ModelTest { + + private Model createTestSubject() { + return new Model(); + } + + @Test + public void testGetModelInvariantId() throws Exception { + Model testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getModelInvariantId(); + } + + @Test + public void testSetModelInvariantId() throws Exception { + Model testSubject; + String modelInvariantId = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setModelInvariantId(modelInvariantId); + } + + @Test + public void testGetModelType() throws Exception { + Model testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getModelType(); + } + + @Test + public void testSetModelType() throws Exception { + Model testSubject; + String modelType = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setModelType(modelType); + } + + @Test + public void testGetResourceVersion() throws Exception { + Model testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getResourceVersion(); + } + + @Test + public void testSetResourceVersion() throws Exception { + Model testSubject; + String resourceVersion = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setResourceVersion(resourceVersion); + } + + @Test + public void testGetModelVers() throws Exception { + Model testSubject; + ModelVers result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getModelVers(); + } + + @Test + public void testSetModelVers() throws Exception { + Model testSubject; + ModelVers modelVers = null; + + // default test + testSubject = createTestSubject(); + testSubject.setModelVers(modelVers); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/model/ModelVerTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/model/ModelVerTest.java new file mode 100644 index 000000000..99a7a7a0e --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/aai/model/ModelVerTest.java @@ -0,0 +1,130 @@ +package org.onap.vid.aai.model; + +import org.junit.Test; + +public class ModelVerTest { + + private ModelVer createTestSubject() { + return new ModelVer(); + } + + @Test + public void testGetModelVersionId() throws Exception { + ModelVer testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getModelVersionId(); + } + + @Test + public void testSetModelVersionId() throws Exception { + ModelVer testSubject; + String modelVersionId = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setModelVersionId(modelVersionId); + } + + @Test + public void testGetModelName() throws Exception { + ModelVer testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getModelName(); + } + + @Test + public void testSetModelName() throws Exception { + ModelVer testSubject; + String modelName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setModelName(modelName); + } + + @Test + public void testGetModelVersion() throws Exception { + ModelVer testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getModelVersion(); + } + + @Test + public void testSetModelVersion() throws Exception { + ModelVer testSubject; + String modelVersion = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setModelVersion(modelVersion); + } + + @Test + public void testGetDistributionStatus() throws Exception { + ModelVer testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDistributionStatus(); + } + + @Test + public void testSetDistributionStatus() throws Exception { + ModelVer testSubject; + String distributionStatus = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setDistributionStatus(distributionStatus); + } + + @Test + public void testGetResourceVersion() throws Exception { + ModelVer testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getResourceVersion(); + } + + @Test + public void testSetResourceVersion() throws Exception { + ModelVer testSubject; + String resourceVersion = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setResourceVersion(resourceVersion); + } + + @Test + public void testGetModelDescription() throws Exception { + ModelVer testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getModelDescription(); + } + + @Test + public void testSetModelDescription() throws Exception { + ModelVer testSubject; + String modelDescription = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setModelDescription(modelDescription); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/model/ModelVersTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/model/ModelVersTest.java new file mode 100644 index 000000000..83bda0e55 --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/aai/model/ModelVersTest.java @@ -0,0 +1,32 @@ +package org.onap.vid.aai.model; + +import java.util.List; + +import org.junit.Test; + +public class ModelVersTest { + + private ModelVers createTestSubject() { + return new ModelVers(); + } + + @Test + public void testGetModelVer() throws Exception { + ModelVers testSubject; + List result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getModelVer(); + } + + @Test + public void testSetModelVer() throws Exception { + ModelVers testSubject; + List modelVer = null; + + // default test + testSubject = createTestSubject(); + testSubject.setModelVer(modelVer); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/model/OwningEntityTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/model/OwningEntityTest.java new file mode 100644 index 000000000..1e160d297 --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/aai/model/OwningEntityTest.java @@ -0,0 +1,50 @@ +package org.onap.vid.aai.model; + +import org.junit.Test; + +public class OwningEntityTest { + + private OwningEntity createTestSubject() { + return new OwningEntity(); + } + + @Test + public void testGetOwningEntityId() throws Exception { + OwningEntity testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getOwningEntityId(); + } + + @Test + public void testSetOwningEntityId() throws Exception { + OwningEntity testSubject; + String owningEntityId = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setOwningEntityId(owningEntityId); + } + + @Test + public void testGetOwningEntityName() throws Exception { + OwningEntity testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getOwningEntityName(); + } + + @Test + public void testSetOwningEntityName() throws Exception { + OwningEntity testSubject; + String owningEntityName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setOwningEntityName(owningEntityName); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/model/PnfPropertiesTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/model/PnfPropertiesTest.java new file mode 100644 index 000000000..46709af92 --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/aai/model/PnfPropertiesTest.java @@ -0,0 +1,33 @@ +package org.onap.vid.aai.model; + +import java.util.Map; + +import org.junit.Test; + +public class PnfPropertiesTest { + + private PnfProperties createTestSubject() { + return new PnfProperties(); + } + + @Test + public void testGetAdditionalProperties() throws Exception { + PnfProperties testSubject; + Map result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getAdditionalProperties(); + } + + @Test + public void testSetAdditionalProperty() throws Exception { + PnfProperties testSubject; + String name = ""; + Object value = null; + + // default test + testSubject = createTestSubject(); + testSubject.setAdditionalProperty(name, value); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/model/PnfResultTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/model/PnfResultTest.java new file mode 100644 index 000000000..0f66df02f --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/aai/model/PnfResultTest.java @@ -0,0 +1,33 @@ +package org.onap.vid.aai.model; + +import java.util.Map; + +import org.junit.Test; + +public class PnfResultTest { + + private PnfResult createTestSubject() { + return new PnfResult(); + } + + @Test + public void testGetAdditionalProperties() throws Exception { + PnfResult testSubject; + Map result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getAdditionalProperties(); + } + + @Test + public void testSetAdditionalProperty() throws Exception { + PnfResult testSubject; + String name = ""; + Object value = null; + + // default test + testSubject = createTestSubject(); + testSubject.setAdditionalProperty(name, value); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/model/ProjectResponseTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/model/ProjectResponseTest.java new file mode 100644 index 000000000..1784ea5ad --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/aai/model/ProjectResponseTest.java @@ -0,0 +1,32 @@ +package org.onap.vid.aai.model; + +import java.util.List; + +import org.junit.Test; + +public class ProjectResponseTest { + + private ProjectResponse createTestSubject() { + return new ProjectResponse(); + } + + @Test + public void testGetProject() throws Exception { + ProjectResponse testSubject; + List result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getProject(); + } + + @Test + public void testSetProject() throws Exception { + ProjectResponse testSubject; + List project = null; + + // default test + testSubject = createTestSubject(); + testSubject.setProject(project); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/model/ProjectTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/model/ProjectTest.java new file mode 100644 index 000000000..8de772d48 --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/aai/model/ProjectTest.java @@ -0,0 +1,30 @@ +package org.onap.vid.aai.model; + +import org.junit.Test; + +public class ProjectTest { + + private Project createTestSubject() { + return new Project(); + } + + @Test + public void testGetProjectName() throws Exception { + Project testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getProjectName(); + } + + @Test + public void testSetProjectName() throws Exception { + Project testSubject; + String projectName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setProjectName(projectName); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/model/ResultTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/model/ResultTest.java new file mode 100644 index 000000000..91d7763ec --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/aai/model/ResultTest.java @@ -0,0 +1,30 @@ +package org.onap.vid.aai.model; + +import org.junit.Test; + +public class ResultTest { + + private Result createTestSubject() { + return new Result(); + } + + @Test + public void testGetModel() throws Exception { + Result testSubject; + Model result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getModel(); + } + + @Test + public void testSetModel() throws Exception { + Result testSubject; + Model model = null; + + // default test + testSubject = createTestSubject(); + testSubject.setModel(model); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/asdc/beans/SecureServicesTest.java b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/SecureServicesTest.java new file mode 100644 index 000000000..3cd84af5f --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/SecureServicesTest.java @@ -0,0 +1,52 @@ +package org.onap.vid.asdc.beans; + +import java.util.Collection; + +import org.junit.Test; + +public class SecureServicesTest { + + private SecureServices createTestSubject() { + return new SecureServices(); + } + + @Test + public void testSetServices() throws Exception { + SecureServices testSubject; + Collection services = null; + + // default test + testSubject = createTestSubject(); + testSubject.setServices(services); + } + + @Test + public void testGetServices() throws Exception { + SecureServices testSubject; + Collection result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getServices(); + } + + @Test + public void testIsReadOnly() throws Exception { + SecureServices testSubject; + boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.isReadOnly(); + } + + @Test + public void testSetReadOnly() throws Exception { + SecureServices testSubject; + boolean readOnly = false; + + // default test + testSubject = createTestSubject(); + testSubject.setReadOnly(readOnly); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/ImportTest.java b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/ImportTest.java new file mode 100644 index 000000000..7b72fcc94 --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/ImportTest.java @@ -0,0 +1,30 @@ +package org.onap.vid.asdc.beans.tosca; + +import org.junit.Test; + +public class ImportTest { + + private Import createTestSubject() { + return new Import(); + } + + @Test + public void testGetFile() throws Exception { + Import testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getFile(); + } + + @Test + public void testSetFile() throws Exception { + Import testSubject; + String file = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setFile(file); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/PropertyTest.java b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/PropertyTest.java new file mode 100644 index 000000000..e638b518d --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/PropertyTest.java @@ -0,0 +1,130 @@ +package org.onap.vid.asdc.beans.tosca; + +import org.junit.Test; + +public class PropertyTest { + + private Property createTestSubject() { + return new Property(); + } + + @Test + public void testGetType() throws Exception { + Property testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getType(); + } + + @Test + public void testGetDescription() throws Exception { + Property testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDescription(); + } + + @Test + public void testGetEntry_schema() throws Exception { + Property testSubject; + Schema result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getEntry_schema(); + } + + @Test + public void testGet_default() throws Exception { + Property testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.get_default(); + } + + @Test + public void testSetType() throws Exception { + Property testSubject; + String type = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setType(type); + } + + @Test + public void testSetDescription() throws Exception { + Property testSubject; + String description = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setDescription(description); + } + + @Test + public void testSetEntry_schema() throws Exception { + Property testSubject; + Schema entry_schema = null; + + // default test + testSubject = createTestSubject(); + testSubject.setEntry_schema(entry_schema); + } + + @Test + public void testSet_default() throws Exception { + Property testSubject; + String _default = ""; + + // default test + testSubject = createTestSubject(); + testSubject.set_default(_default); + } + + @Test + public void testGetDefault() throws Exception { + Property testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDefault(); + } + + @Test + public void testIsRequired() throws Exception { + Property testSubject; + boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.isRequired(); + } + + @Test + public void testSetDefault() throws Exception { + Property testSubject; + String _default = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setDefault(_default); + } + + @Test + public void testSetRequired() throws Exception { + Property testSubject; + boolean required = false; + + // default test + testSubject = createTestSubject(); + testSubject.setRequired(required); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/RequirementTest.java b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/RequirementTest.java new file mode 100644 index 000000000..ae5ff5293 --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/RequirementTest.java @@ -0,0 +1,92 @@ +package org.onap.vid.asdc.beans.tosca; + +import java.util.Collection; + +import org.junit.Test; + +public class RequirementTest { + + private Requirement createTestSubject() { + return new Requirement(); + } + + @Test + public void testGetOccurrences() throws Exception { + Requirement testSubject; + Collection result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getOccurrences(); + } + + @Test + public void testGetCapability() throws Exception { + Requirement testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getCapability(); + } + + @Test + public void testGetNode() throws Exception { + Requirement testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getNode(); + } + + @Test + public void testGetRelationship() throws Exception { + Requirement testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getRelationship(); + } + + @Test + public void testSetOccurrences() throws Exception { + Requirement testSubject; + Collection occurrences = null; + + // default test + testSubject = createTestSubject(); + testSubject.setOccurrences(occurrences); + } + + @Test + public void testSetCapability() throws Exception { + Requirement testSubject; + String capability = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setCapability(capability); + } + + @Test + public void testSetNode() throws Exception { + Requirement testSubject; + String node = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setNode(node); + } + + @Test + public void testSetRelationship() throws Exception { + Requirement testSubject; + String relationship = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setRelationship(relationship); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/SchemaTest.java b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/SchemaTest.java new file mode 100644 index 000000000..198e12809 --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/asdc/beans/tosca/SchemaTest.java @@ -0,0 +1,30 @@ +package org.onap.vid.asdc.beans.tosca; + +import org.junit.Test; + +public class SchemaTest { + + private Schema createTestSubject() { + return new Schema(); + } + + @Test + public void testGetType() throws Exception { + Schema testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getType(); + } + + @Test + public void testSetType() throws Exception { + Schema testSubject; + String type = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setType(type); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/category/CategoryParameterOptionRepTest.java b/vid-app-common/src/test/java/org/onap/vid/category/CategoryParameterOptionRepTest.java new file mode 100644 index 000000000..e1836df54 --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/category/CategoryParameterOptionRepTest.java @@ -0,0 +1,50 @@ +package org.onap.vid.category; + +import org.junit.Test; + +public class CategoryParameterOptionRepTest { + + private CategoryParameterOptionRep createTestSubject() { + return new CategoryParameterOptionRep(); + } + + @Test + public void testGetId() throws Exception { + CategoryParameterOptionRep testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getId(); + } + + @Test + public void testSetId() throws Exception { + CategoryParameterOptionRep testSubject; + String id = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setId(id); + } + + @Test + public void testGetName() throws Exception { + CategoryParameterOptionRep testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getName(); + } + + @Test + public void testSetName() throws Exception { + CategoryParameterOptionRep testSubject; + String name = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setName(name); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/category/CategoryParametersResponseTest.java b/vid-app-common/src/test/java/org/onap/vid/category/CategoryParametersResponseTest.java new file mode 100644 index 000000000..840f8f25c --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/category/CategoryParametersResponseTest.java @@ -0,0 +1,33 @@ +package org.onap.vid.category; + +import java.util.List; +import java.util.Map; + +import org.junit.Test; + +public class CategoryParametersResponseTest { + + private CategoryParametersResponse createTestSubject() { + return new CategoryParametersResponse(); + } + + @Test + public void testGetCategoryParameters() throws Exception { + CategoryParametersResponse testSubject; + Map> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getCategoryParameters(); + } + + @Test + public void testSetCategoryParameters() throws Exception { + CategoryParametersResponse testSubject; + Map> categoryParameters = null; + + // default test + testSubject = createTestSubject(); + testSubject.setCategoryParameters(categoryParameters); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/client/HttpBasicClientTest.java b/vid-app-common/src/test/java/org/onap/vid/client/HttpBasicClientTest.java new file mode 100644 index 000000000..621791121 --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/client/HttpBasicClientTest.java @@ -0,0 +1,16 @@ +package org.onap.vid.client; + +import org.junit.Test; + +public class HttpBasicClientTest { + + private HttpBasicClient createTestSubject() { + return new HttpBasicClient(); + } + + @Test + public void testGetClient() throws Exception { + // default test + HttpBasicClient.getClient(); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/client/HttpsBasicClientTest.java b/vid-app-common/src/test/java/org/onap/vid/client/HttpsBasicClientTest.java new file mode 100644 index 000000000..75bb01980 --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/client/HttpsBasicClientTest.java @@ -0,0 +1,17 @@ +package org.onap.vid.client; + +import org.junit.Test; + +public class HttpsBasicClientTest { + + private HttpsBasicClient createTestSubject() { + return new HttpsBasicClient(); + } + + @Test + public void testGetClient() throws Exception { + + // default test + HttpsBasicClient.getClient(); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/controllers/LoggerControllerTest.java b/vid-app-common/src/test/java/org/onap/vid/controllers/LoggerControllerTest.java new file mode 100644 index 000000000..5a3002aba --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/controllers/LoggerControllerTest.java @@ -0,0 +1,54 @@ +package org.onap.vid.controllers; + +import static org.junit.Assert.*; +import java.util.*; +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.NotAuthorizedException; + +import org.junit.Assert; +import org.junit.Test; +import org.onap.vid.model.ExceptionResponse; + + +public class LoggerControllerTest { + + private LoggerController createTestSubject() { + return new LoggerController(); + } + + /*@Test + public void testGetLog() throws Exception { + LoggerController testSubject; + String loggerName = ""; + HttpServletRequest request = null; + Integer limit = 0; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getLog(loggerName, request, limit); + }*/ + + + @Test + public void testNotAuthorizedHandler() throws Exception { + LoggerController testSubject; + NotAuthorizedException e = null; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.notAuthorizedHandler(e); + } + + /*@Test + public void testIoExceptionHandler() throws Exception { + LoggerController testSubject; + Exception e = null; + ExceptionResponse result; + + // default test + testSubject = createTestSubject(); + result = testSubject.ioExceptionHandler(e); + }*/ +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/controllers/MaintenanceControllerTest.java b/vid-app-common/src/test/java/org/onap/vid/controllers/MaintenanceControllerTest.java new file mode 100644 index 000000000..80c65935e --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/controllers/MaintenanceControllerTest.java @@ -0,0 +1,66 @@ +package org.onap.vid.controllers; + +import javax.servlet.http.HttpServletRequest; + +import org.junit.Test; +import org.onap.vid.category.AddCategoryOptionsRequest; +import org.onap.vid.category.CategoryParameterOptionRep; +import org.onap.vid.model.CategoryParameterOption; +import org.springframework.http.ResponseEntity; + +public class MaintenanceControllerTest { + + private MaintenanceController createTestSubject() { + return new MaintenanceController(); + } + + @Test + public void testAddCategoryOptions() throws Exception { + MaintenanceController testSubject; + HttpServletRequest request = null; + String categoryName = ""; + AddCategoryOptionsRequest option = null; + ResponseEntity result; + + // default test + testSubject = createTestSubject(); + result = testSubject.addCategoryOptions(request, categoryName, option); + } + + @Test + public void testUpdateNameForOption() throws Exception { + MaintenanceController testSubject; + HttpServletRequest request = null; + String categoryName = ""; + CategoryParameterOptionRep option = null; + ResponseEntity result; + + // default test + testSubject = createTestSubject(); + result = testSubject.updateNameForOption(request, categoryName, option); + } + + @Test + public void testGetCategoryParameter() throws Exception { + MaintenanceController testSubject; + HttpServletRequest request = null; + ResponseEntity result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getCategoryParameter(request, null); + } + + @Test + public void testDeleteCategoryOption() throws Exception { + MaintenanceController testSubject; + HttpServletRequest request = null; + String categoryName = ""; + CategoryParameterOption option = null; + ResponseEntity result; + + // default test + testSubject = createTestSubject(); + result = testSubject.deleteCategoryOption(request, categoryName, option); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/dao/FnAppDoaImplTest.java b/vid-app-common/src/test/java/org/onap/vid/dao/FnAppDoaImplTest.java new file mode 100644 index 000000000..843883cd3 --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/dao/FnAppDoaImplTest.java @@ -0,0 +1,97 @@ +package org.onap.vid.dao; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; + +import org.junit.Assert; +import org.junit.Test; + +public class FnAppDoaImplTest { + + private FnAppDoaImpl createTestSubject() { + return new FnAppDoaImpl(); + } + + @Test + public void testGetConnection() throws Exception { + String driver2 = ""; + String url = ""; + String username = ""; + String password = ""; + Connection result; + + // test 1 + url = null; + username = null; + password = null; + result = FnAppDoaImpl.getConnection(driver2, url, username, password); + Assert.assertEquals(null, result); + + // test 2 + url = ""; + username = null; + password = null; + result = FnAppDoaImpl.getConnection(driver2, url, username, password); + Assert.assertEquals(null, result); + + // test 3 + username = null; + url = null; + password = null; + result = FnAppDoaImpl.getConnection(driver2, url, username, password); + Assert.assertEquals(null, result); + + // test 4 + username = ""; + url = null; + password = null; + result = FnAppDoaImpl.getConnection(driver2, url, username, password); + Assert.assertEquals(null, result); + + // test 5 + password = null; + url = null; + username = null; + result = FnAppDoaImpl.getConnection(driver2, url, username, password); + Assert.assertEquals(null, result); + + // test 6 + password = ""; + url = null; + username = null; + result = FnAppDoaImpl.getConnection(driver2, url, username, password); + Assert.assertEquals(null, result); + } + + @Test + public void testCleanup() throws Exception { + ResultSet rs = null; + PreparedStatement st = null; + + // test 1 + rs = null; + FnAppDoaImpl.cleanup(rs, st, null); + + // test 2 + st = null; + FnAppDoaImpl.cleanup(rs, st, null); + + // test 3 + FnAppDoaImpl.cleanup(rs, st, null); + } + + @Test + public void testGetProfileCount() throws Exception { + FnAppDoaImpl testSubject; + String driver = ""; + String URL = ""; + String username = ""; + String password = ""; + int result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getProfileCount(driver, URL, username, password); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/factories/MsoRequestFactoryTest.java b/vid-app-common/src/test/java/org/onap/vid/factories/MsoRequestFactoryTest.java new file mode 100644 index 000000000..2268de8ca --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/factories/MsoRequestFactoryTest.java @@ -0,0 +1,20 @@ +package org.onap.vid.factories; + +import org.junit.Test; + +public class MsoRequestFactoryTest { + + private MsoRequestFactory createTestSubject() { + return new MsoRequestFactory(); + } + + @Test + public void testCreateMsoRequest() throws Exception { + MsoRequestFactory testSubject; + String path = ""; + + // default test + testSubject = createTestSubject(); + testSubject.createMsoRequest(path); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/logging/VidLoggerAspectTest.java b/vid-app-common/src/test/java/org/onap/vid/logging/VidLoggerAspectTest.java new file mode 100644 index 000000000..7fd9ee739 --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/logging/VidLoggerAspectTest.java @@ -0,0 +1,23 @@ +package org.onap.vid.logging; + +import org.aspectj.lang.ProceedingJoinPoint; +import org.junit.Test; +import org.onap.portalsdk.core.util.SystemProperties.SecurityEventTypeEnum; + + +public class VidLoggerAspectTest { + + private VidLoggerAspect createTestSubject() { + return new VidLoggerAspect(); + } + + @Test + public void testVidControllers() throws Exception { + VidLoggerAspect testSubject; + + // default test + testSubject = createTestSubject(); + testSubject.vidControllers(); + } + +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/roles/RoleTest.java b/vid-app-common/src/test/java/org/onap/vid/roles/RoleTest.java new file mode 100644 index 000000000..463b29f57 --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/roles/RoleTest.java @@ -0,0 +1,60 @@ +package org.onap.vid.roles; + +import org.junit.Test; + +public class RoleTest { + + private Role createTestSubject() { + return new Role(EcompRole.READ, "", "", ""); + } + + @Test + public void testGetEcompRole() throws Exception { + Role testSubject; + EcompRole result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getEcompRole(); + } + + @Test + public void testGetSubscribeName() throws Exception { + Role testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getSubscribeName(); + } + + @Test + public void testSetSubscribeName() throws Exception { + Role testSubject; + String subscribeName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setSubscribeName(subscribeName); + } + + @Test + public void testGetServiceType() throws Exception { + Role testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getServiceType(); + } + + @Test + public void testGetTenant() throws Exception { + Role testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getTenant(); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/roles/RoleValidatorTest.java b/vid-app-common/src/test/java/org/onap/vid/roles/RoleValidatorTest.java index 7a1b09ac5..b303b257c 100644 --- a/vid-app-common/src/test/java/org/onap/vid/roles/RoleValidatorTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/roles/RoleValidatorTest.java @@ -5,54 +5,55 @@ import org.onap.vid.mso.rest.RequestDetails; public class RoleValidatorTest { - private RoleValidator createTestSubject() { - return new RoleValidator(null); - } - -// @Test -// public void testIsSubscriberPermitted() throws Exception { -// RoleValidator testSubject; -// String subscriberName = ""; -// boolean result; -// -// // default test -// testSubject = createTestSubject(); -// result = testSubject.isSubscriberPermitted(subscriberName); -// } -// -// @Test -// public void testIsServicePermitted() throws Exception { -// RoleValidator testSubject; -// String subscriberName = ""; -// String serviceType = ""; -// boolean result; -// -// // default test -// testSubject = createTestSubject(); -// result = testSubject.isServicePermitted(subscriberName, serviceType); -// } - - @Test - public void testIsMsoRequestValid() throws Exception { - RoleValidator testSubject; - RequestDetails mso_request = null; - boolean result; - - // default test - testSubject = createTestSubject(); - result = testSubject.isMsoRequestValid(mso_request); - } - -// @Test -// public void testIsTenantPermitted() throws Exception { -// RoleValidator testSubject; -// String globalCustomerId = ""; -// String serviceType = ""; -// String tenant = ""; -// boolean result; -// -// // default test -// testSubject = createTestSubject(); -// result = testSubject.isTenantPermitted(globalCustomerId, serviceType, tenant); -// } + private RoleValidator createTestSubject() { + return new RoleValidator(null); + } + + @Test + public void testIsMsoRequestValid() throws Exception { + RoleValidator testSubject; + RequestDetails mso_request = null; + boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.isMsoRequestValid(mso_request); + } + + @Test + public void testIsServicePermitted() throws Exception { + RoleValidator testSubject; + String subscriberName = ""; + String serviceType = ""; + boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.isServicePermitted(subscriberName, serviceType); + } + + @Test + public void testIsSubscriberPermitted() throws Exception { + RoleValidator testSubject; + String subscriberName = ""; + boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.isSubscriberPermitted(subscriberName); + } + + @Test + public void testIsTenantPermitted() throws Exception { + RoleValidator testSubject; + String globalCustomerId = ""; + String serviceType = ""; + String tenantName = ""; + boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.isTenantPermitted(globalCustomerId, serviceType, tenantName); + } + } \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/scheduler/RestObjectTest.java b/vid-app-common/src/test/java/org/onap/vid/scheduler/RestObjectTest.java new file mode 100644 index 000000000..e3f01ba00 --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/scheduler/RestObjectTest.java @@ -0,0 +1,70 @@ +package org.onap.vid.scheduler; + +import org.apache.poi.hssf.record.formula.functions.T; +import org.junit.Test; + +public class RestObjectTest { + + private RestObject createTestSubject() { + return new RestObject(); + } + + @Test + public void testSet() throws Exception { + RestObject testSubject; + T t = null; + + // default test + testSubject = createTestSubject(); + testSubject.set(t); + } + + @Test + public void testGet() throws Exception { + RestObject testSubject; + + // default test + testSubject = createTestSubject(); + testSubject.get(); + } + + @Test + public void testSetStatusCode() throws Exception { + RestObject testSubject; + int v = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setStatusCode(v); + } + + @Test + public void testGetStatusCode() throws Exception { + RestObject testSubject; + int result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getStatusCode(); + } + + @Test + public void testSetUUID() throws Exception { + RestObject testSubject; + String uuid = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setUUID(uuid); + } + + @Test + public void testGetUUID() throws Exception { + RestObject testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getUUID(); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/scheduler/SchedulerRestInterfaceFactoryTest.java b/vid-app-common/src/test/java/org/onap/vid/scheduler/SchedulerRestInterfaceFactoryTest.java new file mode 100644 index 000000000..08cdd5f1a --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/scheduler/SchedulerRestInterfaceFactoryTest.java @@ -0,0 +1,18 @@ +package org.onap.vid.scheduler; + +import org.junit.Test; + +public class SchedulerRestInterfaceFactoryTest { + + private SchedulerRestInterfaceFactory createTestSubject() { + return new SchedulerRestInterfaceFactory(); + } + + @Test + public void testGetInstance() throws Exception { + SchedulerRestInterfaceIfc result; + + // default test + result = SchedulerRestInterfaceFactory.getInstance(); + } +} \ No newline at end of file diff --git a/vid-app-common/src/test/java/org/onap/vid/utils/LoggingTest.java b/vid-app-common/src/test/java/org/onap/vid/utils/LoggingTest.java new file mode 100644 index 000000000..40f4c876f --- /dev/null +++ b/vid-app-common/src/test/java/org/onap/vid/utils/LoggingTest.java @@ -0,0 +1,43 @@ +package org.onap.vid.utils; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.poi.hssf.record.formula.functions.T; +import org.junit.Test; +import org.springframework.http.HttpMethod; + +import com.att.eelf.configuration.EELFLogger; + +public class LoggingTest { + + private Logging createTestSubject() { + return new Logging(); + } + + @Test + public void testGetMethodName() throws Exception { + String result; + + // default test + result = Logging.getMethodName(); + } + + @Test + public void testGetMethodCallerName() throws Exception { + String result; + + // default test + result = Logging.getMethodCallerName(); + } + + @Test + public void testGetRequestsLogger() throws Exception { + String serverName = ""; + EELFLogger result; + + // default test + result = Logging.getRequestsLogger(serverName); + } + + +} \ No newline at end of file -- cgit 1.2.3-korg