Raise JUnit coverage asdctool
Change-Id: I26742875e8e3dddb98b525c4833588bc23d81fdc
Issue-ID: SDC-1296
Signed-off-by: Tal Gitelman <tg851x@intl.att.com>
diff --git a/.gitignore b/.gitignore
index bd0f3d1..b68600b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -267,3 +267,6 @@
/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/init_keyspaces.cql
/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/init_schemas.cql
+
+asdctool/*.csv
+asdctool/test-output/*
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/configuration/ConfigurationUploader.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/configuration/ConfigurationUploader.java
index ac75dc8..267f209 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/configuration/ConfigurationUploader.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/configuration/ConfigurationUploader.java
@@ -1,12 +1,12 @@
package org.openecomp.sdc.asdctool.configuration;
+import java.io.File;
+
import org.openecomp.sdc.be.config.ConfigurationManager;
import org.openecomp.sdc.common.api.ConfigurationSource;
import org.openecomp.sdc.common.impl.ExternalConfiguration;
import org.openecomp.sdc.common.impl.FSConfigurationSource;
-import java.io.File;
-
public class ConfigurationUploader {
public static void uploadConfigurationFiles(String appConfigDir) {
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/configuration/mocks/es/ESCatalogDAOMock.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/configuration/mocks/es/ESCatalogDAOMock.java
index 302d20f..f4551a0 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/configuration/mocks/es/ESCatalogDAOMock.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/configuration/mocks/es/ESCatalogDAOMock.java
@@ -1,11 +1,12 @@
package org.openecomp.sdc.asdctool.configuration.mocks.es;
-import fj.data.Either;
+import java.util.List;
+
import org.openecomp.sdc.be.dao.api.ICatalogDAO;
import org.openecomp.sdc.be.dao.api.ResourceUploadStatus;
import org.openecomp.sdc.be.resources.data.ESArtifactData;
-import java.util.List;
+import fj.data.Either;
public class ESCatalogDAOMock implements ICatalogDAO {
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/configuration/mocks/es/ElasticSearchClientMock.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/configuration/mocks/es/ElasticSearchClientMock.java
index 0038a95..e9751a6 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/configuration/mocks/es/ElasticSearchClientMock.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/configuration/mocks/es/ElasticSearchClientMock.java
@@ -2,8 +2,6 @@
import org.openecomp.sdc.be.dao.es.ElasticSearchClient;
-import java.net.URISyntaxException;
-
public class ElasticSearchClientMock extends ElasticSearchClient {
@Override
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/ArtifactUuidFix.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/ArtifactUuidFix.java
index d413c3f..b44cd35 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/ArtifactUuidFix.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/ArtifactUuidFix.java
@@ -6,7 +6,6 @@
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
@@ -18,7 +17,6 @@
import org.openecomp.sdc.asdctool.impl.validator.utils.VfModuleArtifactPayloadEx;
import org.openecomp.sdc.be.components.distribution.engine.VfModuleArtifactPayload;
-import org.openecomp.sdc.be.dao.api.ActionStatus;
import org.openecomp.sdc.be.dao.cassandra.ArtifactCassandraDao;
import org.openecomp.sdc.be.dao.cassandra.CassandraOperationStatus;
import org.openecomp.sdc.be.dao.jsongraph.GraphVertex;
@@ -33,12 +31,20 @@
import org.openecomp.sdc.be.datatypes.elements.MapGroupsDataDefinition;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum;
-import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
import org.openecomp.sdc.be.impl.ComponentsUtils;
-import org.openecomp.sdc.be.model.*;
+import org.openecomp.sdc.be.model.ArtifactDefinition;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.ComponentParametersView;
+import org.openecomp.sdc.be.model.DistributionStatusEnum;
+import org.openecomp.sdc.be.model.GroupDefinition;
+import org.openecomp.sdc.be.model.GroupInstance;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.Service;
import org.openecomp.sdc.be.model.jsontitan.datamodel.TopologyTemplate;
import org.openecomp.sdc.be.model.jsontitan.datamodel.ToscaElement;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
@@ -47,7 +53,6 @@
import org.openecomp.sdc.be.model.operations.impl.DaoStatusConverter;
import org.openecomp.sdc.be.model.operations.impl.UniqueIdBuilder;
import org.openecomp.sdc.be.resources.data.ESArtifactData;
-import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
import org.openecomp.sdc.be.tosca.CsarUtils;
import org.openecomp.sdc.be.tosca.ToscaError;
import org.openecomp.sdc.be.tosca.ToscaExportHandler;
@@ -55,18 +60,15 @@
import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
import org.openecomp.sdc.common.api.ArtifactTypeEnum;
import org.openecomp.sdc.common.api.Constants;
-
import org.openecomp.sdc.common.util.GeneralUtility;
import org.openecomp.sdc.exception.ResponseFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.util.StringUtils;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
-import com.google.gson.JsonObject;
import fj.data.Either;
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/DataMigration.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/DataMigration.java
index c399e58..8b6898d 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/DataMigration.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/DataMigration.java
@@ -20,11 +20,6 @@
package org.openecomp.sdc.asdctool.impl;
-import com.carrotsearch.hppc.cursors.ObjectCursor;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.google.gson.Gson;
-import com.google.gson.reflect.TypeToken;
-import fj.data.Either;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
@@ -45,6 +40,7 @@
import java.util.Map;
import java.util.Map.Entry;
import java.util.TimeZone;
+
import org.apache.commons.lang.SystemUtils;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.cluster.metadata.IndexMetaData;
@@ -82,6 +78,13 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
+import com.carrotsearch.hppc.cursors.ObjectCursor;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
+
+import fj.data.Either;
+
/**
* Created by mlando on 5/16/2016.
*/
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/GraphMLConverter.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/GraphMLConverter.java
index b692541..2bcc8c0 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/GraphMLConverter.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/GraphMLConverter.java
@@ -61,12 +61,6 @@
import com.thinkaurelius.titan.core.TitanGraph;
import com.thinkaurelius.titan.core.TitanGraphQuery;
import com.thinkaurelius.titan.core.TitanVertex;
-//import com.tinkerpop.blueprints.Direction;
-//import com.tinkerpop.blueprints.Edge;
-//import com.tinkerpop.blueprints.Vertex;
-//import com.tinkerpop.blueprints.util.ElementHelper;
-//import com.tinkerpop.blueprints.util.io.graphson.GraphSONReader;
-//import com.tinkerpop.blueprints.util.io.graphson.GraphSONWriter;
public class GraphMLConverter {
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/ArtifactToolBL.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/ArtifactToolBL.java
index f702364..16eb0be 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/ArtifactToolBL.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/ArtifactToolBL.java
@@ -2,7 +2,6 @@
import java.util.List;
-import org.openecomp.sdc.asdctool.impl.validator.executers.ArtifactValidatorExecuter;
import org.openecomp.sdc.asdctool.impl.validator.executers.IArtifactValidatorExecuter;
import org.openecomp.sdc.asdctool.impl.validator.utils.ReportManager;
import org.slf4j.Logger;
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfiguration.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfiguration.java
index 64d6bc1..63e95d5 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfiguration.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfiguration.java
@@ -10,10 +10,6 @@
import org.openecomp.sdc.asdctool.impl.validator.tasks.artifacts.ArtifactValidationUtils;
import org.openecomp.sdc.asdctool.impl.validator.tasks.artifacts.ServiceArtifactValidationTask;
import org.openecomp.sdc.asdctool.impl.validator.tasks.artifacts.VfArtifactValidationTask;
-import org.openecomp.sdc.asdctool.impl.validator.executers.NodeToscaArtifactsValidatorExecuter;
-import org.openecomp.sdc.asdctool.impl.validator.executers.ServiceToscaArtifactsValidatorExecutor;
-import org.openecomp.sdc.asdctool.impl.validator.executers.VFToscaArtifactValidatorExecutor;
-import org.openecomp.sdc.asdctool.impl.validator.ArtifactToolBL;
import org.openecomp.sdc.asdctool.impl.validator.tasks.moduleJson.ModuleJsonTask;
import org.openecomp.sdc.asdctool.impl.validator.utils.ReportManager;
import org.openecomp.sdc.be.dao.DAOTitanStrategy;
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/ArtifactValidatorExecuter.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/ArtifactValidatorExecuter.java
index ceab832..3585474 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/ArtifactValidatorExecuter.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/ArtifactValidatorExecuter.java
@@ -1,6 +1,5 @@
package org.openecomp.sdc.asdctool.impl.validator.executers;
-import fj.data.Either;
import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -22,16 +21,16 @@
import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum;
import org.openecomp.sdc.be.dao.titan.TitanOperationStatus;
import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum;
-import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.model.ArtifactDefinition;
import org.openecomp.sdc.be.model.Component;
import org.openecomp.sdc.be.model.ComponentParametersView;
-import org.openecomp.sdc.be.model.jsontitan.operations.TopologyTemplateOperation;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
-import org.springframework.beans.factory.annotation.Autowired;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import fj.data.Either;
public class ArtifactValidatorExecuter {
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/IArtifactValidatorExecuter.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/IArtifactValidatorExecuter.java
index 30bfab1..6f9405f 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/IArtifactValidatorExecuter.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/IArtifactValidatorExecuter.java
@@ -1,14 +1,5 @@
package org.openecomp.sdc.asdctool.impl.validator.executers;
-import java.util.List;
-import java.util.Map;
-
-import org.openecomp.sdc.asdctool.impl.validator.tasks.TopologyTemplateValidationTask;
-import org.openecomp.sdc.be.dao.jsongraph.GraphVertex;
-import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
-import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum;
-
public interface IArtifactValidatorExecuter {
boolean executeValidations();
String getName();
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/NodeToscaArtifactsValidatorExecuter.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/NodeToscaArtifactsValidatorExecuter.java
index c0a2589..6715c8a 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/NodeToscaArtifactsValidatorExecuter.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/NodeToscaArtifactsValidatorExecuter.java
@@ -4,7 +4,6 @@
import java.util.List;
import java.util.Map;
-import org.openecomp.sdc.be.dao.jsongraph.GraphVertex;
import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum;
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceToscaArtifactsValidatorExecutor.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceToscaArtifactsValidatorExecutor.java
index 1dd1779..2fe5abe 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceToscaArtifactsValidatorExecutor.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceToscaArtifactsValidatorExecutor.java
@@ -4,7 +4,6 @@
import java.util.List;
import java.util.Map;
-import org.openecomp.sdc.be.dao.jsongraph.GraphVertex;
import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum;
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/VFToscaArtifactValidatorExecutor.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/VFToscaArtifactValidatorExecutor.java
index 69be96c..bc22f2e 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/VFToscaArtifactValidatorExecutor.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/VFToscaArtifactValidatorExecutor.java
@@ -4,7 +4,6 @@
import java.util.List;
import java.util.Map;
-import org.openecomp.sdc.be.dao.jsongraph.GraphVertex;
import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum;
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/ArtifactValidatorTool.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/ArtifactValidatorTool.java
index b1180f9..ba8f3be 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/ArtifactValidatorTool.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/ArtifactValidatorTool.java
@@ -3,7 +3,6 @@
import org.openecomp.sdc.asdctool.impl.validator.ArtifactToolBL;
import org.openecomp.sdc.asdctool.impl.validator.config.ValidationConfigManager;
import org.openecomp.sdc.asdctool.impl.validator.config.ValidationToolConfiguration;
-import org.openecomp.sdc.asdctool.impl.validator.utils.ReportManager;
import org.openecomp.sdc.be.config.ConfigurationManager;
import org.openecomp.sdc.common.api.ConfigurationSource;
import org.openecomp.sdc.common.impl.ExternalConfiguration;
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/GetConsumersMenu.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/GetConsumersMenu.java
index 189348a..733cc5c 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/GetConsumersMenu.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/main/GetConsumersMenu.java
@@ -1,6 +1,7 @@
package org.openecomp.sdc.asdctool.main;
-import fj.data.Either;
+import java.util.List;
+
import org.openecomp.sdc.asdctool.cli.CLIToolData;
import org.openecomp.sdc.asdctool.cli.SpringCLITool;
import org.openecomp.sdc.asdctool.configuration.GetConsumersConfiguration;
@@ -10,7 +11,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.List;
+import fj.data.Either;
public class GetConsumersMenu extends SpringCLITool {
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/config/mocks/DistributionEngineMock.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/config/mocks/DistributionEngineMock.java
index 36f6814..aa27d6e 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/config/mocks/DistributionEngineMock.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/config/mocks/DistributionEngineMock.java
@@ -1,16 +1,11 @@
package org.openecomp.sdc.asdctool.migration.config.mocks;
-import fj.data.Either;
import org.openecomp.sdc.be.components.distribution.engine.IDistributionEngine;
import org.openecomp.sdc.be.components.distribution.engine.INotificationData;
-import org.openecomp.sdc.be.components.impl.ActivationRequestInformation;
import org.openecomp.sdc.be.dao.api.ActionStatus;
-import org.openecomp.sdc.be.externalapi.servlet.representation.ServiceDistributionReqInfo;
import org.openecomp.sdc.be.model.Service;
-import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
import org.openecomp.sdc.be.resources.data.OperationalEnvironmentEntry;
-import org.openecomp.sdc.exception.ResponseFormat;
import org.springframework.stereotype.Component;
@Component("distributionEngine")
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/config/mocks/HealthCheckBusinessLogicMock.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/config/mocks/HealthCheckBusinessLogicMock.java
index c7ef45e..5e4f15c 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/config/mocks/HealthCheckBusinessLogicMock.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/config/mocks/HealthCheckBusinessLogicMock.java
@@ -1,10 +1,10 @@
package org.openecomp.sdc.asdctool.migration.config.mocks;
+import javax.annotation.PostConstruct;
+
import org.openecomp.sdc.be.components.health.HealthCheckBusinessLogic;
import org.springframework.stereotype.Component;
-import javax.annotation.PostConstruct;
-
@Component("healthCheckBusinessLogic")
public class HealthCheckBusinessLogicMock extends HealthCheckBusinessLogic {
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/resolver/MigrationResolver.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/resolver/MigrationResolver.java
index 9147ac0..22add31 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/resolver/MigrationResolver.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/resolver/MigrationResolver.java
@@ -1,7 +1,6 @@
package org.openecomp.sdc.asdctool.migration.resolver;
-import org.openecomp.sdc.asdctool.migration.core.task.IMigrationStage;
import java.util.List;
import org.openecomp.sdc.asdctool.migration.core.task.IMigrationStage;
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/resolver/SpringBeansMigrationResolver.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/resolver/SpringBeansMigrationResolver.java
index 9f2f600..182996f 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/resolver/SpringBeansMigrationResolver.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/resolver/SpringBeansMigrationResolver.java
@@ -1,10 +1,6 @@
package org.openecomp.sdc.asdctool.migration.resolver;
-import org.openecomp.sdc.asdctool.migration.core.task.IMigrationStage;
-import org.openecomp.sdc.asdctool.migration.core.task.IMigrationStage;
-import org.openecomp.sdc.asdctool.migration.core.task.PostMigration;
-import org.openecomp.sdc.asdctool.migration.core.task.PostMigration;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/tasks/mig1710/UpgradeMigration1710.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/tasks/mig1710/UpgradeMigration1710.java
index e6acb7a..9d01ab0 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/tasks/mig1710/UpgradeMigration1710.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/tasks/mig1710/UpgradeMigration1710.java
@@ -1,7 +1,14 @@
package org.openecomp.sdc.asdctool.migration.tasks.mig1710;
-import com.google.common.collect.Lists;
-import fj.data.Either;
+import java.util.ArrayList;
+import java.util.EnumMap;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.function.Predicate;
+import java.util.stream.Collectors;
+
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
@@ -44,16 +51,10 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-import java.util.ArrayList;
-import java.util.EnumMap;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.function.Predicate;
-import java.util.stream.Collectors;
+import com.google.common.collect.Lists;
+
+import fj.data.Either;
//@Component
public class UpgradeMigration1710 implements PostMigration {
diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/tasks/mig1802/SdcCatalogMigration.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/tasks/mig1802/SdcCatalogMigration.java
index 9cbb7ec..542db17 100644
--- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/tasks/mig1802/SdcCatalogMigration.java
+++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/tasks/mig1802/SdcCatalogMigration.java
@@ -1,6 +1,10 @@
package org.openecomp.sdc.asdctool.migration.tasks.mig1802;
-import fj.data.Either;
+import java.math.BigInteger;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
import org.apache.commons.collections.ListUtils;
import org.apache.tinkerpop.gremlin.structure.Direction;
import org.openecomp.sdc.asdctool.migration.core.DBVersion;
@@ -21,10 +25,7 @@
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
-import java.math.BigInteger;
-import java.util.Arrays;
-import java.util.List;
-import java.util.stream.Collectors;
+import fj.data.Either;
@Component
public class SdcCatalogMigration implements Migration {
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/UtilsTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/UtilsTest.java
new file mode 100644
index 0000000..ac93b92
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/UtilsTest.java
@@ -0,0 +1,101 @@
+package org.openecomp.sdc.asdctool;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.ws.rs.core.Response;
+
+import org.apache.commons.configuration.Configuration;
+import org.apache.tinkerpop.gremlin.structure.Element;
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.thinkaurelius.titan.core.TitanGraph;
+
+public class UtilsTest {
+
+ /*
+ * private Utils createTestSubject() { return new Utils(); }
+ */
+
+ @Test
+ public void testBuildOkResponse() throws Exception {
+ int status = 0;
+ Object entity = null;
+ Map<String, String> additionalHeaders = null;
+ Response result;
+
+ // test with mock entity
+ Object mockEntity = new Object();
+ result = Utils.buildOkResponse(status, entity, additionalHeaders);
+ Assert.assertNotNull(result);
+
+ // test with mock headers
+ Map<String, String> mockAdditionalHeaders = new HashMap<>();
+ mockAdditionalHeaders.put("stam", "stam");
+ result = Utils.buildOkResponse(status, mockEntity, mockAdditionalHeaders);
+ Assert.assertNotNull(result);
+ }
+
+ @Test
+ public void testOpenGraph() throws Exception {
+ Configuration conf = null;
+ TitanGraph result;
+
+ // default test with null
+ result = Utils.openGraph(conf);
+ }
+
+ @Test
+ public void testVertexLeftContainsRightProps() throws Exception {
+ Map<String, Object> leftProps = new HashMap<>();
+ Map<String, Object> rightProps = null;
+ boolean result;
+
+ // test 1 with null
+ rightProps = null;
+ result = Utils.vertexLeftContainsRightProps(leftProps, rightProps);
+ Assert.assertEquals(true, result);
+
+ // test 2 with mocks
+ Map<String, Object> mockLeftProps = new HashMap<>();
+ mockLeftProps.put("stam", new Object());
+ Map<String, Object> mockRightProps = new HashMap<>();
+ mockRightProps.put("stam", new Object());
+ result = Utils.vertexLeftContainsRightProps(mockLeftProps, mockRightProps);
+ Assert.assertEquals(false, result);
+
+ // test 3 with mocks
+ Object mockObject = new Object();
+ mockLeftProps = new HashMap<>();
+ mockLeftProps.put("stam", mockObject);
+ mockRightProps = new HashMap<>();
+ mockRightProps.put("stam", mockObject);
+ result = Utils.vertexLeftContainsRightProps(mockLeftProps, mockRightProps);
+ Assert.assertEquals(true, result);
+ }
+
+ @Test(expected=IllegalArgumentException.class)
+ public void testSetProperties() throws Exception {
+ Element element = null;
+ Map<String, Object> properties = null;
+
+ // test 1
+ properties = null;
+ Utils.setProperties(element, properties);
+
+ // test 2
+ properties = new HashMap<>();
+ properties.put("stam", new Object());
+ Utils.setProperties(element, properties);
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testGetProperties() throws Exception {
+ Element element = null;
+ Map<String, Object> result;
+
+ // default test
+ result = Utils.getProperties(element);
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/cli/CLIUtilsTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/cli/CLIUtilsTest.java
new file mode 100644
index 0000000..f49b2c7
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/cli/CLIUtilsTest.java
@@ -0,0 +1,15 @@
+package org.openecomp.sdc.asdctool.cli;
+
+import org.apache.commons.cli.Option;
+import org.junit.Test;
+
+public class CLIUtilsTest {
+
+ @Test
+ public void testGetConfigurationPathOption() throws Exception {
+ Option result;
+
+ // default test
+ result = CLIUtils.getConfigurationPathOption();
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/configuration/ArtifactUUIDFixConfigurationTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/configuration/ArtifactUUIDFixConfigurationTest.java
new file mode 100644
index 0000000..0281055
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/configuration/ArtifactUUIDFixConfigurationTest.java
@@ -0,0 +1,42 @@
+package org.openecomp.sdc.asdctool.configuration;
+
+import org.junit.Test;
+import org.openecomp.sdc.asdctool.impl.ArtifactUuidFix;
+import org.openecomp.sdc.be.components.distribution.engine.ServiceDistributionArtifactsBuilder;
+import org.springframework.beans.factory.config.PropertiesFactoryBean;
+
+public class ArtifactUUIDFixConfigurationTest {
+
+ private ArtifactUUIDFixConfiguration createTestSubject() {
+ return new ArtifactUUIDFixConfiguration();
+ }
+
+ @Test
+ public void testArtifactUuidFix() throws Exception {
+ ArtifactUUIDFixConfiguration testSubject;
+ ArtifactUuidFix result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.artifactUuidFix();
+ }
+
+ @Test
+ public void testServiceDistributionArtifactsBuilder() throws Exception {
+ ArtifactUUIDFixConfiguration testSubject;
+ ServiceDistributionArtifactsBuilder result;
+
+ // default test
+ testSubject = createTestSubject();
+ }
+
+ @Test
+ public void testMapper() throws Exception {
+ ArtifactUUIDFixConfiguration testSubject;
+ PropertiesFactoryBean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.mapper();
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/configuration/ConfigurationUploaderTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/configuration/ConfigurationUploaderTest.java
new file mode 100644
index 0000000..6a65165
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/configuration/ConfigurationUploaderTest.java
@@ -0,0 +1,18 @@
+package org.openecomp.sdc.asdctool.configuration;
+
+import org.junit.Test;
+
+public class ConfigurationUploaderTest {
+
+ private ConfigurationUploader createTestSubject() {
+ return new ConfigurationUploader();
+ }
+
+ @Test
+ public void testUploadConfigurationFiles() throws Exception {
+ String appConfigDir = "src/main/resources/config/";
+
+ // default test
+ ConfigurationUploader.uploadConfigurationFiles(appConfigDir);
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/configuration/GetConsumersConfigurationTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/configuration/GetConsumersConfigurationTest.java
new file mode 100644
index 0000000..5495d11
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/configuration/GetConsumersConfigurationTest.java
@@ -0,0 +1,23 @@
+package org.openecomp.sdc.asdctool.configuration;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.dao.titan.TitanGenericDao;
+import org.openecomp.sdc.be.model.operations.impl.ConsumerOperation;
+
+public class GetConsumersConfigurationTest {
+
+ private GetConsumersConfiguration createTestSubject() {
+ return new GetConsumersConfiguration();
+ }
+
+ @Test
+ public void testConsumerOperation() throws Exception {
+ GetConsumersConfiguration testSubject;
+ TitanGenericDao titanGenericDao = null;
+ ConsumerOperation result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.consumerOperation(titanGenericDao);
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/configuration/mocks/es/ESCatalogDAOMockTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/configuration/mocks/es/ESCatalogDAOMockTest.java
new file mode 100644
index 0000000..86ee638
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/configuration/mocks/es/ESCatalogDAOMockTest.java
@@ -0,0 +1,78 @@
+package org.openecomp.sdc.asdctool.configuration.mocks.es;
+
+import java.util.List;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.dao.api.ResourceUploadStatus;
+import org.openecomp.sdc.be.resources.data.ESArtifactData;
+
+import fj.data.Either;
+
+public class ESCatalogDAOMockTest {
+
+ private ESCatalogDAOMock createTestSubject() {
+ return new ESCatalogDAOMock();
+ }
+
+ @Test
+ public void testAddToIndicesMap() throws Exception {
+ ESCatalogDAOMock testSubject;
+ String typeName = "";
+ String indexName = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.addToIndicesMap(typeName, indexName);
+ }
+
+ @Test
+ public void testWriteArtifact() throws Exception {
+ ESCatalogDAOMock testSubject;
+ ESArtifactData artifactData = null;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.writeArtifact(artifactData);
+ }
+
+ @Test
+ public void testGetArtifact() throws Exception {
+ ESCatalogDAOMock testSubject;
+ String id = "";
+ Either<ESArtifactData, ResourceUploadStatus> result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getArtifact(id);
+ }
+
+ @Test
+ public void testGetArtifacts() throws Exception {
+ ESCatalogDAOMock testSubject;
+ String[] ids = new String[] { "" };
+ Either<List<ESArtifactData>, ResourceUploadStatus> result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getArtifacts(ids);
+ }
+
+ @Test
+ public void testDeleteArtifact() throws Exception {
+ ESCatalogDAOMock testSubject;
+ String id = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.deleteArtifact(id);
+ }
+
+ @Test
+ public void testDeleteAllArtifacts() throws Exception {
+ ESCatalogDAOMock testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.deleteAllArtifacts();
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/configuration/mocks/es/ElasticSearchClientMockTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/configuration/mocks/es/ElasticSearchClientMockTest.java
new file mode 100644
index 0000000..e0add2c
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/configuration/mocks/es/ElasticSearchClientMockTest.java
@@ -0,0 +1,49 @@
+package org.openecomp.sdc.asdctool.configuration.mocks.es;
+
+import org.junit.Test;
+
+public class ElasticSearchClientMockTest {
+
+ private ElasticSearchClientMock createTestSubject() {
+ return new ElasticSearchClientMock();
+ }
+
+ @Test
+ public void testInitialize() throws Exception {
+ ElasticSearchClientMock testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.initialize();
+ }
+
+ @Test
+ public void testSetClusterName() throws Exception {
+ ElasticSearchClientMock testSubject;
+ String clusterName = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setClusterName(clusterName);
+ }
+
+ @Test
+ public void testSetLocal() throws Exception {
+ ElasticSearchClientMock testSubject;
+ String strIsLocal = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setLocal(strIsLocal);
+ }
+
+ @Test
+ public void testSetTransportClient() throws Exception {
+ ElasticSearchClientMock testSubject;
+ String strIsTransportclient = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setTransportClient(strIsTransportclient);
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/configuration/mocks/es/ElasticSearchMocksConfigurationTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/configuration/mocks/es/ElasticSearchMocksConfigurationTest.java
new file mode 100644
index 0000000..90af077
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/configuration/mocks/es/ElasticSearchMocksConfigurationTest.java
@@ -0,0 +1,43 @@
+package org.openecomp.sdc.asdctool.configuration.mocks.es;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.dao.api.ICatalogDAO;
+import org.openecomp.sdc.be.dao.api.IEsHealthCheckDao;
+import org.openecomp.sdc.be.dao.es.ElasticSearchClient;
+
+public class ElasticSearchMocksConfigurationTest {
+
+ private ElasticSearchMocksConfiguration createTestSubject() {
+ return new ElasticSearchMocksConfiguration();
+ }
+
+ @Test
+ public void testElasticSearchClientMock() throws Exception {
+ ElasticSearchMocksConfiguration testSubject;
+ ElasticSearchClient result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.elasticSearchClientMock();
+ }
+
+ @Test
+ public void testEsCatalogDAOMock() throws Exception {
+ ElasticSearchMocksConfiguration testSubject;
+ ICatalogDAO result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.esCatalogDAOMock();
+ }
+
+ @Test
+ public void testEsHealthCheckDaoMock() throws Exception {
+ ElasticSearchMocksConfiguration testSubject;
+ IEsHealthCheckDao result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.esHealthCheckDaoMock();
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/configuration/mocks/es/EsHealthCheckDaoMockTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/configuration/mocks/es/EsHealthCheckDaoMockTest.java
new file mode 100644
index 0000000..dd761b4
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/configuration/mocks/es/EsHealthCheckDaoMockTest.java
@@ -0,0 +1,21 @@
+package org.openecomp.sdc.asdctool.configuration.mocks.es;
+
+import org.junit.Test;
+import org.openecomp.sdc.common.api.HealthCheckInfo.HealthCheckStatus;
+
+public class EsHealthCheckDaoMockTest {
+
+ private EsHealthCheckDaoMock createTestSubject() {
+ return new EsHealthCheckDaoMock();
+ }
+
+ @Test
+ public void testGetClusterHealthStatus() throws Exception {
+ EsHealthCheckDaoMock testSubject;
+ HealthCheckStatus result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getClusterHealthStatus();
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/enums/SchemaZipFileEnumTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/enums/SchemaZipFileEnumTest.java
index 307d7a0..2d1c6a8 100644
--- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/enums/SchemaZipFileEnumTest.java
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/enums/SchemaZipFileEnumTest.java
@@ -1,12 +1,12 @@
package org.openecomp.sdc.asdctool.enums;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import static org.junit.Assert.*;
-
-
public class SchemaZipFileEnumTest {
private SchemaZipFileEnum testSubject;
@@ -50,19 +50,119 @@
testSubject.setCollectionTitle(collectionTitle);
assertEquals(collectionTitle, testSubject.getCollectionTitle());
}
-
+
@Test
public void setGetImportFileList_shouldSetGetFile1File2() {
String[] importFileList = new String[] { "File1", "File2" };
String[] receivedImportFileList;
testSubject.setImportFileList(importFileList);
- receivedImportFileList = testSubject.getImportFileList();
+ receivedImportFileList = testSubject.getImportFileList();
assertNotNull(receivedImportFileList);
assertEquals("File1", receivedImportFileList[0]);
assertEquals("File2", receivedImportFileList[1]);
}
private SchemaZipFileEnum createTestSubject() {
- return SchemaZipFileEnum.DATA;
+ return SchemaZipFileEnum.DATA;
+ }
+
+ @Test
+ public void testGetFileName() throws Exception {
+ SchemaZipFileEnum testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getFileName();
+ }
+
+ @Test
+ public void testSetFileName() throws Exception {
+ SchemaZipFileEnum testSubject;
+ String fileName = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setFileName(fileName);
+ }
+
+ @Test
+ public void testGetSourceFolderName() throws Exception {
+ SchemaZipFileEnum testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getSourceFolderName();
+ }
+
+ @Test
+ public void testSetSourceFolderName() throws Exception {
+ SchemaZipFileEnum testSubject;
+ String sourceFolderName = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setSourceFolderName(sourceFolderName);
+ }
+
+ @Test
+ public void testGetSourceFileName() throws Exception {
+ SchemaZipFileEnum testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getSourceFileName();
+ }
+
+ @Test
+ public void testSetSourceFileName() throws Exception {
+ SchemaZipFileEnum testSubject;
+ String sourceFileName = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setSourceFileName(sourceFileName);
+ }
+
+ @Test
+ public void testGetCollectionTitle() throws Exception {
+ SchemaZipFileEnum testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getCollectionTitle();
+ }
+
+ @Test
+ public void testSetCollectionTitle() throws Exception {
+ SchemaZipFileEnum testSubject;
+ String collectionTitle = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setCollectionTitle(collectionTitle);
+ }
+
+ @Test
+ public void testGetImportFileList() throws Exception {
+ SchemaZipFileEnum testSubject;
+ String[] result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getImportFileList();
+ }
+
+ @Test
+ public void testSetImportFileList() throws Exception {
+ SchemaZipFileEnum testSubject;
+ String[] importFileList = new String[] { "" };
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setImportFileList(importFileList);
}
}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/ArtifactUuidFixTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/ArtifactUuidFixTest.java
new file mode 100644
index 0000000..d8fec34
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/ArtifactUuidFixTest.java
@@ -0,0 +1,92 @@
+package org.openecomp.sdc.asdctool.impl;
+
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum;
+import org.openecomp.sdc.be.model.Component;
+
+public class ArtifactUuidFixTest {
+
+ private ArtifactUuidFix createTestSubject() {
+ return new ArtifactUuidFix();
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testDoFix() throws Exception {
+ ArtifactUuidFix testSubject;
+ String fixComponent = "";
+ String runMode = "";
+ boolean result;
+
+ // test 1
+ testSubject = createTestSubject();
+ fixComponent = "vf_only";
+ result = testSubject.doFix(fixComponent, runMode);
+ Assert.assertEquals(false, result);
+
+ // test 2
+ testSubject = createTestSubject();
+ runMode = "service_vf";
+ result = testSubject.doFix(fixComponent, runMode);
+ Assert.assertEquals(false, result);
+
+ // test 3
+ testSubject = createTestSubject();
+ runMode = "fix";
+ result = testSubject.doFix(fixComponent, runMode);
+ Assert.assertEquals(false, result);
+
+ // test 4
+ testSubject = createTestSubject();
+ runMode = "fix";
+ result = testSubject.doFix(fixComponent, runMode);
+ Assert.assertEquals(false, result);
+
+ // test 5
+ testSubject = createTestSubject();
+ runMode = "fix_only_services";
+ result = testSubject.doFix(fixComponent, runMode);
+ Assert.assertEquals(false, result);
+ }
+
+ @Test
+ public void testDoFixTosca() throws Exception {
+ ArtifactUuidFix testSubject;
+ Map<String, List<Component>> nodeToFix = null;
+ Map<String, List<Component>> vfToFix = null;
+ Map<String, List<Component>> serviceToFix = null;
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testGetVerticesToValidate() throws Exception {
+ ArtifactUuidFix testSubject;
+ VertexTypeEnum type = null;
+ Map<GraphPropertyEnum, Object> hasProps = null;
+ Map<String, List<Component>> result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getVerticesToValidate(type, hasProps);
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testValidateTosca() throws Exception {
+ ArtifactUuidFix testSubject;
+ Map<String, List<Component>> vertices = null;
+ Map<String, List<Component>> compToFix = null;
+ String name = "";
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.validateTosca(vertices, compToFix, name);
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/DataMigrationTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/DataMigrationTest.java
new file mode 100644
index 0000000..af93fc2
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/DataMigrationTest.java
@@ -0,0 +1,61 @@
+package org.openecomp.sdc.asdctool.impl;
+
+import java.text.SimpleDateFormat;
+import java.util.EnumMap;
+import java.util.TimeZone;
+
+import org.elasticsearch.common.settings.SettingsException;
+import org.junit.Test;
+import org.openecomp.sdc.asdctool.impl.DataMigration.TypeToTableMapping;
+import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
+import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum;
+
+public class DataMigrationTest {
+
+ private DataMigration createTestSubject() {
+ return new DataMigration();
+ }
+
+ /*@Test(expected=IllegalArgumentException.class)
+ public void testMigrateDataEsToCassandra() throws Exception {
+ DataMigration testSubject;
+ String appConfigDir = "src/main/resources/config/";
+ boolean exportFromEs = false;
+ boolean importToCassandra = false;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.migrateDataEsToCassandra(appConfigDir, exportFromEs, importToCassandra);
+ }*/
+
+ @Test(expected=NullPointerException.class)
+ public void testCreateAuditRecord() throws Exception {
+ DataMigration testSubject;
+
+ EnumMap<AuditingFieldsKeysEnum, Object> auditingFields = new EnumMap<AuditingFieldsKeysEnum, Object>(AuditingFieldsKeysEnum.class);
+ auditingFields.put(AuditingFieldsKeysEnum.AUDIT_ACTION, AuditingActionEnum.GET_CATEGORY_HIERARCHY.getName());
+
+ String DATE_FORMAT_PATTERN = "yyyy-MM-dd HH:mm:ss.SSS z";
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_FORMAT_PATTERN);
+ simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
+
+ auditingFields.put(AuditingFieldsKeysEnum.AUDIT_TIMESTAMP, "2018-05-02 06:06:18.294 UTC");
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.createAuditRecord(auditingFields);
+ }
+
+ @Test
+ public void testTypeToTableMapping() throws Exception {
+ TypeToTableMapping[] values = TypeToTableMapping.values();
+
+ for (TypeToTableMapping typeToTableMapping : values) {
+ TypeToTableMapping.getTableByType(typeToTableMapping.getTypeName());
+ typeToTableMapping.getTable();
+
+ }
+
+ TypeToTableMapping.getTableByType("stam");
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/EsToCassandraDataMigrationConfigTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/EsToCassandraDataMigrationConfigTest.java
new file mode 100644
index 0000000..cb4d2b7
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/EsToCassandraDataMigrationConfigTest.java
@@ -0,0 +1,64 @@
+package org.openecomp.sdc.asdctool.impl;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.dao.cassandra.ArtifactCassandraDao;
+import org.openecomp.sdc.be.dao.cassandra.AuditCassandraDao;
+import org.openecomp.sdc.be.dao.cassandra.CassandraClient;
+import org.openecomp.sdc.be.dao.cassandra.SdcSchemaFilesCassandraDao;
+
+public class EsToCassandraDataMigrationConfigTest {
+
+ private EsToCassandraDataMigrationConfig createTestSubject() {
+ return new EsToCassandraDataMigrationConfig();
+ }
+
+ @Test
+ public void testDataMigration() throws Exception {
+ EsToCassandraDataMigrationConfig testSubject;
+ DataMigration result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.dataMigration();
+ }
+
+ @Test
+ public void testArtifactCassandraDao() throws Exception {
+ EsToCassandraDataMigrationConfig testSubject;
+ ArtifactCassandraDao result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.artifactCassandraDao();
+ }
+
+ @Test
+ public void testAuditCassandraDao() throws Exception {
+ EsToCassandraDataMigrationConfig testSubject;
+ AuditCassandraDao result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.auditCassandraDao();
+ }
+
+ @Test
+ public void testCassandraClient() throws Exception {
+ EsToCassandraDataMigrationConfig testSubject;
+ CassandraClient result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.cassandraClient();
+ }
+
+ @Test
+ public void testSdcSchemaFilesCassandraDao() throws Exception {
+ EsToCassandraDataMigrationConfig testSubject;
+ SdcSchemaFilesCassandraDao result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.sdcSchemaFilesCassandraDao();
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/GraphJsonValidatorTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/GraphJsonValidatorTest.java
new file mode 100644
index 0000000..51dfca3
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/GraphJsonValidatorTest.java
@@ -0,0 +1,42 @@
+package org.openecomp.sdc.asdctool.impl;
+
+import java.nio.file.NoSuchFileException;
+
+import org.junit.Test;
+
+public class GraphJsonValidatorTest {
+
+ private GraphJsonValidator createTestSubject() {
+ return new GraphJsonValidator();
+ }
+
+ @Test
+ public void testVerifyTitanJson() throws Exception {
+ GraphJsonValidator testSubject;
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.verifyTitanJson("src/test/resources/graph.json");
+ }
+
+ @Test
+ public void testVerifyTitanJsonErrorFile() throws Exception {
+ GraphJsonValidator testSubject;
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.verifyTitanJson("src/test/resources/graphError.json");
+ }
+
+ @Test(expected=NoSuchFileException.class)
+ public void testVerifyTitanJsonNoFile() throws Exception {
+ GraphJsonValidator testSubject;
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.verifyTitanJson("stam");
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/GraphMLConverterTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/GraphMLConverterTest.java
new file mode 100644
index 0000000..3f5d3e1
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/GraphMLConverterTest.java
@@ -0,0 +1,175 @@
+package org.openecomp.sdc.asdctool.impl;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.apache.tinkerpop.gremlin.structure.Element;
+import org.junit.Test;
+
+import com.thinkaurelius.titan.core.TitanGraph;
+
+public class GraphMLConverterTest {
+
+ public GraphMLConverter createTestSubject() {
+ return new GraphMLConverter();
+ }
+
+ /*@Before
+ public void createGraphTestSubject() {
+ converter = new GraphMLConverter();
+ openGraph = converter.openGraph("src/main/resources/config/titan.properties");
+ }*/
+
+ /*@After
+ public void destroyGraphTestSubject() {
+ converter = new GraphMLConverter();
+ converter.clearGraph(openGraph);
+ }*/
+
+ @Test
+ public void testImportGraph() throws Exception {
+ GraphMLConverter testSubject;
+ String[] args = new String[] { "" };
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.importGraph(args);
+ }
+
+ @Test
+ public void testExportGraph() throws Exception {
+ GraphMLConverter testSubject;
+ String[] args = new String[] { "" };
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.exportGraph(args);
+ }
+
+ @Test
+ public void testExportGraphMl() throws Exception {
+ GraphMLConverter testSubject;
+ String[] args = new String[] { "" };
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.exportGraphMl(args);
+ }
+
+ @Test
+ public void testFindErrorInJsonGraph() throws Exception {
+ GraphMLConverter testSubject;
+ String[] args = new String[] { "" };
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.findErrorInJsonGraph(args);
+ }
+
+ @Test(expected=IllegalArgumentException.class)
+ public void testOpenGraph() throws Exception {
+ GraphMLConverter testSubject;
+ String titanFileLocation = "";
+ TitanGraph result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.openGraph("src/main/resources/config/titan.properties");
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testExportJsonGraph() throws Exception {
+ GraphMLConverter testSubject;
+ TitanGraph graph = null;
+ String outputDirectory = "";
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.exportJsonGraph(graph, outputDirectory);
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testExportGraphMl_1() throws Exception {
+ GraphMLConverter testSubject;
+ TitanGraph graph = null;
+ String outputDirectory = "";
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.exportGraphMl(graph, outputDirectory);
+ }
+
+ @Test
+ public void testImportJsonGraph() throws Exception {
+ GraphMLConverter testSubject;
+ TitanGraph graph = null;
+ String graphJsonFile = "";
+ List<ImmutablePair<String, String>> propertiesCriteriaToDelete = null;
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.importJsonGraph(graph, graphJsonFile, propertiesCriteriaToDelete);
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testFindErrorInJsonGraph_1() throws Exception {
+ GraphMLConverter testSubject;
+ TitanGraph graph = null;
+ String outputDirectory = "";
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.findErrorInJsonGraph(graph, outputDirectory);
+ }
+
+ @Test
+ public void testClearGraph() throws Exception {
+ TitanGraph graph = null;
+
+ // default test
+ //GraphMLConverter.clearGraph("src/main/resources/config/titan.properties");
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testExportUsers() throws Exception {
+ GraphMLConverter testSubject;
+ TitanGraph graph = null;
+ String outputDirectory = "";
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.exportUsers(graph, outputDirectory);
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testGetProperties() throws Exception {
+ GraphMLConverter testSubject;
+ Element element = null;
+ Map<String, Object> result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getProperties(element);
+ }
+
+ @Test
+ public void testExportUsers_1() throws Exception {
+ GraphMLConverter testSubject;
+ String[] args = new String[] { "" };
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.exportUsers(args);
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/GraphMLDataAnalyzerTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/GraphMLDataAnalyzerTest.java
new file mode 100644
index 0000000..c6905a9
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/GraphMLDataAnalyzerTest.java
@@ -0,0 +1,21 @@
+package org.openecomp.sdc.asdctool.impl;
+
+import org.junit.Test;
+
+public class GraphMLDataAnalyzerTest {
+
+ private GraphMLDataAnalyzer createTestSubject() {
+ return new GraphMLDataAnalyzer();
+ }
+
+ @Test
+ public void testAnalyzeGraphMLData() throws Exception {
+ GraphMLDataAnalyzer testSubject;
+ String[] args = new String[] { "export", "src/main/resources/config/titan.properties", "./" };
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.analyzeGraphMLData(args);
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/ProductLogicTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/ProductLogicTest.java
new file mode 100644
index 0000000..08de0eb
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/ProductLogicTest.java
@@ -0,0 +1,24 @@
+package org.openecomp.sdc.asdctool.impl;
+
+import org.junit.Test;
+
+public class ProductLogicTest {
+
+ private ProductLogic createTestSubject() {
+ return new ProductLogic();
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testDeleteAllProducts() throws Exception {
+ ProductLogic testSubject;
+ String titanFile = "";
+ String beHost = "";
+ String bePort = "";
+ String adminUser = "";
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.deleteAllProducts(titanFile, beHost, bePort, adminUser);
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/RestUtilsTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/RestUtilsTest.java
new file mode 100644
index 0000000..c111191
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/RestUtilsTest.java
@@ -0,0 +1,24 @@
+package org.openecomp.sdc.asdctool.impl;
+
+import org.junit.Test;
+
+public class RestUtilsTest {
+
+ private RestUtils createTestSubject() {
+ return new RestUtils();
+ }
+
+ @Test
+ public void testDeleteProduct() throws Exception {
+ RestUtils testSubject;
+ String productUid = "";
+ String beHost = "";
+ String bePort = "";
+ String adminUser = "";
+ Integer result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.deleteProduct(productUid, beHost, bePort, adminUser);
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/TitanGraphInitializerTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/TitanGraphInitializerTest.java
new file mode 100644
index 0000000..431c59f
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/TitanGraphInitializerTest.java
@@ -0,0 +1,16 @@
+package org.openecomp.sdc.asdctool.impl;
+
+import org.junit.Test;
+
+public class TitanGraphInitializerTest {
+
+ @Test(expected=IllegalArgumentException.class)
+ public void testCreateGraph() throws Exception {
+ String titanCfgFile = "";
+ boolean result;
+
+ // default test
+ result = TitanGraphInitializer.createGraph("");
+
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/UpdatePropertyOnVertexTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/UpdatePropertyOnVertexTest.java
new file mode 100644
index 0000000..503f52a
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/UpdatePropertyOnVertexTest.java
@@ -0,0 +1,39 @@
+package org.openecomp.sdc.asdctool.impl;
+
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Test;
+
+import com.thinkaurelius.titan.core.TitanGraph;
+
+public class UpdatePropertyOnVertexTest {
+
+ private UpdatePropertyOnVertex createTestSubject() {
+ return new UpdatePropertyOnVertex();
+ }
+
+ @Test(expected=IllegalArgumentException.class)
+ public void testOpenGraph() throws Exception {
+ UpdatePropertyOnVertex testSubject;
+ String titanFileLocation = "";
+ TitanGraph result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.openGraph("");
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testUpdatePropertyOnServiceAtLeastCertified() throws Exception {
+ UpdatePropertyOnVertex testSubject;
+ String titanFile = "";
+ Map<String, Object> keyValueToSet = null;
+ List<Map<String, Object>> orCriteria = null;
+ Integer result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.updatePropertyOnServiceAtLeastCertified(titanFile, keyValueToSet, orCriteria);
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/ArtifactToolBLTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/ArtifactToolBLTest.java
new file mode 100644
index 0000000..32aec78
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/ArtifactToolBLTest.java
@@ -0,0 +1,26 @@
+package org.openecomp.sdc.asdctool.impl.validator;
+
+import java.util.LinkedList;
+
+import org.junit.Test;
+import org.openecomp.sdc.asdctool.impl.validator.executers.NodeToscaArtifactsValidatorExecuter;
+
+public class ArtifactToolBLTest {
+
+ private ArtifactToolBL createTestSubject() {
+ return new ArtifactToolBL();
+ }
+
+ //Generated test
+ @Test(expected=NullPointerException.class)
+ public void testValidateAll() throws Exception {
+ ArtifactToolBL testSubject;
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.validators = new LinkedList();
+ testSubject.validators.add(new NodeToscaArtifactsValidatorExecuter());
+ result = testSubject.validateAll();
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/ValidationToolBLTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/ValidationToolBLTest.java
new file mode 100644
index 0000000..bb74c70
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/ValidationToolBLTest.java
@@ -0,0 +1,25 @@
+package org.openecomp.sdc.asdctool.impl.validator;
+
+import java.util.LinkedList;
+
+import org.junit.Test;
+import org.openecomp.sdc.asdctool.impl.validator.executers.ServiceValidatorExecuter;
+
+public class ValidationToolBLTest {
+
+ private ValidationToolBL createTestSubject() {
+ return new ValidationToolBL();
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testValidateAll() throws Exception {
+ ValidationToolBL testSubject;
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.validators = new LinkedList<>();
+ testSubject.validators.add(new ServiceValidatorExecuter());
+ result = testSubject.validateAll();
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationConfigManagerTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationConfigManagerTest.java
index 1dd5926..f639c8a 100644
--- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationConfigManagerTest.java
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationConfigManagerTest.java
@@ -55,4 +55,23 @@
// default test
result = ValidationConfigManager.getValidationConfiguration();
}
+
+
+ @Test
+ public void testGetOutputFullFilePath() throws Exception {
+ String result;
+
+ // default test
+ result=ValidationConfigManager.getOutputFullFilePath();
+ }
+
+
+ @Test
+ public void testSetOutputFullFilePath() throws Exception {
+ String outputPath = "";
+
+
+ // default test
+ ValidationConfigManager.setOutputFullFilePath(outputPath);
+ }
}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfigurationTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfigurationTest.java
index 8dc2c4f..da1ef90 100644
--- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfigurationTest.java
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfigurationTest.java
@@ -1,8 +1,12 @@
package org.openecomp.sdc.asdctool.impl.validator.config;
import org.junit.Test;
+import org.openecomp.sdc.asdctool.impl.validator.ArtifactToolBL;
import org.openecomp.sdc.asdctool.impl.validator.ValidationToolBL;
+import org.openecomp.sdc.asdctool.impl.validator.executers.NodeToscaArtifactsValidatorExecuter;
+import org.openecomp.sdc.asdctool.impl.validator.executers.ServiceToscaArtifactsValidatorExecutor;
import org.openecomp.sdc.asdctool.impl.validator.executers.ServiceValidatorExecuter;
+import org.openecomp.sdc.asdctool.impl.validator.executers.VFToscaArtifactValidatorExecutor;
import org.openecomp.sdc.asdctool.impl.validator.executers.VfValidatorExecuter;
import org.openecomp.sdc.asdctool.impl.validator.tasks.artifacts.ArtifactValidationUtils;
import org.openecomp.sdc.asdctool.impl.validator.tasks.artifacts.ServiceArtifactValidationTask;
@@ -23,14 +27,12 @@
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaElementLifecycleOperation;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
-
public class ValidationToolConfigurationTest {
private ValidationToolConfiguration createTestSubject() {
return new ValidationToolConfiguration();
}
-
@Test
public void testBasicServiceValidator() {
ValidationToolConfiguration testSubject;
@@ -41,7 +43,6 @@
result = testSubject.basicServiceValidator();
}
-
@Test
public void testVfArtifactValidationTask() {
ValidationToolConfiguration testSubject;
@@ -52,7 +53,6 @@
result = testSubject.vfArtifactValidationTask();
}
-
@Test
public void testServiceArtifactValidationTask() {
ValidationToolConfiguration testSubject;
@@ -63,7 +63,6 @@
result = testSubject.serviceArtifactValidationTask();
}
-
@Test
public void testModuleJsonTask() {
ValidationToolConfiguration testSubject;
@@ -74,7 +73,6 @@
result = testSubject.moduleJsonTask();
}
-
@Test
public void testValidationToolBL() {
ValidationToolConfiguration testSubject;
@@ -85,7 +83,6 @@
result = testSubject.validationToolBL();
}
-
@Test
public void testBasicVfValidator() {
ValidationToolConfiguration testSubject;
@@ -95,7 +92,7 @@
testSubject = createTestSubject();
result = testSubject.basicVfValidator();
}
-
+
@Test
public void testArtifactCassandraDao() {
ValidationToolConfiguration testSubject;
@@ -106,7 +103,6 @@
result = testSubject.artifactCassandraDao();
}
-
@Test
public void testArtifactValidationUtils() {
ValidationToolConfiguration testSubject;
@@ -117,7 +113,6 @@
result = testSubject.artifactValidationUtils();
}
-
@Test
public void testJsonGroupsOperation() {
ValidationToolConfiguration testSubject;
@@ -128,7 +123,6 @@
result = testSubject.jsonGroupsOperation();
}
-
@Test
public void testCassandraClient() {
ValidationToolConfiguration testSubject;
@@ -139,7 +133,6 @@
result = testSubject.cassandraClient();
}
-
@Test
public void testDaoStrategy() {
ValidationToolConfiguration testSubject;
@@ -150,10 +143,6 @@
result = testSubject.daoStrategy();
}
-
-
-
-
@Test
public void testToscaOperationFacade() {
ValidationToolConfiguration testSubject;
@@ -164,7 +153,6 @@
result = testSubject.toscaOperationFacade();
}
-
@Test
public void testNodeTypeOperation() {
ValidationToolConfiguration testSubject;
@@ -176,7 +164,6 @@
result = testSubject.nodeTypeOperation(migrationDerivedNodeTypeResolver);
}
-
@Test
public void testTopologyTemplateOperation() {
ValidationToolConfiguration testSubject;
@@ -187,10 +174,6 @@
result = testSubject.topologyTemplateOperation();
}
-
-
-
-
@Test
public void testMigrationDerivedNodeTypeResolver() {
ValidationToolConfiguration testSubject;
@@ -201,7 +184,6 @@
result = testSubject.migrationDerivedNodeTypeResolver();
}
-
@Test
public void testTitanDao() {
ValidationToolConfiguration testSubject;
@@ -213,7 +195,6 @@
result = testSubject.titanDao(titanGraphClient);
}
-
@Test
public void testCategoryOperation() {
ValidationToolConfiguration testSubject;
@@ -224,7 +205,6 @@
result = testSubject.categoryOperation();
}
-
@Test
public void testArtifactsOperation() {
ValidationToolConfiguration testSubject;
@@ -235,7 +215,6 @@
result = testSubject.artifactsOperation();
}
-
@Test
public void testToscaDataOperation() {
ValidationToolConfiguration testSubject;
@@ -246,7 +225,6 @@
result = testSubject.toscaDataOperation();
}
-
@Test
public void testToscaElementLifecycleOperation() {
ValidationToolConfiguration testSubject;
@@ -256,4 +234,80 @@
testSubject = createTestSubject();
result = testSubject.toscaElementLifecycleOperation();
}
+
+ @Test
+ public void testNodeToscaArtifactsValidatorValidator() throws Exception {
+ ValidationToolConfiguration testSubject;
+ NodeToscaArtifactsValidatorExecuter result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.NodeToscaArtifactsValidatorValidator();
+ }
+
+ @Test
+ public void testServiceToscaArtifactsValidator() throws Exception {
+ ValidationToolConfiguration testSubject;
+ ServiceToscaArtifactsValidatorExecutor result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.ServiceToscaArtifactsValidator();
+ }
+
+ @Test
+ public void testVFToscaArtifactValidator() throws Exception {
+ ValidationToolConfiguration testSubject;
+ VFToscaArtifactValidatorExecutor result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.VFToscaArtifactValidator();
+ }
+
+ @Test
+ public void testArtifactToolBL() throws Exception {
+ ValidationToolConfiguration testSubject;
+ ArtifactToolBL result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.artifactToolBL();
+ }
+
+ //TODO runs as single JUnit Fails on maven clean install
+ /*@Test(expected=NullPointerException.class)
+ public void testReportManager() throws Exception {
+ ValidationToolConfiguration testSubject;
+ ReportManager result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.reportManager();
+ }
+*/
+
+ //TODO runs as single JUnit Fails on maven clean install
+ /*@Test(expected=NullPointerException.class)
+ public void testTitanMigrationClient() throws Exception {
+ ValidationToolConfiguration testSubject;
+ TitanClientStrategy titanClientStrategy = null;
+ TitanGraphClient result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.titanMigrationClient(titanClientStrategy);
+ }*/
+
+ //TODO runs as single JUnit Fails on maven clean install
+ /*@Test(expected=NullPointerException.class)
+ public void testNodeTemplateOperation() throws Exception {
+ ValidationToolConfiguration testSubject;
+ NodeTemplateOperation result;
+
+ // default test
+ testSubject = createTestSubject();
+ System.out.println("ConfigurationManager Print" + ConfigurationManager.getConfigurationManager().getConfiguration().toString());
+ result = testSubject.nodeTemplateOperation();
+ }*/
}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ArtifactValidatorExecuterTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ArtifactValidatorExecuterTest.java
new file mode 100644
index 0000000..e145302
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ArtifactValidatorExecuterTest.java
@@ -0,0 +1,64 @@
+package org.openecomp.sdc.asdctool.impl.validator.executers;
+
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum;
+import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.Resource;
+
+public class ArtifactValidatorExecuterTest {
+
+ private ArtifactValidatorExecuter createTestSubject() {
+ return new ArtifactValidatorExecuter();
+ }
+
+ @Test
+ public void testGetName() throws Exception {
+ ArtifactValidatorExecuter testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getName();
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testGetVerticesToValidate() throws Exception {
+ ArtifactValidatorExecuter testSubject;
+ VertexTypeEnum type = null;
+ Map<GraphPropertyEnum, Object> hasProps = null;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.getVerticesToValidate(type, hasProps);
+ }
+
+ @Test
+ public void testSetName() throws Exception {
+ ArtifactValidatorExecuter testSubject;
+ String name = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setName(name);
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testValidate() throws Exception {
+ ArtifactValidatorExecuter testSubject;
+ Map<String, List<Component>> vertices = new HashMap<>();
+ LinkedList<Component> linkedList = new LinkedList<Component>();
+ linkedList.add(new Resource());
+ vertices.put("stam", linkedList);
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.validate(vertices);
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/NodeToscaArtifactsValidatorExecuterTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/NodeToscaArtifactsValidatorExecuterTest.java
new file mode 100644
index 0000000..40eedc1
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/NodeToscaArtifactsValidatorExecuterTest.java
@@ -0,0 +1,40 @@
+package org.openecomp.sdc.asdctool.impl.validator.executers;
+
+import org.junit.Test;
+
+public class NodeToscaArtifactsValidatorExecuterTest {
+
+ private NodeToscaArtifactsValidatorExecuter createTestSubject() {
+ return new NodeToscaArtifactsValidatorExecuter();
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testExecuteValidations() throws Exception {
+ NodeToscaArtifactsValidatorExecuter testSubject;
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.executeValidations();
+ }
+
+ @Test
+ public void testGetName() throws Exception {
+ NodeToscaArtifactsValidatorExecuter testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getName();
+ }
+
+ @Test
+ public void testSetName() throws Exception {
+ NodeToscaArtifactsValidatorExecuter testSubject;
+ String name = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setName(name);
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceToscaArtifactsValidatorExecutorTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceToscaArtifactsValidatorExecutorTest.java
new file mode 100644
index 0000000..ede353e
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceToscaArtifactsValidatorExecutorTest.java
@@ -0,0 +1,40 @@
+package org.openecomp.sdc.asdctool.impl.validator.executers;
+
+import org.junit.Test;
+
+public class ServiceToscaArtifactsValidatorExecutorTest {
+
+ private ServiceToscaArtifactsValidatorExecutor createTestSubject() {
+ return new ServiceToscaArtifactsValidatorExecutor();
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testExecuteValidations() throws Exception {
+ ServiceToscaArtifactsValidatorExecutor testSubject;
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.executeValidations();
+ }
+
+ @Test
+ public void testGetName() throws Exception {
+ ServiceToscaArtifactsValidatorExecutor testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getName();
+ }
+
+ @Test
+ public void testSetName() throws Exception {
+ ServiceToscaArtifactsValidatorExecutor testSubject;
+ String name = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setName(name);
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceValidatorExecuterTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceValidatorExecuterTest.java
index 890bdfd..dbfe02b 100644
--- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceValidatorExecuterTest.java
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceValidatorExecuterTest.java
@@ -2,17 +2,12 @@
import org.junit.Test;
-
public class ServiceValidatorExecuterTest {
private ServiceValidatorExecuter createTestSubject() {
return new ServiceValidatorExecuter();
}
-
-
-
-
@Test
public void testGetName() {
ServiceValidatorExecuter testSubject;
@@ -22,4 +17,14 @@
testSubject = createTestSubject();
result = testSubject.getName();
}
+
+ @Test(expected=NullPointerException.class)
+ public void testExecuteValidations() throws Exception {
+ ServiceValidatorExecuter testSubject;
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.executeValidations();
+ }
}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/TopologyTemplateValidatorExecuterTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/TopologyTemplateValidatorExecuterTest.java
index f3fdebe..e0ee6d0 100644
--- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/TopologyTemplateValidatorExecuterTest.java
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/TopologyTemplateValidatorExecuterTest.java
@@ -1,7 +1,7 @@
package org.openecomp.sdc.asdctool.impl.validator.executers;
import org.junit.Test;
-
+import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
public class TopologyTemplateValidatorExecuterTest {
@@ -9,7 +9,6 @@
return new TopologyTemplateValidatorExecuter();
}
-
@Test
public void testSetName() {
TopologyTemplateValidatorExecuter testSubject;
@@ -20,7 +19,6 @@
testSubject.setName(name);
}
-
@Test
public void testGetName() {
TopologyTemplateValidatorExecuter testSubject;
@@ -31,9 +29,12 @@
result = testSubject.getName();
}
-
+ @Test(expected=NullPointerException.class)
+ public void testGetVerticesToValidate() throws Exception {
+ TopologyTemplateValidatorExecuter testSubject;
-
-
-
+ // default test
+ testSubject = createTestSubject();
+ testSubject.getVerticesToValidate(ComponentTypeEnum.PRODUCT);
+ }
}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/VFToscaArtifactValidatorExecutorTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/VFToscaArtifactValidatorExecutorTest.java
new file mode 100644
index 0000000..7994839
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/VFToscaArtifactValidatorExecutorTest.java
@@ -0,0 +1,40 @@
+package org.openecomp.sdc.asdctool.impl.validator.executers;
+
+import org.junit.Test;
+
+public class VFToscaArtifactValidatorExecutorTest {
+
+ private VFToscaArtifactValidatorExecutor createTestSubject() {
+ return new VFToscaArtifactValidatorExecutor();
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testExecuteValidations() throws Exception {
+ VFToscaArtifactValidatorExecutor testSubject;
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.executeValidations();
+ }
+
+ @Test
+ public void testGetName() throws Exception {
+ VFToscaArtifactValidatorExecutor testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getName();
+ }
+
+ @Test
+ public void testSetName() throws Exception {
+ VFToscaArtifactValidatorExecutor testSubject;
+ String name = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setName(name);
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/VfValidatorExecuterTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/VfValidatorExecuterTest.java
index 83dac8a..7a349c9 100644
--- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/VfValidatorExecuterTest.java
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/VfValidatorExecuterTest.java
@@ -2,15 +2,12 @@
import org.junit.Test;
-
public class VfValidatorExecuterTest {
private VfValidatorExecuter createTestSubject() {
return new VfValidatorExecuter();
}
-
-
@Test
public void testGetName() {
VfValidatorExecuter testSubject;
@@ -20,4 +17,14 @@
testSubject = createTestSubject();
result = testSubject.getName();
}
+
+ @Test(expected=NullPointerException.class)
+ public void testExecuteValidations() throws Exception {
+ VfValidatorExecuter testSubject;
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.executeValidations();
+ }
}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ArtifactValidationUtilsTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ArtifactValidationUtilsTest.java
new file mode 100644
index 0000000..27deb6b
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ArtifactValidationUtilsTest.java
@@ -0,0 +1,62 @@
+package org.openecomp.sdc.asdctool.impl.validator.tasks.artifacts;
+
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.dao.jsongraph.GraphVertex;
+import org.openecomp.sdc.be.datatypes.elements.ArtifactDataDefinition;
+
+public class ArtifactValidationUtilsTest {
+
+ private ArtifactValidationUtils createTestSubject() {
+ return new ArtifactValidationUtils();
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testValidateArtifactsAreInCassandra() throws Exception {
+ ArtifactValidationUtils testSubject;
+ GraphVertex vertex = null;
+ String taskName = "";
+ List<ArtifactDataDefinition> artifacts = null;
+ ArtifactsVertexResult result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.validateArtifactsAreInCassandra(vertex, taskName, artifacts);
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testIsArtifcatInCassandra() throws Exception {
+ ArtifactValidationUtils testSubject;
+ String uniueId = "";
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.isArtifcatInCassandra(uniueId);
+ }
+
+ @Test
+ public void testAddRelevantArtifacts() throws Exception {
+ ArtifactValidationUtils testSubject;
+ Map<String, ArtifactDataDefinition> artifactsMap = null;
+ List<ArtifactDataDefinition> result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.addRelevantArtifacts(artifactsMap);
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testValidateTopologyTemplateArtifacts() throws Exception {
+ ArtifactValidationUtils testSubject;
+ GraphVertex vertex = null;
+ String taskName = "";
+ ArtifactsVertexResult result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.validateTopologyTemplateArtifacts(vertex, taskName);
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ArtifactsVertexResultTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ArtifactsVertexResultTest.java
index d16c3fc..903c611 100644
--- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ArtifactsVertexResultTest.java
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ArtifactsVertexResultTest.java
@@ -2,14 +2,12 @@
import org.junit.Test;
-
public class ArtifactsVertexResultTest {
private ArtifactsVertexResult createTestSubject() {
return new ArtifactsVertexResult();
}
-
@Test
public void testAddNotFoundArtifact() {
ArtifactsVertexResult testSubject;
@@ -20,7 +18,6 @@
testSubject.addNotFoundArtifact(artifactId);
}
-
@Test
public void testGetResult() {
ArtifactsVertexResult testSubject;
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ServiceArtifactValidationTaskTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ServiceArtifactValidationTaskTest.java
index ef0b23b..15c2b07 100644
--- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ServiceArtifactValidationTaskTest.java
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ServiceArtifactValidationTaskTest.java
@@ -1,11 +1,23 @@
package org.openecomp.sdc.asdctool.impl.validator.tasks.artifacts;
+import org.junit.Test;
+import org.openecomp.sdc.be.dao.jsongraph.GraphVertex;
+
public class ServiceArtifactValidationTaskTest {
private ServiceArtifactValidationTask createTestSubject() {
return new ServiceArtifactValidationTask();
}
-
+ @Test(expected=NullPointerException.class)
+ public void testValidate() throws Exception {
+ ServiceArtifactValidationTask testSubject;
+ GraphVertex vertex = null;
+ ArtifactsVertexResult result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.validate(vertex);
+ }
}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/VfArtifactValidationTaskTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/VfArtifactValidationTaskTest.java
index 04aec47..8d753e1 100644
--- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/VfArtifactValidationTaskTest.java
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/VfArtifactValidationTaskTest.java
@@ -1,11 +1,24 @@
package org.openecomp.sdc.asdctool.impl.validator.tasks.artifacts;
+import org.junit.Test;
+import org.openecomp.sdc.asdctool.impl.validator.utils.VertexResult;
+import org.openecomp.sdc.be.dao.jsongraph.GraphVertex;
+
public class VfArtifactValidationTaskTest {
private VfArtifactValidationTask createTestSubject() {
return new VfArtifactValidationTask();
}
-
+ @Test(expected=NullPointerException.class)
+ public void testValidate() throws Exception {
+ VfArtifactValidationTask testSubject;
+ GraphVertex vertex = null;
+ VertexResult result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.validate(vertex);
+ }
}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/moduleJson/ModuleJsonTaskTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/moduleJson/ModuleJsonTaskTest.java
new file mode 100644
index 0000000..5a55742
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/moduleJson/ModuleJsonTaskTest.java
@@ -0,0 +1,23 @@
+package org.openecomp.sdc.asdctool.impl.validator.tasks.moduleJson;
+
+import org.junit.Test;
+import org.openecomp.sdc.asdctool.impl.validator.utils.VertexResult;
+import org.openecomp.sdc.be.dao.jsongraph.GraphVertex;
+
+public class ModuleJsonTaskTest {
+
+ private ModuleJsonTask createTestSubject() {
+ return new ModuleJsonTask();
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testValidate() throws Exception {
+ ModuleJsonTask testSubject;
+ GraphVertex vertex = null;
+ VertexResult result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.validate(vertex);
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ElementTypeEnumTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ElementTypeEnumTest.java
index e6e564e..163994e 100644
--- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ElementTypeEnumTest.java
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ElementTypeEnumTest.java
@@ -19,6 +19,7 @@
// default test
result = ElementTypeEnum.getByType(elementType);
+ result = ElementTypeEnum.getByType(ElementTypeEnum.VF.getElementType());
}
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManagerTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManagerTest.java
new file mode 100644
index 0000000..a50af44
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManagerTest.java
@@ -0,0 +1,88 @@
+package org.openecomp.sdc.asdctool.impl.validator.utils;
+
+import java.util.Set;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.dao.jsongraph.GraphVertex;
+
+public class ReportManagerTest {
+
+ @Test
+ public void testReportTaskEnd() throws Exception {
+ String vertexId = "";
+ String taskName = "";
+ VertexResult result = null;
+
+ // default test
+ ReportManager.reportTaskEnd(vertexId, taskName, result);
+ }
+
+ @Test
+ public void testAddFailedVertex() throws Exception {
+ String taskName = "";
+ String vertexId = "";
+
+ // default test
+ ReportManager.addFailedVertex(taskName, vertexId);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testPrintValidationTaskStatus() throws Exception {
+ GraphVertex vertexScanned = null;
+ String taskName = "";
+ boolean success = false;
+
+ // default test
+ ReportManager.printValidationTaskStatus(vertexScanned, taskName, success);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testWriteReportLineToFile() throws Exception {
+ String message = "";
+
+ // default test
+ ReportManager.writeReportLineToFile(message);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testReportValidatorTypeSummary() throws Exception {
+ String validatorName = "";
+ Set<String> failedTasksNames = null;
+ Set<String> successTasksNames = null;
+
+ // default test
+ ReportManager.reportValidatorTypeSummary(validatorName, failedTasksNames, successTasksNames);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testReportStartValidatorRun() throws Exception {
+ String validatorName = "";
+ int componenentsNum = 0;
+
+ // default test
+ ReportManager.reportStartValidatorRun(validatorName, componenentsNum);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testReportStartTaskRun() throws Exception {
+ GraphVertex vertex = null;
+ String taskName = "";
+
+ // default test
+ ReportManager.reportStartTaskRun(vertex, taskName);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testReportEndOfToolRun() throws Exception {
+
+ // default test
+ ReportManager.reportEndOfToolRun();
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testPrintAllResults() throws Exception {
+
+ // default test
+ ReportManager.printAllResults();
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/VertexResultTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/VertexResultTest.java
index d65fb00..4b57b68 100644
--- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/VertexResultTest.java
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/VertexResultTest.java
@@ -9,6 +9,10 @@
return new VertexResult();
}
+ @Test
+ public void createTestSubjectBoolean() {
+ new VertexResult(true);
+ }
@Test
public void testGetStatus() {
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/VfModuleArtifactPayloadExTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/VfModuleArtifactPayloadExTest.java
new file mode 100644
index 0000000..50c01b0
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/VfModuleArtifactPayloadExTest.java
@@ -0,0 +1,193 @@
+package org.openecomp.sdc.asdctool.impl.validator.utils;
+
+import java.util.List;
+import java.util.Map;
+
+import org.junit.Test;
+
+public class VfModuleArtifactPayloadExTest {
+
+ private VfModuleArtifactPayloadEx createTestSubject() {
+ return new VfModuleArtifactPayloadEx();
+ }
+
+ @Test
+ public void testGetVfModuleModelName() throws Exception {
+ VfModuleArtifactPayloadEx testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getVfModuleModelName();
+ }
+
+ @Test
+ public void testSetVfModuleModelName() throws Exception {
+ VfModuleArtifactPayloadEx testSubject;
+ String vfModuleModelName = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setVfModuleModelName(vfModuleModelName);
+ }
+
+ @Test
+ public void testGetVfModuleModelInvariantUUID() throws Exception {
+ VfModuleArtifactPayloadEx testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getVfModuleModelInvariantUUID();
+ }
+
+ @Test
+ public void testSetVfModuleModelInvariantUUID() throws Exception {
+ VfModuleArtifactPayloadEx testSubject;
+ String vfModuleModelInvariantUUID = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setVfModuleModelInvariantUUID(vfModuleModelInvariantUUID);
+ }
+
+ @Test
+ public void testGetVfModuleModelVersion() throws Exception {
+ VfModuleArtifactPayloadEx testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getVfModuleModelVersion();
+ }
+
+ @Test
+ public void testSetVfModuleModelVersion() throws Exception {
+ VfModuleArtifactPayloadEx testSubject;
+ String vfModuleModelVersion = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setVfModuleModelVersion(vfModuleModelVersion);
+ }
+
+ @Test
+ public void testGetVfModuleModelUUID() throws Exception {
+ VfModuleArtifactPayloadEx testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getVfModuleModelUUID();
+ }
+
+ @Test
+ public void testSetVfModuleModelUUID() throws Exception {
+ VfModuleArtifactPayloadEx testSubject;
+ String vfModuleModelUUID = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setVfModuleModelUUID(vfModuleModelUUID);
+ }
+
+ @Test
+ public void testGetVfModuleModelCustomizationUUID() throws Exception {
+ VfModuleArtifactPayloadEx testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getVfModuleModelCustomizationUUID();
+ }
+
+ @Test
+ public void testSetVfModuleModelCustomizationUUID() throws Exception {
+ VfModuleArtifactPayloadEx testSubject;
+ String vfModuleModelCustomizationUUID = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setVfModuleModelCustomizationUUID(vfModuleModelCustomizationUUID);
+ }
+
+ @Test
+ public void testGetVfModuleModelDescription() throws Exception {
+ VfModuleArtifactPayloadEx testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getVfModuleModelDescription();
+ }
+
+ @Test
+ public void testSetVfModuleModelDescription() throws Exception {
+ VfModuleArtifactPayloadEx testSubject;
+ String vfModuleModelDescription = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setVfModuleModelDescription(vfModuleModelDescription);
+ }
+
+ @Test
+ public void testGetIsBase() throws Exception {
+ VfModuleArtifactPayloadEx testSubject;
+ Boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getIsBase();
+ }
+
+ @Test
+ public void testSetIsBase() throws Exception {
+ VfModuleArtifactPayloadEx testSubject;
+ Boolean isBase = null;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setIsBase(isBase);
+ }
+
+ @Test
+ public void testGetArtifacts() throws Exception {
+ VfModuleArtifactPayloadEx testSubject;
+ List<String> result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getArtifacts();
+ }
+
+ @Test
+ public void testSetArtifacts() throws Exception {
+ VfModuleArtifactPayloadEx testSubject;
+ List<String> artifacts = null;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setArtifacts(artifacts);
+ }
+
+ @Test
+ public void testGetProperties() throws Exception {
+ VfModuleArtifactPayloadEx testSubject;
+ Map<String, Object> result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getProperties();
+ }
+
+ @Test
+ public void testSetProperties() throws Exception {
+ VfModuleArtifactPayloadEx testSubject;
+ Map<String, Object> properties = null;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setProperties(properties);
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/main/SdcSchemaFileImportTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/main/SdcSchemaFileImportTest.java
new file mode 100644
index 0000000..2f5daba
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/main/SdcSchemaFileImportTest.java
@@ -0,0 +1,40 @@
+package org.openecomp.sdc.asdctool.main;
+
+import java.nio.file.NoSuchFileException;
+
+import org.junit.Test;
+import org.openecomp.sdc.asdctool.enums.SchemaZipFileEnum;
+
+public class SdcSchemaFileImportTest {
+
+ private SdcSchemaFileImport createTestSubject() {
+ return new SdcSchemaFileImport();
+ }
+
+ @Test(expected=NoSuchFileException.class)
+ public void testCreateAndSaveNodeSchemaFile() throws Exception {
+
+ // default test
+ SdcSchemaFileImport.createAndSaveNodeSchemaFile();
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testCreateAndSaveSchemaFileYaml() throws Exception {
+ SchemaZipFileEnum schemaZipFileEnum = null;
+ Object content = null;
+
+ // default test
+ SdcSchemaFileImport.createAndSaveSchemaFileYaml(schemaZipFileEnum, content);
+ }
+
+ @Test(expected=IllegalArgumentException.class)
+ public void testCreateAndSaveSchemaFileYaml_1() throws Exception {
+ String fileName = "";
+ String[] importFileList = new String[] { "" };
+ String collectionTitle = "";
+ Object content = null;
+
+ // default test
+ SdcSchemaFileImport.createAndSaveSchemaFileYaml(fileName, importFileList, collectionTitle, content);
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/config/MigrationSpringConfigTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/config/MigrationSpringConfigTest.java
new file mode 100644
index 0000000..50b02d6
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/config/MigrationSpringConfigTest.java
@@ -0,0 +1,81 @@
+package org.openecomp.sdc.asdctool.migration.config;
+
+import org.junit.Test;
+import org.openecomp.sdc.asdctool.migration.core.SdcMigrationTool;
+import org.openecomp.sdc.asdctool.migration.dao.MigrationTasksDao;
+import org.openecomp.sdc.asdctool.migration.resolver.MigrationResolver;
+import org.openecomp.sdc.asdctool.migration.resolver.SpringBeansMigrationResolver;
+import org.openecomp.sdc.asdctool.migration.service.SdcRepoService;
+import org.openecomp.sdc.be.components.distribution.engine.ServiceDistributionArtifactsBuilder;
+import org.springframework.beans.factory.config.PropertiesFactoryBean;
+
+public class MigrationSpringConfigTest {
+
+ private MigrationSpringConfig createTestSubject() {
+ return new MigrationSpringConfig();
+ }
+
+ @Test
+ public void testSdcMigrationTool() throws Exception {
+ MigrationSpringConfig testSubject;
+ MigrationResolver migrationResolver = null;
+ SdcRepoService sdcRepoService = null;
+ SdcMigrationTool result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.sdcMigrationTool(migrationResolver, sdcRepoService);
+ }
+
+ @Test
+ public void testMigrationResolver() throws Exception {
+ MigrationSpringConfig testSubject;
+ SdcRepoService sdcRepoService = null;
+ SpringBeansMigrationResolver result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.migrationResolver(sdcRepoService);
+ }
+
+ @Test
+ public void testSdcRepoService() throws Exception {
+ MigrationSpringConfig testSubject;
+ MigrationTasksDao migrationTasksDao = null;
+ SdcRepoService result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.sdcRepoService(migrationTasksDao);
+ }
+
+ @Test
+ public void testMigrationTasksDao() throws Exception {
+ MigrationSpringConfig testSubject;
+ MigrationTasksDao result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.migrationTasksDao();
+ }
+
+ @Test
+ public void testServiceDistributionArtifactsBuilder() throws Exception {
+ MigrationSpringConfig testSubject;
+ ServiceDistributionArtifactsBuilder result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.serviceDistributionArtifactsBuilder();
+ }
+
+ @Test
+ public void testMapper() throws Exception {
+ MigrationSpringConfig testSubject;
+ PropertiesFactoryBean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.mapper();
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/config/mocks/DistributionEngineMockTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/config/mocks/DistributionEngineMockTest.java
new file mode 100644
index 0000000..feea79f
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/config/mocks/DistributionEngineMockTest.java
@@ -0,0 +1,137 @@
+package org.openecomp.sdc.asdctool.migration.config.mocks;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.components.distribution.engine.INotificationData;
+import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.model.Service;
+import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
+import org.openecomp.sdc.be.resources.data.OperationalEnvironmentEntry;
+
+public class DistributionEngineMockTest {
+
+ private DistributionEngineMock createTestSubject() {
+ return new DistributionEngineMock();
+ }
+
+ @Test
+ public void testIsActive() throws Exception {
+ DistributionEngineMock testSubject;
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.isActive();
+ }
+
+ @Test
+ public void testNotifyService() throws Exception {
+ DistributionEngineMock testSubject;
+ String distributionId = "";
+ Service service = null;
+ INotificationData notificationData = null;
+ String envName = "";
+ String userId = "";
+ String modifierName = "";
+ ActionStatus result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.notifyService(distributionId, service, notificationData, envName, userId, modifierName);
+ }
+
+ @Test
+ public void testNotifyService_1() throws Exception {
+ DistributionEngineMock testSubject;
+ String distributionId = "";
+ Service service = null;
+ INotificationData notificationData = null;
+ String envId = "";
+ String envName = "";
+ String userId = "";
+ String modifierName = "";
+ ActionStatus result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.notifyService(distributionId, service, notificationData, envId, envName, userId,
+ modifierName);
+ }
+
+ @Test
+ public void testIsEnvironmentAvailable() throws Exception {
+ DistributionEngineMock testSubject;
+ String envName = "";
+ StorageOperationStatus result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.isEnvironmentAvailable(envName);
+ }
+
+ @Test
+ public void testIsEnvironmentAvailable_1() throws Exception {
+ DistributionEngineMock testSubject;
+ StorageOperationStatus result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.isEnvironmentAvailable();
+ }
+
+ @Test
+ public void testDisableEnvironment() throws Exception {
+ DistributionEngineMock testSubject;
+ String envName = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.disableEnvironment(envName);
+ }
+
+ @Test
+ public void testIsReadyForDistribution() throws Exception {
+ DistributionEngineMock testSubject;
+ Service service = null;
+ String envName = "";
+ StorageOperationStatus result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.isReadyForDistribution(service, envName);
+ }
+
+ @Test
+ public void testBuildServiceForDistribution() throws Exception {
+ DistributionEngineMock testSubject;
+ Service service = null;
+ String distributionId = "";
+ String workloadContext = "";
+ INotificationData result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.buildServiceForDistribution(service, distributionId, workloadContext);
+ }
+
+ @Test
+ public void testVerifyServiceHasDeploymentArtifacts() throws Exception {
+ DistributionEngineMock testSubject;
+ Service service = null;
+ StorageOperationStatus result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.verifyServiceHasDeploymentArtifacts(service);
+ }
+
+ @Test
+ public void testGetEnvironmentById() throws Exception {
+ DistributionEngineMock testSubject;
+ String opEnvId = "";
+ OperationalEnvironmentEntry result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getEnvironmentById(opEnvId);
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/config/mocks/DmaapHealthCheckMockTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/config/mocks/DmaapHealthCheckMockTest.java
new file mode 100644
index 0000000..c4121c9
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/config/mocks/DmaapHealthCheckMockTest.java
@@ -0,0 +1,21 @@
+package org.openecomp.sdc.asdctool.migration.config.mocks;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.components.distribution.engine.DmaapHealth;
+
+public class DmaapHealthCheckMockTest {
+
+ private DmaapHealthCheckMock createTestSubject() {
+ return new DmaapHealthCheckMock();
+ }
+
+ @Test
+ public void testInit() throws Exception {
+ DmaapHealthCheckMock testSubject;
+ DmaapHealth result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.init();
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/config/mocks/HealthCheckBusinessLogicMockTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/config/mocks/HealthCheckBusinessLogicMockTest.java
new file mode 100644
index 0000000..a08f9bd
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/config/mocks/HealthCheckBusinessLogicMockTest.java
@@ -0,0 +1,19 @@
+package org.openecomp.sdc.asdctool.migration.config.mocks;
+
+import org.junit.Test;
+
+public class HealthCheckBusinessLogicMockTest {
+
+ private HealthCheckBusinessLogicMock createTestSubject() {
+ return new HealthCheckBusinessLogicMock();
+ }
+
+ @Test
+ public void testInit() throws Exception {
+ HealthCheckBusinessLogicMock testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.init();
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/SdcMigrationToolTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/SdcMigrationToolTest.java
index 8783071..da6122c 100644
--- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/SdcMigrationToolTest.java
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/SdcMigrationToolTest.java
@@ -21,81 +21,82 @@
public class SdcMigrationToolTest {
- @InjectMocks
- private SdcMigrationTool testInstance = spy(SdcMigrationTool.class);
+ @InjectMocks
+ private SdcMigrationTool testInstance = spy(SdcMigrationTool.class);
- @Mock
- private MigrationResolver migrationResolverMock;
+ @Mock
+ private MigrationResolver migrationResolverMock;
- @Mock
- private SdcRepoService sdcRepoServiceMock;
+ @Mock
+ private SdcRepoService sdcRepoServiceMock;
- @BeforeMethod
+ @BeforeMethod
public void setUp() {
- MockitoAnnotations.initMocks(this);
- }
+ MockitoAnnotations.initMocks(this);
+ }
- @Test
+ @Test
public void testMigrate_noMigrations() {
- when(migrationResolverMock.resolveMigrations()).thenReturn(Collections.emptyList());
- testInstance.migrate(false);
- verify(sdcRepoServiceMock, new Times(0)).clearTasksForCurrentMajor();
- verify(sdcRepoServiceMock, new Times(0)).createMigrationTask(Mockito.any());
- }
+ when(migrationResolverMock.resolveMigrations()).thenReturn(Collections.emptyList());
+ testInstance.migrate(false);
+ verify(sdcRepoServiceMock, new Times(0)).clearTasksForCurrentMajor();
+ verify(sdcRepoServiceMock, new Times(0)).createMigrationTask(Mockito.any());
+ }
- @Test
+ @Test
public void testMigrate_enforceFlag_removeAllMigrationTasksForCurrentVersion() {
- when(migrationResolverMock.resolveMigrations()).thenReturn(Collections.emptyList());
- testInstance.migrate(true);
- verify(sdcRepoServiceMock, new Times(1)).clearTasksForCurrentMajor();
- }
+ when(migrationResolverMock.resolveMigrations()).thenReturn(Collections.emptyList());
+ testInstance.migrate(true);
+ verify(sdcRepoServiceMock, new Times(1)).clearTasksForCurrentMajor();
+ }
- @Test
+ @Test
public void testMigrate_stopAfterFirstFailure() {
- when(migrationResolverMock.resolveMigrations()).thenReturn(Arrays.asList(new SuccessfulMigration(), new FailedMigration(), new SuccessfulMigration()));
- testInstance.migrate(false);
- verify(sdcRepoServiceMock, new Times(0)).clearTasksForCurrentMajor();
- verify(sdcRepoServiceMock, new Times(1)).createMigrationTask(Mockito.any());
+ when(migrationResolverMock.resolveMigrations())
+ .thenReturn(Arrays.asList(new SuccessfulMigration(), new FailedMigration(), new SuccessfulMigration()));
+ testInstance.migrate(false);
+ verify(sdcRepoServiceMock, new Times(0)).clearTasksForCurrentMajor();
+ verify(sdcRepoServiceMock, new Times(1)).createMigrationTask(Mockito.any());
- }
+ }
- private class FailedMigration implements Migration {
+ private class FailedMigration implements Migration {
- @Override
- public String description() {
- return null;
- }
+ @Override
+ public String description() {
+ return null;
+ }
- @Override
- public DBVersion getVersion() {
- return DBVersion.fromString("1710.22");
- }
+ @Override
+ public DBVersion getVersion() {
+ return DBVersion.fromString("1710.22");
+ }
- @Override
- public MigrationResult migrate() {
- MigrationResult migrationResult = new MigrationResult();
- migrationResult.setMigrationStatus(MigrationResult.MigrationStatus.FAILED);
- return migrationResult;
- }
- }
+ @Override
+ public MigrationResult migrate() {
+ MigrationResult migrationResult = new MigrationResult();
+ migrationResult.setMigrationStatus(MigrationResult.MigrationStatus.FAILED);
+ return migrationResult;
+ }
+ }
- private class SuccessfulMigration implements Migration {
+ private class SuccessfulMigration implements Migration {
- @Override
- public String description() {
- return null;
- }
+ @Override
+ public String description() {
+ return null;
+ }
- @Override
- public DBVersion getVersion() {
- return DBVersion.fromString("1710.22");
- }
+ @Override
+ public DBVersion getVersion() {
+ return DBVersion.fromString("1710.22");
+ }
- @Override
- public MigrationResult migrate() {
- MigrationResult migrationResult = new MigrationResult();
- migrationResult.setMigrationStatus(MigrationResult.MigrationStatus.COMPLETED);
- return migrationResult;
- }
- }
+ @Override
+ public MigrationResult migrate() {
+ MigrationResult migrationResult = new MigrationResult();
+ migrationResult.setMigrationStatus(MigrationResult.MigrationStatus.COMPLETED);
+ return migrationResult;
+ }
+ }
}
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/execution/MigrationExecutionResultTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/execution/MigrationExecutionResultTest.java
new file mode 100644
index 0000000..2831f76
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/execution/MigrationExecutionResultTest.java
@@ -0,0 +1,83 @@
+package org.openecomp.sdc.asdctool.migration.core.execution;
+
+import org.junit.Test;
+import org.openecomp.sdc.asdctool.migration.core.DBVersion;
+import org.openecomp.sdc.asdctool.migration.core.task.MigrationResult.MigrationStatus;
+import org.openecomp.sdc.be.resources.data.MigrationTaskEntry;
+
+public class MigrationExecutionResultTest {
+
+ private MigrationExecutionResult createTestSubject() {
+ return new MigrationExecutionResult();
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testToMigrationTaskEntry() throws Exception {
+ MigrationExecutionResult testSubject;
+ MigrationTaskEntry result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.toMigrationTaskEntry();
+ }
+
+ @Test
+ public void testGetMigrationStatus() throws Exception {
+ MigrationExecutionResult testSubject;
+ MigrationStatus result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getMigrationStatus();
+ }
+
+ @Test
+ public void testGetMsg() throws Exception {
+ MigrationExecutionResult testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getMsg();
+ }
+
+ @Test
+ public void testGetVersion() throws Exception {
+ MigrationExecutionResult testSubject;
+ DBVersion result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getVersion();
+ }
+
+ @Test
+ public void testSetVersion() throws Exception {
+ MigrationExecutionResult testSubject;
+ DBVersion version = null;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setVersion(version);
+ }
+
+ @Test
+ public void testGetDescription() throws Exception {
+ MigrationExecutionResult testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getDescription();
+ }
+
+ @Test
+ public void testSetDescription() throws Exception {
+ MigrationExecutionResult testSubject;
+ String description = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setDescription(description);
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/dao/MigrationTasksDaoTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/dao/MigrationTasksDaoTest.java
new file mode 100644
index 0000000..73f50f4
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/dao/MigrationTasksDaoTest.java
@@ -0,0 +1,53 @@
+package org.openecomp.sdc.asdctool.migration.dao;
+
+import java.math.BigInteger;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.resources.data.MigrationTaskEntry;
+
+public class MigrationTasksDaoTest {
+
+ private MigrationTasksDao createTestSubject() {
+ return new MigrationTasksDao();
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testInit() throws Exception {
+ MigrationTasksDao testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.init();
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testGetLatestMinorVersion() throws Exception {
+ MigrationTasksDao testSubject;
+ BigInteger majorVersion = null;
+ BigInteger result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getLatestMinorVersion(majorVersion);
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testDeleteAllTasksForVersion() throws Exception {
+ MigrationTasksDao testSubject;
+ BigInteger majorVersion = null;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.deleteAllTasksForVersion(majorVersion);
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testCreateMigrationTask() throws Exception {
+ MigrationTasksDao testSubject;
+ MigrationTaskEntry migrationTask = null;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.createMigrationTask(migrationTask);
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/resolver/SpringBeansMigrationResolverTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/resolver/SpringBeansMigrationResolverTest.java
index 636b1c6..47bf9c9 100644
--- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/resolver/SpringBeansMigrationResolverTest.java
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/resolver/SpringBeansMigrationResolverTest.java
@@ -15,74 +15,78 @@
import org.openecomp.sdc.asdctool.migration.core.task.IMigrationStage;
import org.openecomp.sdc.asdctool.migration.core.task.Migration;
import org.openecomp.sdc.asdctool.migration.core.task.MigrationResult;
+import org.openecomp.sdc.asdctool.migration.dao.MigrationTasksDao;
import org.openecomp.sdc.asdctool.migration.service.SdcRepoService;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class SpringBeansMigrationResolverTest {
- @InjectMocks
- private SpringBeansMigrationResolver testInstance;
+ @InjectMocks
+ private SpringBeansMigrationResolver testInstance;
- @Mock
- private SdcRepoService sdcRepoServiceMock;
+ @Mock
+ private SdcRepoService sdcRepoServiceMock;
- private List<Migration> migrations = Arrays.asList(createMigration("1710.1"), createMigration("1710.22"), createMigration("1707.12"), createMigration("1710.3"));
+ private List<Migration> migrations = Arrays.asList(createMigration("1710.1"), createMigration("1710.22"),
+ createMigration("1707.12"), createMigration("1710.3"));
-
- @BeforeMethod
+ @BeforeMethod
public void setUp() {
- MockitoAnnotations.initMocks(this);
- testInstance.setMigrations(migrations);
- }
+ MockitoAnnotations.initMocks(this);
+ testInstance.setMigrations(migrations);
+ }
- @Test
+ @Test
public void testResolveMigrations_getMigrationsWithVersionGreaterThanLatest() {
- when(sdcRepoServiceMock.getLatestDBVersion()).thenReturn(DBVersion.fromString("1710.2"));
- testInstance.setPostMigrations(Collections.emptyList());
- List<IMigrationStage> resolvedMigrations = testInstance.resolveMigrations();
- assertEquals(resolvedMigrations.size(), 2);
- assertEquals(resolvedMigrations.get(0).getVersion(), DBVersion.fromString("1710.3"));
- assertEquals(resolvedMigrations.get(1).getVersion(), DBVersion.fromString("1710.22"));
- }
+ when(sdcRepoServiceMock.getLatestDBVersion()).thenReturn(DBVersion.fromString("1710.2"));
+ testInstance.setPostMigrations(Collections.emptyList());
+ List<IMigrationStage> resolvedMigrations = testInstance.resolveMigrations();
+ assertEquals(resolvedMigrations.size(), 2);
+ assertEquals(resolvedMigrations.get(0).getVersion(), DBVersion.fromString("1710.3"));
+ assertEquals(resolvedMigrations.get(1).getVersion(), DBVersion.fromString("1710.22"));
+ }
- @Test
+ @Test
public void testResolveMigration_noLatestVersionForCurrentMajorVersion() {
- when(sdcRepoServiceMock.getLatestDBVersion()).thenReturn(DBVersion.fromString("1710.-1"));
- testInstance.setPostMigrations(Collections.emptyList());
- List<IMigrationStage> resolvedMigrations = testInstance.resolveMigrations();
- assertEquals(resolvedMigrations.size(), 3);
- assertEquals(resolvedMigrations.get(0).getVersion(), DBVersion.fromString("1710.1"));
- assertEquals(resolvedMigrations.get(1).getVersion(), DBVersion.fromString("1710.3"));
- assertEquals(resolvedMigrations.get(2).getVersion(), DBVersion.fromString("1710.22"));
- }
+ when(sdcRepoServiceMock.getLatestDBVersion()).thenReturn(DBVersion.fromString("1710.-1"));
+ testInstance.setPostMigrations(Collections.emptyList());
+ List<IMigrationStage> resolvedMigrations = testInstance.resolveMigrations();
+ assertEquals(resolvedMigrations.size(), 3);
+ assertEquals(resolvedMigrations.get(0).getVersion(), DBVersion.fromString("1710.1"));
+ assertEquals(resolvedMigrations.get(1).getVersion(), DBVersion.fromString("1710.3"));
+ assertEquals(resolvedMigrations.get(2).getVersion(), DBVersion.fromString("1710.22"));
+ }
- @Test
+ @Test
public void testResolveMigrations_emptyMigrationsList() {
- testInstance.setMigrations(Collections.emptyList());
- testInstance.setPostMigrations(Collections.emptyList());
- when(sdcRepoServiceMock.getLatestDBVersion()).thenReturn(DBVersion.fromString("1710.-1"));
- List<IMigrationStage> resolvedMigrations = testInstance.resolveMigrations();
- assertTrue(resolvedMigrations.isEmpty());
- }
+ testInstance.setMigrations(Collections.emptyList());
+ testInstance.setPostMigrations(Collections.emptyList());
+ when(sdcRepoServiceMock.getLatestDBVersion()).thenReturn(DBVersion.fromString("1710.-1"));
+ List<IMigrationStage> resolvedMigrations = testInstance.resolveMigrations();
+ assertTrue(resolvedMigrations.isEmpty());
+ }
- private Migration createMigration(String version) {
- return new Migration() {
- @Override
- public String description() {
- return null;
- }
+ private Migration createMigration(String version) {
+ return new Migration() {
+ @Override
+ public String description() {
+ return null;
+ }
- @Override
- public DBVersion getVersion() {
- return DBVersion.fromString(version);
- }
+ @Override
+ public DBVersion getVersion() {
+ return DBVersion.fromString(version);
+ }
- @Override
- public MigrationResult migrate() {
- return null;
- }
- };
- }
+ @Override
+ public MigrationResult migrate() {
+ return null;
+ }
+ };
+ }
+ private SpringBeansMigrationResolver createTestSubject() {
+ return new SpringBeansMigrationResolver(null, null, new SdcRepoService(new MigrationTasksDao()));
+ }
}
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/tasks/handlers/XlsOutputHandlerTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/tasks/handlers/XlsOutputHandlerTest.java
new file mode 100644
index 0000000..66d9b15
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/tasks/handlers/XlsOutputHandlerTest.java
@@ -0,0 +1,40 @@
+package org.openecomp.sdc.asdctool.migration.tasks.handlers;
+
+import org.junit.Test;
+
+public class XlsOutputHandlerTest {
+
+ private XlsOutputHandler createTestSubject() {
+ return new XlsOutputHandler(new Object());
+ }
+
+ @Test
+ public void testInitiate() throws Exception {
+ XlsOutputHandler testSubject;
+ Object[] title = new Object[] { null };
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.initiate(title);
+ }
+
+ @Test
+ public void testAddRecord() throws Exception {
+ XlsOutputHandler testSubject;
+ Object[] record = new Object[] { null };
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.addRecord(record);
+ }
+
+ @Test
+ public void testWriteOutput() throws Exception {
+ XlsOutputHandler testSubject;
+ boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.writeOutput();
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/tasks/mig1710/UpgradeMigration1710Test.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/tasks/mig1710/UpgradeMigration1710Test.java
index 0c1b32e..f2a0a3c 100644
--- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/tasks/mig1710/UpgradeMigration1710Test.java
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/tasks/mig1710/UpgradeMigration1710Test.java
@@ -1,8 +1,21 @@
package org.openecomp.sdc.asdctool.migration.tasks.mig1710;
-import com.google.common.collect.Lists;
-import fj.data.Either;
+import static org.junit.Assert.assertEquals;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -22,19 +35,20 @@
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum;
import org.openecomp.sdc.be.impl.ComponentsUtils;
-import org.openecomp.sdc.be.model.*;
+import org.openecomp.sdc.be.model.Component;
+import org.openecomp.sdc.be.model.ComponentInstance;
+import org.openecomp.sdc.be.model.LifecycleStateEnum;
+import org.openecomp.sdc.be.model.Resource;
+import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade;
import org.openecomp.sdc.be.model.operations.api.IUserAdminOperation;
import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus;
import org.openecomp.sdc.common.api.ConfigurationSource;
import org.openecomp.sdc.exception.ResponseFormat;
-import java.util.*;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
+import com.google.common.collect.Lists;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.*;
+import fj.data.Either;
@RunWith(MockitoJUnitRunner.class)
public class UpgradeMigration1710Test {
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/tasks/mig1802/SdcCatalogMigrationTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/tasks/mig1802/SdcCatalogMigrationTest.java
new file mode 100644
index 0000000..00b6d57
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/tasks/mig1802/SdcCatalogMigrationTest.java
@@ -0,0 +1,45 @@
+package org.openecomp.sdc.asdctool.migration.tasks.mig1802;
+
+import org.junit.Test;
+import org.openecomp.sdc.asdctool.migration.core.DBVersion;
+import org.openecomp.sdc.asdctool.migration.core.task.MigrationResult;
+import org.openecomp.sdc.be.dao.jsongraph.TitanDao;
+import org.openecomp.sdc.be.dao.titan.TitanGraphClient;
+import org.openecomp.sdc.be.model.jsontitan.operations.TopologyTemplateOperation;
+
+public class SdcCatalogMigrationTest {
+
+ private SdcCatalogMigration createTestSubject() {
+ return new SdcCatalogMigration(new TopologyTemplateOperation(), new TitanDao(new TitanGraphClient()));
+ }
+
+ @Test
+ public void testDescription() throws Exception {
+ SdcCatalogMigration testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.description();
+ }
+
+ @Test
+ public void testGetVersion() throws Exception {
+ SdcCatalogMigration testSubject;
+ DBVersion result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getVersion();
+ }
+
+ @Test
+ public void testMigrate() throws Exception {
+ SdcCatalogMigration testSubject;
+ MigrationResult result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.migrate();
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/servlets/ExportImportTitanServletTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/servlets/ExportImportTitanServletTest.java
new file mode 100644
index 0000000..2733bee
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/servlets/ExportImportTitanServletTest.java
@@ -0,0 +1,40 @@
+package org.openecomp.sdc.asdctool.servlets;
+
+import java.io.File;
+
+import javax.ws.rs.core.Response;
+
+import org.junit.Test;
+
+import com.thinkaurelius.titan.core.TitanGraph;
+
+public class ExportImportTitanServletTest {
+
+ private ExportImportTitanServlet createTestSubject() {
+ return new ExportImportTitanServlet();
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testExport() throws Exception {
+ ExportImportTitanServlet testSubject;
+ File titanPropertiesFile = null;
+ String exportGraphMetadata = "";
+ Response result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.export(titanPropertiesFile, exportGraphMetadata);
+ }
+
+ @Test(expected=NullPointerException.class)
+ public void testExportGraph() throws Exception {
+ ExportImportTitanServlet testSubject;
+ TitanGraph graph = null;
+ String outputDirectory = "";
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.exportGraph(graph, outputDirectory);
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/simulator/tenant/ImportTableConfigTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/simulator/tenant/ImportTableConfigTest.java
new file mode 100644
index 0000000..fe5d3d9
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/simulator/tenant/ImportTableConfigTest.java
@@ -0,0 +1,32 @@
+package org.openecomp.sdc.asdctool.simulator.tenant;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.dao.cassandra.CassandraClient;
+import org.openecomp.sdc.be.dao.cassandra.OperationalEnvironmentDao;
+
+public class ImportTableConfigTest {
+
+ private ImportTableConfig createTestSubject() {
+ return new ImportTableConfig();
+ }
+
+ @Test
+ public void testCassandraClient() throws Exception {
+ ImportTableConfig testSubject;
+ CassandraClient result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.cassandraClient();
+ }
+
+ @Test
+ public void testOperationalEnvironmentDao() throws Exception {
+ ImportTableConfig testSubject;
+ OperationalEnvironmentDao result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.operationalEnvironmentDao();
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/simulator/tenant/OperationalEnvironmentTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/simulator/tenant/OperationalEnvironmentTest.java
new file mode 100644
index 0000000..4cb2d4f
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/simulator/tenant/OperationalEnvironmentTest.java
@@ -0,0 +1,200 @@
+package org.openecomp.sdc.asdctool.simulator.tenant;
+
+import org.junit.Test;
+import org.openecomp.sdc.be.datatypes.enums.EnvironmentStatusEnum;
+
+public class OperationalEnvironmentTest {
+
+ private OperationalEnvironment createTestSubject() {
+ return new OperationalEnvironment();
+ }
+
+ @Test
+ public void testGetLastModified() throws Exception {
+ OperationalEnvironment testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getLastModified();
+ }
+
+ @Test
+ public void testSetLastModified() throws Exception {
+ OperationalEnvironment testSubject;
+ String lastModified = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setLastModified(lastModified);
+ }
+
+ @Test
+ public void testGetEnvironmentId() throws Exception {
+ OperationalEnvironment testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getEnvironmentId();
+ }
+
+ @Test
+ public void testSetEnvironmentId() throws Exception {
+ OperationalEnvironment testSubject;
+ String environmentId = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setEnvironmentId(environmentId);
+ }
+
+ @Test
+ public void testGetTenant() throws Exception {
+ OperationalEnvironment testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getTenant();
+ }
+
+ @Test
+ public void testSetTenant() throws Exception {
+ OperationalEnvironment testSubject;
+ String tenant = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setTenant(tenant);
+ }
+
+ @Test
+ public void testGetIsProduction() throws Exception {
+ OperationalEnvironment testSubject;
+ Boolean result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getIsProduction();
+ }
+
+ @Test
+ public void testSetIsProduction() throws Exception {
+ OperationalEnvironment testSubject;
+ Boolean production = null;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setIsProduction(production);
+ }
+
+ @Test
+ public void testGetEcompWorkloadContext() throws Exception {
+ OperationalEnvironment testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getEcompWorkloadContext();
+ }
+
+ @Test
+ public void testSetEcompWorkloadContext() throws Exception {
+ OperationalEnvironment testSubject;
+ String ecompWorkloadContext = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setEcompWorkloadContext(ecompWorkloadContext);
+ }
+
+ @Test
+ public void testGetStatus() throws Exception {
+ OperationalEnvironment testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getStatus();
+ }
+
+ @Test
+ public void testSetStatus() throws Exception {
+ OperationalEnvironment testSubject;
+ String status = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setStatus(status);
+ }
+
+ @Test
+ public void testSetStatus_1() throws Exception {
+ OperationalEnvironment testSubject;
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setStatus(EnvironmentStatusEnum.COMPLETED);
+ }
+
+ @Test
+ public void testGetDmaapUebAddress() throws Exception {
+ OperationalEnvironment testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getDmaapUebAddress();
+ }
+
+ @Test
+ public void testSetDmaapUebAddress() throws Exception {
+ OperationalEnvironment testSubject;
+ String dmaapUebAddress = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setDmaapUebAddress(dmaapUebAddress);
+ }
+
+ @Test
+ public void testGetUebApikey() throws Exception {
+ OperationalEnvironment testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getUebApikey();
+ }
+
+ @Test
+ public void testSetUebApikey() throws Exception {
+ OperationalEnvironment testSubject;
+ String uebApikey = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setUebApikey(uebApikey);
+ }
+
+ @Test
+ public void testGetUebSecretKey() throws Exception {
+ OperationalEnvironment testSubject;
+ String result;
+
+ // default test
+ testSubject = createTestSubject();
+ result = testSubject.getUebSecretKey();
+ }
+
+ @Test
+ public void testSetUebSecretKey() throws Exception {
+ OperationalEnvironment testSubject;
+ String uebSecretKey = "";
+
+ // default test
+ testSubject = createTestSubject();
+ testSubject.setUebSecretKey(uebSecretKey);
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/simulator/tenant/OperationalEvnironmentImportHandlerTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/simulator/tenant/OperationalEvnironmentImportHandlerTest.java
new file mode 100644
index 0000000..cca0327
--- /dev/null
+++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/simulator/tenant/OperationalEvnironmentImportHandlerTest.java
@@ -0,0 +1,22 @@
+package org.openecomp.sdc.asdctool.simulator.tenant;
+
+import org.junit.Test;
+
+public class OperationalEvnironmentImportHandlerTest {
+
+ @Test
+ public void testExecute() throws Exception {
+ String fileName = "";
+
+ // default test
+ OperationalEvnironmentImportHandler.execute(fileName);
+ }
+
+ @Test
+ public void testGetTableName() throws Exception {
+ String result;
+
+ // default test
+ result = OperationalEvnironmentImportHandler.getTableName();
+ }
+}
\ No newline at end of file
diff --git a/asdctool/src/test/resources/graph.json b/asdctool/src/test/resources/graph.json
new file mode 100644
index 0000000..ed56de7
--- /dev/null
+++ b/asdctool/src/test/resources/graph.json
@@ -0,0 +1 @@
+"{\"container\":{\"accessControlPolicyIDs\":[\"/in-cse/acp-761663881\"],\"creationTime\":\"20170630T111742\",\"currentByteSize\":0,\"currentNrOfInstances\":0,\"expirationTime\":\"20180630T111742\",\"lastModifiedTime\":\"20170630T111742\",\"latest\":\"/in-cse/in-name/cnt_900407520/la\",\"maxByteSize\":10000,\"maxInstanceAge\":0,\"maxNrOfInstances\":10,\"oldest\":\"/in-cse/in-name/cnt_900407520/ol\",\"parentID\":\"/in-cse\",\"resourceID\":\"/in-cse/cnt-900407520\",\"resourceName\":\"cnt_900407520\",\"resourceType\":\"int3\",\"stateTag\":0}}"
\ No newline at end of file
diff --git a/asdctool/src/test/resources/graphError.json b/asdctool/src/test/resources/graphError.json
new file mode 100644
index 0000000..b7ccf92
--- /dev/null
+++ b/asdctool/src/test/resources/graphError.json
@@ -0,0 +1 @@
+(("ERRRRORROROR{{{\"container\":zxcvfxcvxcvxc{\"accessContcxvxcvrolPolicyIDs\":[\"/in-cse/acp-7cxvxcvxcvx1663881\"],\"creationTime\":\"20170630T111742\",\"currentByteSize\":0,\"currentNrOfInstances\":0,\"expirationTime\":\"20180630T111742\",\"lastModifiedTime\":\"20170630T111742\",\"latest\":\"/in-cse/in-name/cnt_900407520/la\",\"maxByteSize\":10000,\"maxInstanceAge\":0,\"maxNrOfInstances\":10,\"oldest\":\"/in-cse/in-name/cnt_900407520/ol\",\"parentID\":\"/in-cse\",\"resourceID\":\"/in-cse/cnt-900407520\",\"resourceName\":((\"cnt_900407520\",\"resourceTypeR\"RXCFV:\"int3\",\"stateTag\":0}}"
\ No newline at end of file