diff options
123 files changed, 11777 insertions, 877 deletions
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 eafec8bf60..9b1e3dc227 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,26 @@ 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; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.lang.reflect.Type; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.EnumMap; +import java.util.Map; +import java.util.TimeZone; + import org.apache.commons.lang.SystemUtils; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.cluster.metadata.IndexMetaData; @@ -40,25 +55,34 @@ import org.openecomp.sdc.be.dao.cassandra.CassandraOperationStatus; import org.openecomp.sdc.be.dao.cassandra.schema.Table; import org.openecomp.sdc.be.dao.es.ElasticSearchClient; import org.openecomp.sdc.be.resources.data.ESArtifactData; -import org.openecomp.sdc.be.resources.data.auditing.*; +import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum; +import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent; +import org.openecomp.sdc.be.resources.data.auditing.AuditingGetUebClusterEvent; +import org.openecomp.sdc.be.resources.data.auditing.AuditingTypesConstants; +import org.openecomp.sdc.be.resources.data.auditing.AuthEvent; +import org.openecomp.sdc.be.resources.data.auditing.CategoryEvent; +import org.openecomp.sdc.be.resources.data.auditing.ConsumerEvent; +import org.openecomp.sdc.be.resources.data.auditing.DistributionDeployEvent; +import org.openecomp.sdc.be.resources.data.auditing.DistributionDownloadEvent; +import org.openecomp.sdc.be.resources.data.auditing.DistributionEngineEvent; +import org.openecomp.sdc.be.resources.data.auditing.DistributionNotificationEvent; +import org.openecomp.sdc.be.resources.data.auditing.DistributionStatusEvent; +import org.openecomp.sdc.be.resources.data.auditing.GetCategoryHierarchyEvent; +import org.openecomp.sdc.be.resources.data.auditing.GetUsersListEvent; +import org.openecomp.sdc.be.resources.data.auditing.ResourceAdminEvent; +import org.openecomp.sdc.be.resources.data.auditing.UserAccessEvent; +import org.openecomp.sdc.be.resources.data.auditing.UserAdminEvent; import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import java.io.*; -import java.lang.reflect.Type; -import java.net.MalformedURLException; -import java.net.URISyntaxException; -import java.net.URL; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.EnumMap; -import java.util.Map; -import java.util.TimeZone; +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/GraphJsonValidator.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/GraphJsonValidator.java index 1ce976dbe5..23019b9b15 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/GraphJsonValidator.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/GraphJsonValidator.java @@ -21,10 +21,6 @@ package org.openecomp.sdc.asdctool.impl; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; @@ -32,6 +28,11 @@ import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.fasterxml.jackson.databind.ObjectMapper; + /** * simple util class to verify that the titan export json graph is not corrupted */ diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/PopulateComponentCache.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/PopulateComponentCache.java index eac972660f..b67bfc8097 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/PopulateComponentCache.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/PopulateComponentCache.java @@ -20,9 +20,7 @@ package org.openecomp.sdc.asdctool.impl; -import java.io.IOException; import java.util.ArrayList; -import java.util.Date; import java.util.Iterator; import java.util.List; import java.util.concurrent.Callable; @@ -36,9 +34,7 @@ import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary; import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.model.Component; -import org.openecomp.sdc.be.model.Product; import org.openecomp.sdc.be.model.Resource; -import org.openecomp.sdc.be.model.Service; import org.openecomp.sdc.be.model.cache.ComponentCache; import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/ProductLogic.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/ProductLogic.java index 9f15c83dd8..7ed8b17907 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/ProductLogic.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/ProductLogic.java @@ -20,18 +20,19 @@ package org.openecomp.sdc.asdctool.impl; -import com.thinkaurelius.titan.core.TitanFactory; -import com.thinkaurelius.titan.core.TitanGraph; -import com.thinkaurelius.titan.core.TitanVertex; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + import org.apache.tinkerpop.gremlin.structure.Vertex; import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; +import com.thinkaurelius.titan.core.TitanFactory; +import com.thinkaurelius.titan.core.TitanGraph; +import com.thinkaurelius.titan.core.TitanVertex; /** * Created by mlando on 2/23/2016. diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/RestUtils.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/RestUtils.java index c2ebc24d49..355780cfc6 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/RestUtils.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/RestUtils.java @@ -20,17 +20,16 @@ package org.openecomp.sdc.asdctool.impl; +import java.io.IOException; + import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpDelete; import org.apache.http.client.methods.HttpUriRequest; - import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.IOException; - /** * Created by mlando on 2/23/2016. */ diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/ValidationToolBL.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/ValidationToolBL.java index a57a237e76..e373107081 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/ValidationToolBL.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/ValidationToolBL.java @@ -1,5 +1,7 @@ package org.openecomp.sdc.asdctool.impl.validator; +import java.util.List; + import org.openecomp.sdc.asdctool.impl.validator.executers.ValidatorExecuter; import org.openecomp.sdc.asdctool.impl.validator.utils.ReportManager; import org.slf4j.Logger; @@ -7,8 +9,6 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; -import java.util.*; - /** * Created by chaya on 7/3/2017. */ 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 0e6b2c7d16..3b81ba81e4 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 @@ -1,11 +1,11 @@ package org.openecomp.sdc.asdctool.impl.validator.config; +import org.openecomp.sdc.asdctool.impl.validator.ValidationToolBL; +import org.openecomp.sdc.asdctool.impl.validator.executers.ServiceValidatorExecuter; +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; import org.openecomp.sdc.asdctool.impl.validator.tasks.artifacts.VfArtifactValidationTask; -import org.openecomp.sdc.asdctool.impl.validator.executers.ServiceValidatorExecuter; -import org.openecomp.sdc.asdctool.impl.validator.executers.VfValidatorExecuter; -import org.openecomp.sdc.asdctool.impl.validator.ValidationToolBL; 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; @@ -15,7 +15,16 @@ import org.openecomp.sdc.be.dao.cassandra.CassandraClient; import org.openecomp.sdc.be.dao.jsongraph.TitanDao; import org.openecomp.sdc.be.dao.titan.TitanGraphClient; import org.openecomp.sdc.be.model.DerivedNodeTypeResolver; -import org.openecomp.sdc.be.model.jsontitan.operations.*; +import org.openecomp.sdc.be.model.jsontitan.operations.ArtifactsOperations; +import org.openecomp.sdc.be.model.jsontitan.operations.ByToscaNameDerivedNodeTypeResolver; +import org.openecomp.sdc.be.model.jsontitan.operations.CategoryOperation; +import org.openecomp.sdc.be.model.jsontitan.operations.GroupsOperation; +import org.openecomp.sdc.be.model.jsontitan.operations.NodeTemplateOperation; +import org.openecomp.sdc.be.model.jsontitan.operations.NodeTypeOperation; +import org.openecomp.sdc.be.model.jsontitan.operations.TopologyTemplateOperation; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaDataOperation; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaElementLifecycleOperation; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceValidatorExecuter.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceValidatorExecuter.java index 817ab15418..b64fdde8d7 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceValidatorExecuter.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceValidatorExecuter.java @@ -1,5 +1,8 @@ package org.openecomp.sdc.asdctool.impl.validator.executers; +import java.util.ArrayList; +import java.util.List; + import org.openecomp.sdc.asdctool.impl.validator.tasks.ServiceValidationTask; import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; @@ -7,8 +10,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import java.util.*; - /** * Created by chaya on 7/4/2017. */ diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/TopologyTemplateValidatorExecuter.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/TopologyTemplateValidatorExecuter.java index 15f25738c0..04f014fbc9 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/TopologyTemplateValidatorExecuter.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/TopologyTemplateValidatorExecuter.java @@ -1,6 +1,12 @@ package org.openecomp.sdc.asdctool.impl.validator.executers; -import fj.data.Either; +import java.util.ArrayList; +import java.util.EnumMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + import org.openecomp.sdc.asdctool.impl.validator.tasks.TopologyTemplateValidationTask; import org.openecomp.sdc.asdctool.impl.validator.utils.ReportManager; import org.openecomp.sdc.asdctool.impl.validator.utils.VertexResult; @@ -12,12 +18,11 @@ import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.model.jsontitan.operations.TopologyTemplateOperation; -import org.openecomp.sdc.be.model.jsontitan.operations.ToscaOperationFacade; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import java.util.*; +import fj.data.Either; /** * Created by chaya on 7/3/2017. diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/ValidatorExecuter.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/ValidatorExecuter.java index 8281d1f353..519a900ec9 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/ValidatorExecuter.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/ValidatorExecuter.java @@ -1,10 +1,5 @@ package org.openecomp.sdc.asdctool.impl.validator.executers; -import org.openecomp.sdc.asdctool.impl.validator.utils.ElementTypeEnum; -import org.openecomp.sdc.be.model.Component; - -import java.util.List; - /** * Created by chaya on 7/3/2017. */ diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/VfValidatorExecuter.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/VfValidatorExecuter.java index 913a36fbd4..b4f333dab3 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/VfValidatorExecuter.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/executers/VfValidatorExecuter.java @@ -1,12 +1,13 @@ package org.openecomp.sdc.asdctool.impl.validator.executers; +import java.util.ArrayList; +import java.util.List; + import org.openecomp.sdc.asdctool.impl.validator.tasks.VfValidationTask; import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.springframework.beans.factory.annotation.Autowired; -import java.util.*; - /** * Created by chaya on 7/3/2017. */ diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ArtifactValidationUtils.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ArtifactValidationUtils.java index faccd647c2..90d8f8639c 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ArtifactValidationUtils.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ArtifactValidationUtils.java @@ -1,6 +1,11 @@ package org.openecomp.sdc.asdctool.impl.validator.tasks.artifacts; -import fj.data.Either; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Optional; + import org.openecomp.sdc.asdctool.impl.validator.utils.ReportManager; import org.openecomp.sdc.be.dao.cassandra.ArtifactCassandraDao; import org.openecomp.sdc.be.dao.cassandra.CassandraOperationStatus; @@ -14,7 +19,7 @@ import org.openecomp.sdc.be.model.jsontitan.operations.TopologyTemplateOperation import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; import org.springframework.beans.factory.annotation.Autowired; -import java.util.*; +import fj.data.Either; /** * Created by chaya on 7/6/2017. diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ArtifactsVertexResult.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ArtifactsVertexResult.java index c010148644..c82a7b9d4f 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ArtifactsVertexResult.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ArtifactsVertexResult.java @@ -1,10 +1,10 @@ package org.openecomp.sdc.asdctool.impl.validator.tasks.artifacts; -import org.openecomp.sdc.asdctool.impl.validator.utils.VertexResult; - import java.util.HashSet; import java.util.Set; +import org.openecomp.sdc.asdctool.impl.validator.utils.VertexResult; + /** * Created by chaya on 7/25/2017. */ diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/tasks/moduleJson/ModuleJsonTask.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/tasks/moduleJson/ModuleJsonTask.java index 187359f127..78045a56a6 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/tasks/moduleJson/ModuleJsonTask.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/tasks/moduleJson/ModuleJsonTask.java @@ -1,7 +1,13 @@ package org.openecomp.sdc.asdctool.impl.validator.tasks.moduleJson; -import fj.data.Either; -import org.apache.cassandra.cql3.CQL3Type; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; + import org.openecomp.sdc.asdctool.impl.validator.tasks.ServiceValidationTask; import org.openecomp.sdc.asdctool.impl.validator.utils.ReportManager; import org.openecomp.sdc.asdctool.impl.validator.utils.VertexResult; @@ -18,8 +24,7 @@ import org.openecomp.sdc.be.model.jsontitan.operations.TopologyTemplateOperation import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; import org.springframework.beans.factory.annotation.Autowired; -import java.util.*; -import java.util.stream.Collectors; +import fj.data.Either; /** * Created by chaya on 7/18/2017. diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/utils/ElementTypeEnum.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/utils/ElementTypeEnum.java index 245d38c853..e6a09ee875 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/utils/ElementTypeEnum.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/utils/ElementTypeEnum.java @@ -1,10 +1,10 @@ package org.openecomp.sdc.asdctool.impl.validator.utils; -import org.openecomp.sdc.asdctool.impl.validator.executers.VfValidatorExecuter; - import java.util.ArrayList; import java.util.List; +import org.openecomp.sdc.asdctool.impl.validator.executers.VfValidatorExecuter; + /** * Created by chaya on 7/4/2017. */ diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManager.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManager.java index 64bea12957..4a4af15fdf 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManager.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/utils/ReportManager.java @@ -1,14 +1,18 @@ package org.openecomp.sdc.asdctool.impl.validator.utils; -import org.apache.commons.lang.text.StrBuilder; -import org.openecomp.sdc.asdctool.impl.validator.config.ValidationConfigManager; -import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; - import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.StandardOpenOption; -import java.util.*; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Optional; +import java.util.Set; + +import org.apache.commons.lang.text.StrBuilder; +import org.openecomp.sdc.asdctool.impl.validator.config.ValidationConfigManager; +import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; /** * Created by chaya on 7/5/2017. diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/utils/ValidationTaskResult.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/utils/ValidationTaskResult.java index 8fad932941..d1d1c261f7 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/utils/ValidationTaskResult.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/impl/validator/utils/ValidationTaskResult.java @@ -1,7 +1,6 @@ package org.openecomp.sdc.asdctool.impl.validator.utils; import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; -import org.openecomp.sdc.be.model.Component; /** * Created by chaya on 7/5/2017. diff --git a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/SdcMigrationTool.java b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/SdcMigrationTool.java index e2691dc7f8..21671a67a9 100644 --- a/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/SdcMigrationTool.java +++ b/asdctool/src/main/java/org/openecomp/sdc/asdctool/migration/core/SdcMigrationTool.java @@ -1,5 +1,7 @@ package org.openecomp.sdc.asdctool.migration.core; +import java.util.List; + import org.openecomp.sdc.asdctool.migration.core.execution.MigrationExecutionResult; import org.openecomp.sdc.asdctool.migration.core.execution.MigrationExecutorImpl; import org.openecomp.sdc.asdctool.migration.core.task.Migration; @@ -9,8 +11,6 @@ import org.openecomp.sdc.asdctool.migration.service.SdcRepoService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.List; - public class SdcMigrationTool { private static final Logger LOGGER = LoggerFactory.getLogger(SdcMigrationTool.class); diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/AppTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/AppTest.java deleted file mode 100644 index ae23b73d7d..0000000000 --- a/asdctool/src/test/java/org/openecomp/sdc/asdctool/AppTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * SDC - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.sdc.asdctool; - -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - -/** - * Unit test for simple App. - */ -public class AppTest extends TestCase { - /** - * Create the test case - * - * @param testName - * name of the test case - */ - public AppTest(String testName) { - super(testName); - } - - /** - * @return the suite of tests being tested - */ - public static Test suite() { - return new TestSuite(AppTest.class); - } - - /** - * Rigourous Test :-) - */ - public void testApp() { - assertTrue(true); - } -} 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 new file mode 100644 index 0000000000..5afabc5639 --- /dev/null +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/enums/SchemaZipFileEnumTest.java @@ -0,0 +1,123 @@ +package org.openecomp.sdc.asdctool.enums; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class SchemaZipFileEnumTest { + + private SchemaZipFileEnum createTestSubject() { + 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/validator/config/ValidationConfigManagerTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationConfigManagerTest.java new file mode 100644 index 0000000000..775006bfdc --- /dev/null +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationConfigManagerTest.java @@ -0,0 +1,70 @@ +package org.openecomp.sdc.asdctool.impl.validator.config; + +import java.util.Properties; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class ValidationConfigManagerTest { + + private ValidationConfigManager createTestSubject() { + return new ValidationConfigManager(); + } + + + @Test + public void testGetOutputFilePath() throws Exception { + String result; + + // default test + result = ValidationConfigManager.getOutputFilePath(); + } + + + @Test + public void testSetOutputFilePath() throws Exception { + String outputPath = ""; + + // default test + ValidationConfigManager.setOutputFilePath(outputPath); + } + + + @Test + public void testGetCsvReportFilePath() throws Exception { + String result; + + // default test + result = ValidationConfigManager.getCsvReportFilePath(); + } + + + @Test + public void testSetCsvReportFilePath() throws Exception { + String outputPath = ""; + + // default test + ValidationConfigManager.setCsvReportFilePath(outputPath); + } + + + @Test + public void testSetValidationConfiguration() throws Exception { + String path = ""; + Properties result; + + // default test + result = ValidationConfigManager.setValidationConfiguration(path); + } + + + @Test + public void testGetValidationConfiguration() throws Exception { + Properties result; + + // default test + result = ValidationConfigManager.getValidationConfiguration(); + } +}
\ 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 new file mode 100644 index 0000000000..f220fa149a --- /dev/null +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/config/ValidationToolConfigurationTest.java @@ -0,0 +1,275 @@ +package org.openecomp.sdc.asdctool.impl.validator.config; + +import javax.annotation.Generated; + +import org.junit.Test; +import org.openecomp.sdc.asdctool.impl.validator.ValidationToolBL; +import org.openecomp.sdc.asdctool.impl.validator.executers.ServiceValidatorExecuter; +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; +import org.openecomp.sdc.asdctool.impl.validator.tasks.artifacts.VfArtifactValidationTask; +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.TitanClientStrategy; +import org.openecomp.sdc.be.dao.cassandra.ArtifactCassandraDao; +import org.openecomp.sdc.be.dao.cassandra.CassandraClient; +import org.openecomp.sdc.be.dao.jsongraph.TitanDao; +import org.openecomp.sdc.be.dao.titan.TitanGraphClient; +import org.openecomp.sdc.be.model.DerivedNodeTypeResolver; +import org.openecomp.sdc.be.model.jsontitan.operations.ArtifactsOperations; +import org.openecomp.sdc.be.model.jsontitan.operations.CategoryOperation; +import org.openecomp.sdc.be.model.jsontitan.operations.GroupsOperation; +import org.openecomp.sdc.be.model.jsontitan.operations.NodeTemplateOperation; +import org.openecomp.sdc.be.model.jsontitan.operations.NodeTypeOperation; +import org.openecomp.sdc.be.model.jsontitan.operations.TopologyTemplateOperation; +import org.openecomp.sdc.be.model.jsontitan.operations.ToscaDataOperation; +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() throws Exception { + ValidationToolConfiguration testSubject; + ServiceValidatorExecuter result; + + // default test + testSubject = createTestSubject(); + result = testSubject.basicServiceValidator(); + } + + + @Test + public void testVfArtifactValidationTask() throws Exception { + ValidationToolConfiguration testSubject; + VfArtifactValidationTask result; + + // default test + testSubject = createTestSubject(); + result = testSubject.vfArtifactValidationTask(); + } + + + @Test + public void testServiceArtifactValidationTask() throws Exception { + ValidationToolConfiguration testSubject; + ServiceArtifactValidationTask result; + + // default test + testSubject = createTestSubject(); + result = testSubject.serviceArtifactValidationTask(); + } + + + @Test + public void testModuleJsonTask() throws Exception { + ValidationToolConfiguration testSubject; + ModuleJsonTask result; + + // default test + testSubject = createTestSubject(); + result = testSubject.moduleJsonTask(); + } + + + @Test + public void testValidationToolBL() throws Exception { + ValidationToolConfiguration testSubject; + ValidationToolBL result; + + // default test + testSubject = createTestSubject(); + result = testSubject.validationToolBL(); + } + + + @Test + public void testBasicVfValidator() throws Exception { + ValidationToolConfiguration testSubject; + VfValidatorExecuter result; + + // default test + testSubject = createTestSubject(); + result = testSubject.basicVfValidator(); + } + + + @Test + public void testReportManager() throws Exception { + ValidationToolConfiguration testSubject; + ReportManager result; + + // default test + testSubject = createTestSubject(); + result = testSubject.reportManager(); + } + + + @Test + public void testArtifactCassandraDao() throws Exception { + ValidationToolConfiguration testSubject; + ArtifactCassandraDao result; + + // default test + testSubject = createTestSubject(); + result = testSubject.artifactCassandraDao(); + } + + + @Test + public void testArtifactValidationUtils() throws Exception { + ValidationToolConfiguration testSubject; + ArtifactValidationUtils result; + + // default test + testSubject = createTestSubject(); + result = testSubject.artifactValidationUtils(); + } + + + @Test + public void testJsonGroupsOperation() throws Exception { + ValidationToolConfiguration testSubject; + GroupsOperation result; + + // default test + testSubject = createTestSubject(); + result = testSubject.jsonGroupsOperation(); + } + + + @Test + public void testCassandraClient() throws Exception { + ValidationToolConfiguration testSubject; + CassandraClient result; + + // default test + testSubject = createTestSubject(); + result = testSubject.cassandraClient(); + } + + + @Test + public void testDaoStrategy() throws Exception { + ValidationToolConfiguration testSubject; + TitanClientStrategy result; + + // default test + testSubject = createTestSubject(); + result = testSubject.daoStrategy(); + } + + + + + + @Test + public void testToscaOperationFacade() throws Exception { + ValidationToolConfiguration testSubject; + ToscaOperationFacade result; + + // default test + testSubject = createTestSubject(); + result = testSubject.toscaOperationFacade(); + } + + + @Test + public void testNodeTypeOperation() throws Exception { + ValidationToolConfiguration testSubject; + DerivedNodeTypeResolver migrationDerivedNodeTypeResolver = null; + NodeTypeOperation result; + + // default test + testSubject = createTestSubject(); + result = testSubject.nodeTypeOperation(migrationDerivedNodeTypeResolver); + } + + + @Test + public void testTopologyTemplateOperation() throws Exception { + ValidationToolConfiguration testSubject; + TopologyTemplateOperation result; + + // default test + testSubject = createTestSubject(); + result = testSubject.topologyTemplateOperation(); + } + + + + + + @Test + public void testMigrationDerivedNodeTypeResolver() throws Exception { + ValidationToolConfiguration testSubject; + DerivedNodeTypeResolver result; + + // default test + testSubject = createTestSubject(); + result = testSubject.migrationDerivedNodeTypeResolver(); + } + + + @Test + public void testTitanDao() throws Exception { + ValidationToolConfiguration testSubject; + TitanGraphClient titanGraphClient = null; + TitanDao result; + + // default test + testSubject = createTestSubject(); + result = testSubject.titanDao(titanGraphClient); + } + + + @Test + public void testCategoryOperation() throws Exception { + ValidationToolConfiguration testSubject; + CategoryOperation result; + + // default test + testSubject = createTestSubject(); + result = testSubject.categoryOperation(); + } + + + @Test + public void testArtifactsOperation() throws Exception { + ValidationToolConfiguration testSubject; + ArtifactsOperations result; + + // default test + testSubject = createTestSubject(); + result = testSubject.artifactsOperation(); + } + + + @Test + public void testToscaDataOperation() throws Exception { + ValidationToolConfiguration testSubject; + ToscaDataOperation result; + + // default test + testSubject = createTestSubject(); + result = testSubject.toscaDataOperation(); + } + + + @Test + public void testToscaElementLifecycleOperation() throws Exception { + ValidationToolConfiguration testSubject; + ToscaElementLifecycleOperation result; + + // default test + testSubject = createTestSubject(); + result = testSubject.toscaElementLifecycleOperation(); + } +}
\ 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 new file mode 100644 index 0000000000..344c439f4b --- /dev/null +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/ServiceValidatorExecuterTest.java @@ -0,0 +1,27 @@ +package org.openecomp.sdc.asdctool.impl.validator.executers; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class ServiceValidatorExecuterTest { + + private ServiceValidatorExecuter createTestSubject() { + return new ServiceValidatorExecuter(); + } + + + + + + @Test + public void testGetName() throws Exception { + ServiceValidatorExecuter testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getName(); + } +}
\ 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 new file mode 100644 index 0000000000..523b9ac077 --- /dev/null +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/TopologyTemplateValidatorExecuterTest.java @@ -0,0 +1,44 @@ +package org.openecomp.sdc.asdctool.impl.validator.executers; + +import java.util.List; + +import org.junit.Test; +import org.openecomp.sdc.asdctool.impl.validator.tasks.TopologyTemplateValidationTask; +import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; +import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; + + +public class TopologyTemplateValidatorExecuterTest { + + private TopologyTemplateValidatorExecuter createTestSubject() { + return new TopologyTemplateValidatorExecuter(); + } + + + @Test + public void testSetName() throws Exception { + TopologyTemplateValidatorExecuter testSubject; + String name = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setName(name); + } + + + @Test + public void testGetName() throws Exception { + TopologyTemplateValidatorExecuter testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getName(); + } + + + + + + +}
\ 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 new file mode 100644 index 0000000000..0d75c4d8b2 --- /dev/null +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/executers/VfValidatorExecuterTest.java @@ -0,0 +1,25 @@ +package org.openecomp.sdc.asdctool.impl.validator.executers; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class VfValidatorExecuterTest { + + private VfValidatorExecuter createTestSubject() { + return new VfValidatorExecuter(); + } + + + + @Test + public void testGetName() throws Exception { + VfValidatorExecuter testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getName(); + } +}
\ 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 new file mode 100644 index 0000000000..ba1bd72fb7 --- /dev/null +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ArtifactsVertexResultTest.java @@ -0,0 +1,35 @@ +package org.openecomp.sdc.asdctool.impl.validator.tasks.artifacts; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class ArtifactsVertexResultTest { + + private ArtifactsVertexResult createTestSubject() { + return new ArtifactsVertexResult(); + } + + + @Test + public void testAddNotFoundArtifact() throws Exception { + ArtifactsVertexResult testSubject; + String artifactId = ""; + + // default test + testSubject = createTestSubject(); + testSubject.addNotFoundArtifact(artifactId); + } + + + @Test + public void testGetResult() throws Exception { + ArtifactsVertexResult testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getResult(); + } +}
\ No newline at end of file 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 new file mode 100644 index 0000000000..cdada41b92 --- /dev/null +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/ServiceArtifactValidationTaskTest.java @@ -0,0 +1,17 @@ +package org.openecomp.sdc.asdctool.impl.validator.tasks.artifacts; + +import javax.annotation.Generated; + +import org.junit.Test; +import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; + + +public class ServiceArtifactValidationTaskTest { + + private ServiceArtifactValidationTask createTestSubject() { + return new ServiceArtifactValidationTask(); + } + + + +}
\ 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 new file mode 100644 index 0000000000..554e58d9d5 --- /dev/null +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/tasks/artifacts/VfArtifactValidationTaskTest.java @@ -0,0 +1,18 @@ +package org.openecomp.sdc.asdctool.impl.validator.tasks.artifacts; + +import javax.annotation.Generated; + +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(); + } + + + +}
\ 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 new file mode 100644 index 0000000000..6e72a31421 --- /dev/null +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ElementTypeEnumTest.java @@ -0,0 +1,78 @@ +package org.openecomp.sdc.asdctool.impl.validator.utils; + +import java.util.List; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class ElementTypeEnumTest { + + private ElementTypeEnum createTestSubject() { + return ElementTypeEnum.VF; + } + + + @Test + public void testGetByType() throws Exception { + String elementType = ""; + ElementTypeEnum result; + + // default test + result = ElementTypeEnum.getByType(elementType); + } + + + @Test + public void testGetAllTypes() throws Exception { + List<String> result; + + // default test + result = ElementTypeEnum.getAllTypes(); + } + + + @Test + public void testGetElementType() throws Exception { + ElementTypeEnum testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getElementType(); + } + + + @Test + public void testSetElementType() throws Exception { + ElementTypeEnum testSubject; + String elementType = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setElementType(elementType); + } + + + @Test + public void testGetClazz() throws Exception { + ElementTypeEnum testSubject; + Class result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getClazz(); + } + + + @Test + public void testSetClazz() throws Exception { + ElementTypeEnum testSubject; + Class clazz = null; + + // default test + testSubject = createTestSubject(); + testSubject.setClazz(clazz); + } +}
\ No newline at end of file diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ValidationTaskResultTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ValidationTaskResultTest.java new file mode 100644 index 0000000000..96eedcf1fd --- /dev/null +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/ValidationTaskResultTest.java @@ -0,0 +1,80 @@ +package org.openecomp.sdc.asdctool.impl.validator.utils; + +import javax.annotation.Generated; + +import org.junit.Test; +import org.openecomp.sdc.be.dao.jsongraph.GraphVertex; + + +public class ValidationTaskResultTest { + + private ValidationTaskResult createTestSubject() { + return new ValidationTaskResult(new GraphVertex(), "", "", false); + } + + + @Test + public void testGetName() throws Exception { + ValidationTaskResult testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getName(); + } + + + @Test + public void testSetName() throws Exception { + ValidationTaskResult testSubject; + String name = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setName(name); + } + + + @Test + public void testGetResultMessage() throws Exception { + ValidationTaskResult testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getResultMessage(); + } + + + @Test + public void testSetResultMessage() throws Exception { + ValidationTaskResult testSubject; + String resultMessage = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setResultMessage(resultMessage); + } + + + @Test + public void testIsSuccessful() throws Exception { + ValidationTaskResult testSubject; + boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.isSuccessful(); + } + + + @Test + public void testSetSuccessful() throws Exception { + ValidationTaskResult testSubject; + boolean successful = false; + + // default test + testSubject = createTestSubject(); + testSubject.setSuccessful(successful); + } +}
\ 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 new file mode 100644 index 0000000000..3b88a683ed --- /dev/null +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/impl/validator/utils/VertexResultTest.java @@ -0,0 +1,46 @@ +package org.openecomp.sdc.asdctool.impl.validator.utils; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class VertexResultTest { + + private VertexResult createTestSubject() { + return new VertexResult(); + } + + + @Test + public void testGetStatus() throws Exception { + VertexResult testSubject; + boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getStatus(); + } + + + @Test + public void testSetStatus() throws Exception { + VertexResult testSubject; + boolean status = false; + + // default test + testSubject = createTestSubject(); + testSubject.setStatus(status); + } + + + @Test + public void testGetResult() throws Exception { + VertexResult testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getResult(); + } +}
\ 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 0000000000..e8641097b6 --- /dev/null +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/config/MigrationSpringConfigTest.java @@ -0,0 +1,78 @@ +package org.openecomp.sdc.asdctool.migration.config; + +import javax.annotation.Generated; + +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.dao.cassandra.CassandraClient; + + +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 testCassandraClient() throws Exception { + MigrationSpringConfig testSubject; + CassandraClient result; + + // default test + testSubject = createTestSubject(); + result = testSubject.cassandraClient(); + } +}
\ No newline at end of file diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/task/MigrationResultTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/task/MigrationResultTest.java new file mode 100644 index 0000000000..31af99c64d --- /dev/null +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/migration/core/task/MigrationResultTest.java @@ -0,0 +1,58 @@ +package org.openecomp.sdc.asdctool.migration.core.task; + +import javax.annotation.Generated; + +import org.junit.Test; +import org.openecomp.sdc.asdctool.migration.core.task.MigrationResult.MigrationStatus; + + +public class MigrationResultTest { + + private MigrationResult createTestSubject() { + return new MigrationResult(); + } + + + @Test + public void testGetMsg() throws Exception { + MigrationResult testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getMsg(); + } + + + @Test + public void testSetMsg() throws Exception { + MigrationResult testSubject; + String msg = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setMsg(msg); + } + + + @Test + public void testGetMigrationStatus() throws Exception { + MigrationResult testSubject; + MigrationStatus result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getMigrationStatus(); + } + + + @Test + public void testSetMigrationStatus() throws Exception { + MigrationResult testSubject; + MigrationStatus migrationStatus = null; + + // default test + testSubject = createTestSubject(); + testSubject.setMigrationStatus(migrationStatus); + } +}
\ No newline at end of file diff --git a/asdctool/src/test/java/org/openecomp/sdc/asdctool/servlets/EntryPointTest.java b/asdctool/src/test/java/org/openecomp/sdc/asdctool/servlets/EntryPointTest.java new file mode 100644 index 0000000000..c3f7874c12 --- /dev/null +++ b/asdctool/src/test/java/org/openecomp/sdc/asdctool/servlets/EntryPointTest.java @@ -0,0 +1,24 @@ +package org.openecomp.sdc.asdctool.servlets; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class EntryPointTest { + + private EntryPoint createTestSubject() { + return new EntryPoint(); + } + + + @Test + public void testTest() throws Exception { + EntryPoint testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.test(); + } +}
\ No newline at end of file diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/TestQueue.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/TestQueue.java deleted file mode 100644 index d9cd6ef51f..0000000000 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/TestQueue.java +++ /dev/null @@ -1,184 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * SDC - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.sdc.be.components.distribution.engine; - -import java.util.ArrayList; -import java.util.List; -import java.util.Timer; -import java.util.TimerTask; -import java.util.concurrent.ArrayBlockingQueue; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.RejectedExecutionException; -import java.util.concurrent.SynchronousQueue; -import java.util.concurrent.ThreadFactory; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; - -import com.google.common.util.concurrent.ThreadFactoryBuilder; - -public class TestQueue { - - public static void main(String[] args) { - ThreadFactoryBuilder threadFactoryBuilder = new ThreadFactoryBuilder(); - threadFactoryBuilder.setNameFormat("distribution-notification-thread"); - ThreadFactory threadFactory = threadFactoryBuilder.build(); - // TODO: add the package of google to the pom - - ExecutorService executorService = new ThreadPoolExecutor(0, 10, 60L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), threadFactory); - // ExecutorService executorService = new ThreadPoolExecutor(0, 2, 60L, - // TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(20)); - - // 2 threads are always up and they handle the tasks. in case core size - // is 0, only one is handles the tasks. - // ExecutorService executorService = new ThreadPoolExecutor(0, 2, 60L, - // TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(20)); - - // TODO : check what happen when the number of threads are full. Throw - // RejectedExecutionException - // TODO : check what happen whether the pool is full and the size of - // pool - - ExecutorService newCachedThreadPool = Executors.newCachedThreadPool(threadFactory); - Runnable task = new Runnable() { - - @Override - public void run() { - try { - System.out.println("iN SLEEP" + Thread.currentThread()); - Thread.sleep(10 * 1000); - System.out.println("OUT SLEEP"); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - }; - - for (int i = 0; i < 4; i++) { - try { - executorService.submit(task); - } catch (RejectedExecutionException e) { - e.printStackTrace(); - } - } - - newCachedThreadPool.submit(task); - System.out.println("After submitting the task"); - - MyWorker[] watchThreads = new MyWorker[1]; - BlockingQueue<String> queue = new ArrayBlockingQueue<>(5); - for (int i = 0; i < watchThreads.length; i++) { - MyWorker myWorker = new MyWorker(queue); - myWorker.start(); - } - - for (int i = 0; i < 1; i++) { - try { - queue.put("message " + i); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - } - - public static class MyTimerTask extends TimerTask { - - AtomicBoolean state; - Thread thread; - - public MyTimerTask(AtomicBoolean state, Thread thread) { - super(); - this.state = state; - this.thread = thread; - - System.out.println("After create timer"); - } - - @Override - public void run() { - System.out.println("In running of Timer task"); - if (state.get() == false) { - System.out.println("In running of Timer task. Going to interrupt thread"); - // thread.interrupt(); - } else { - System.out.println("In running of Timer task. Finished."); - } - } - - } - - public static class MyWorker extends Thread { - - boolean active = true; - private final BlockingQueue<String> queue; - - public MyWorker(BlockingQueue<String> queue) { - this.queue = queue; - } - - Timer timer = new Timer(); - - public void run() { - try { - while (active) { - String s = queue.take(); - System.out.println("Thread " + Thread.currentThread() + " fecthed a message " + s); - - AtomicBoolean atomicBoolean = new AtomicBoolean(false); - MyTimerTask myTimerTask = new MyTimerTask(atomicBoolean, this); - timer.schedule(myTimerTask, 10 * 1000); - doWork(s); - atomicBoolean.set(true); - - } - } catch (InterruptedException ie) { - - System.out.println("Interrupted our thread"); - ie.printStackTrace(); - } - } - - private void doWork(String s) { - // TODO Auto-generated method stub - - CambriaHandler cambriaHandler = new CambriaHandler(); - INotificationData data = new NotificationDataImpl(); - List<String> servers = new ArrayList<>(); - servers.add("aaaaaaa"); - cambriaHandler.sendNotification("topicName", "uebPublicKey", "uebSecretKey", servers, data); - - System.out.println("IN WORK " + s); - try { - Thread.sleep(1 * 1000); - } catch (InterruptedException e) { - - for (int i = 0; i < 10; i++) { - System.out.println("*************************************************"); - } - e.printStackTrace(); - } - } - } - -} diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ProductServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ProductServlet.java index 681195643e..209f38d8a4 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ProductServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/ProductServlet.java @@ -39,7 +39,6 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.openecomp.sdc.be.components.impl.ProductBusinessLogic; -import org.openecomp.sdc.be.components.impl.ServiceBusinessLogic; import org.openecomp.sdc.be.config.BeEcompErrorManager; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.model.Product; @@ -51,14 +50,14 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.jcabi.aspects.Loggable; + +import fj.data.Either; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; -import fj.data.Either; - @Loggable(prepend = true, value = Loggable.DEBUG, trim = false) @Path("/v1/catalog") @Api(value = "Product Catalog", description = "Product Servlet") diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CapabiltyRequirementConvertor.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CapabiltyRequirementConvertor.java index 006c5c22d3..649f083903 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CapabiltyRequirementConvertor.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CapabiltyRequirementConvertor.java @@ -1,4 +1,5 @@ /*- + * ============LICENSE_START======================================================= * SDC * ================================================================================ diff --git a/catalog-be/src/main/resources/import/tosca/onap-types/VDU/VDU.json b/catalog-be/src/main/resources/import/tosca/onap-types/VDU/VDU.json new file mode 100644 index 0000000000..5d721d4abc --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/onap-types/VDU/VDU.json @@ -0,0 +1,15 @@ +{ + "payloadName": "VDU.yml", + "contactId": "jh0003", + "name": "VDU", + "description": "VDU", + "resourceIconPath": "compute", + "resourceType": "VFC", + "categories": [{ + "name": "Generic", + "subcategories": [{ + "name": "Infrastructure" + }] + }], + "tags": ["VDU"] +}
\ No newline at end of file diff --git a/catalog-be/src/main/resources/import/tosca/onap-types/VDU/VDU.yml b/catalog-be/src/main/resources/import/tosca/onap-types/VDU/VDU.yml new file mode 100644 index 0000000000..541126f7e3 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/onap-types/VDU/VDU.yml @@ -0,0 +1,22 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +node_types: + tosca.nodes.nfv.VDU: + derived_from: tosca.nodes.SoftwareComponent + capabilities: +#Not found in any spec +# high_availability: +# type: nfv.capabilities.HA + Virtualbinding: + type: tosca.capabilities.nfv.VirtualBindable +# monitoring_parameter: +# type: nfv.capabilities.Metric + requirements: +#Not found in any spec +# - high_availability: +# capability: nfv.capabilities.HA +# relationship: nfv.relationships.HA +# occurrences: [ 0, 1 ] + - host: + capability: tosca.capabilities.Container + node: tosca.nodes.Compute + relationship: tosca.relationships.HostedOn diff --git a/catalog-be/src/main/resources/import/tosca/onap-types/VDU/VDU.zip b/catalog-be/src/main/resources/import/tosca/onap-types/VDU/VDU.zip Binary files differnew file mode 100644 index 0000000000..9010bf0544 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/onap-types/VDU/VDU.zip diff --git a/catalog-be/src/main/resources/import/tosca/onap-types/vduCpd/vduCpd.yml b/catalog-be/src/main/resources/import/tosca/onap-types/vduCpd/vduCpd.yml index e5d79fcacf..673e923182 100644 --- a/catalog-be/src/main/resources/import/tosca/onap-types/vduCpd/vduCpd.yml +++ b/catalog-be/src/main/resources/import/tosca/onap-types/vduCpd/vduCpd.yml @@ -1,3 +1,4 @@ +#NOT SPEC COMPLAINT!!!!!!!!!!!!!!!!!!!!!! tosca_definitions_version: tosca_simple_yaml_1_0_0 node_types: tosca.nodes.nfv.VduCpd: diff --git a/catalog-be/src/main/resources/scripts/import/tosca/importOnapTypes.py b/catalog-be/src/main/resources/scripts/import/tosca/importOnapTypes.py index 31c11c74bc..664c5cc64a 100644 --- a/catalog-be/src/main/resources/scripts/import/tosca/importOnapTypes.py +++ b/catalog-be/src/main/resources/scripts/import/tosca/importOnapTypes.py @@ -30,7 +30,8 @@ def importOnapTypes(beHost, bePort, adminUser, fileDir, updateversion): "vduCpd", "vduVirtualStorage", "vnfVirtualLinkDesc", - "NSD" + "NSD", + "VDU" ] responseCodes = [200, 201] diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/clean/AsdcComponentsCleanerTaskTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/clean/AsdcComponentsCleanerTaskTest.java new file mode 100644 index 0000000000..be55cbd12a --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/clean/AsdcComponentsCleanerTaskTest.java @@ -0,0 +1,66 @@ +package org.openecomp.sdc.be.components.clean; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class AsdcComponentsCleanerTaskTest { + + private AsdcComponentsCleanerTask createTestSubject() { + return new AsdcComponentsCleanerTask(); + } + + + @Test + public void testInit() throws Exception { + AsdcComponentsCleanerTask testSubject; + + // default test + testSubject = createTestSubject(); + testSubject.init(); + } + + + @Test + public void testDestroy() throws Exception { + AsdcComponentsCleanerTask testSubject; + + // default test + testSubject = createTestSubject(); + testSubject.destroy(); + } + + + @Test + public void testStartTask() throws Exception { + AsdcComponentsCleanerTask testSubject; + + // default test + testSubject = createTestSubject(); + testSubject.startTask(); + } + + + @Test + public void testStopTask() throws Exception { + AsdcComponentsCleanerTask testSubject; + + // default test + testSubject = createTestSubject(); + testSubject.stopTask(); + } + + + + + + @Test + public void testRun() throws Exception { + AsdcComponentsCleanerTask testSubject; + + // default test + testSubject = createTestSubject(); + testSubject.run(); + } +}
\ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/TestSuite.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/TestSuite.java new file mode 100644 index 0000000000..712e16d97a --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/TestSuite.java @@ -0,0 +1,12 @@ +package org.openecomp.sdc.be.components.distribution.engine; + +import org.junit.runner.RunWith; +import org.junit.runners.Suite; + +@RunWith(Suite.class) +@Suite.SuiteClasses( + +{ DistributionEngineInitTaskTest.class, DistributionEngineConfigTest.class, DistributionEngineHealthCheckTest.class, + VfModuleArtifactPayloadTest.class }) +public class TestSuite { // nothing +} diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/VfModuleArtifactPayloadTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/VfModuleArtifactPayloadTest.java new file mode 100644 index 0000000000..1bc8c47f8c --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/distribution/engine/VfModuleArtifactPayloadTest.java @@ -0,0 +1,66 @@ +package org.openecomp.sdc.be.components.distribution.engine; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import javax.annotation.Generated; + +import org.junit.Test; +import org.openecomp.sdc.be.model.GroupDefinition; +import org.openecomp.sdc.be.model.GroupInstance; +import org.openecomp.sdc.be.model.GroupInstanceProperty; + + +public class VfModuleArtifactPayloadTest { + + private VfModuleArtifactPayload createTestSubject() { + return new VfModuleArtifactPayload(new GroupDefinition()); + } + + + + + @Test + public void testGetArtifacts() throws Exception { + VfModuleArtifactPayload testSubject; + List<String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getArtifacts(); + } + + + @Test + public void testSetArtifacts() throws Exception { + VfModuleArtifactPayload testSubject; + List<String> artifacts = null; + + // default test + testSubject = createTestSubject(); + testSubject.setArtifacts(artifacts); + } + + + @Test + public void testGetProperties() throws Exception { + VfModuleArtifactPayload testSubject; + Map<String, Object> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getProperties(); + } + + + @Test + public void testSetProperties() throws Exception { + VfModuleArtifactPayload testSubject; + List<GroupInstanceProperty> properties = new ArrayList<>(); + + // default test + testSubject = createTestSubject(); + testSubject.setProperties(properties); + } +}
\ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogicTest.java index c47400bcdb..796a426e26 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogicTest.java @@ -20,7 +20,10 @@ package org.openecomp.sdc.be.components.impl; -import static org.junit.Assert.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.when; import java.lang.reflect.Method; @@ -29,11 +32,14 @@ import java.util.EnumMap; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; +import java.util.regex.Pattern; import java.util.stream.Collectors; import javax.servlet.ServletContext; import org.apache.commons.lang3.tuple.ImmutablePair; +import org.junit.Assert; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; @@ -50,25 +56,42 @@ import org.openecomp.sdc.be.components.lifecycle.LifecycleChangeInfoWithAction; import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.dao.jsongraph.TitanDao; +import org.openecomp.sdc.be.datamodel.api.HighestFilterEnum; import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.impl.ComponentsUtils; import org.openecomp.sdc.be.impl.WebAppContextWrapper; import org.openecomp.sdc.be.model.ArtifactDefinition; +import org.openecomp.sdc.be.model.CapabilityDefinition; import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.ComponentMetadataDefinition; +import org.openecomp.sdc.be.model.CsarInfo; import org.openecomp.sdc.be.model.DataTypeDefinition; +import org.openecomp.sdc.be.model.GroupDefinition; +import org.openecomp.sdc.be.model.GroupProperty; +import org.openecomp.sdc.be.model.GroupTypeDefinition; import org.openecomp.sdc.be.model.InputDefinition; import org.openecomp.sdc.be.model.LifeCycleTransitionEnum; import org.openecomp.sdc.be.model.LifecycleStateEnum; +import org.openecomp.sdc.be.model.NodeTypeInfo; +import org.openecomp.sdc.be.model.ParsedToscaYamlInfo; import org.openecomp.sdc.be.model.PropertyDefinition; import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.UploadCapInfo; +import org.openecomp.sdc.be.model.UploadComponentInstanceInfo; +import org.openecomp.sdc.be.model.UploadReqInfo; +import org.openecomp.sdc.be.model.UploadResourceInfo; import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.be.model.cache.ApplicationDataTypeCache; +import org.openecomp.sdc.be.model.category.CategoryDefinition; +import org.openecomp.sdc.be.model.category.SubCategoryDefinition; import org.openecomp.sdc.be.model.jsontitan.operations.NodeTemplateOperation; import org.openecomp.sdc.be.model.jsontitan.operations.NodeTypeOperation; 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.ICacheMangerOperation; import org.openecomp.sdc.be.model.operations.api.ICapabilityTypeOperation; import org.openecomp.sdc.be.model.operations.api.IElementOperation; import org.openecomp.sdc.be.model.operations.api.IPropertyOperation; @@ -79,12 +102,15 @@ import org.openecomp.sdc.be.model.operations.impl.GraphLockOperation; import org.openecomp.sdc.be.model.tosca.ToscaPropertyType; import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum; import org.openecomp.sdc.be.tosca.CsarUtils.NonMetaArtifactInfo; +import org.openecomp.sdc.be.ui.model.UiComponentDataTransfer; +import org.openecomp.sdc.be.user.IUserBusinessLogic; import org.openecomp.sdc.be.user.Role; import org.openecomp.sdc.be.user.UserBusinessLogic; import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum; import org.openecomp.sdc.common.api.ArtifactTypeEnum; import org.openecomp.sdc.common.api.ConfigurationSource; import org.openecomp.sdc.common.api.Constants; +import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum; import org.openecomp.sdc.common.impl.ExternalConfiguration; import org.openecomp.sdc.common.impl.FSConfigurationSource; import org.openecomp.sdc.common.util.GeneralUtility; @@ -94,6 +120,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.context.WebApplicationContext; +import com.att.nsa.cambria.test.support.CambriaBatchingPublisherMock.Entry; + import fj.data.Either; public class ResourceBusinessLogicTest { @@ -107,10 +135,10 @@ public class ResourceBusinessLogicTest { public static final String UPDATED_SUBCATEGORY = "Gateway"; public static final String RESOURCE_NAME = "My-Resource_Name with space"; - private static final String GENERIC_VF_NAME = "org.openecomp.resource.abstract.nodes.VF"; - private static final String GENERIC_VFC_NAME = "org.openecomp.resource.abstract.nodes.VFC"; - private static final String GENERIC_PNF_NAME = "org.openecomp.resource.abstract.nodes.PNF"; - + private static final String GENERIC_VF_NAME = "org.openecomp.resource.abstract.nodes.VF"; + private static final String GENERIC_VFC_NAME = "org.openecomp.resource.abstract.nodes.VFC"; + private static final String GENERIC_PNF_NAME = "org.openecomp.resource.abstract.nodes.PNF"; + final ServletContext servletContext = Mockito.mock(ServletContext.class); IAuditingManager iAuditingManager = null; IElementOperation mockElementDao; @@ -157,7 +185,8 @@ public class ResourceBusinessLogicTest { // Init Configuration String appConfigDir = "src/test/resources/config/catalog-be"; - ConfigurationSource configurationSource = new FSConfigurationSource(ExternalConfiguration.getChangeListener(), appConfigDir); + ConfigurationSource configurationSource = new FSConfigurationSource(ExternalConfiguration.getChangeListener(), + appConfigDir); ConfigurationManager configurationManager = new ConfigurationManager(configurationSource); // Elements @@ -175,30 +204,38 @@ public class ResourceBusinessLogicTest { // Servlet Context attributes when(servletContext.getAttribute(Constants.CONFIGURATION_MANAGER_ATTR)).thenReturn(configurationManager); - when(servletContext.getAttribute(Constants.WEB_APPLICATION_CONTEXT_WRAPPER_ATTR)).thenReturn(webAppContextWrapper); + when(servletContext.getAttribute(Constants.WEB_APPLICATION_CONTEXT_WRAPPER_ATTR)) + .thenReturn(webAppContextWrapper); when(webAppContextWrapper.getWebAppContext(servletContext)).thenReturn(webAppContext); when(webAppContext.getBean(IElementOperation.class)).thenReturn(mockElementDao); Either<Integer, StorageOperationStatus> eitherCountRoot = Either.left(1); Either<Boolean, StorageOperationStatus> eitherFalse = Either.left(true); - when(toscaOperationFacade.validateComponentNameExists("Root", ResourceTypeEnum.VFC, ComponentTypeEnum.RESOURCE)).thenReturn(eitherFalse); + when(toscaOperationFacade.validateComponentNameExists("Root", ResourceTypeEnum.VFC, ComponentTypeEnum.RESOURCE)) + .thenReturn(eitherFalse); Either<Boolean, StorageOperationStatus> eitherCountExist = Either.left(true); - when(toscaOperationFacade.validateComponentNameExists("alreadyExists", ResourceTypeEnum.VFC, ComponentTypeEnum.RESOURCE)).thenReturn(eitherCountExist); - + when(toscaOperationFacade.validateComponentNameExists("alreadyExists", ResourceTypeEnum.VFC, + ComponentTypeEnum.RESOURCE)).thenReturn(eitherCountExist); + Either<Boolean, StorageOperationStatus> eitherCount = Either.left(false); - when(toscaOperationFacade.validateComponentNameExists(RESOURCE_NAME, ResourceTypeEnum.VFC, ComponentTypeEnum.RESOURCE)).thenReturn(eitherCount); - when(toscaOperationFacade.validateComponentNameExists(RESOURCE_NAME, ResourceTypeEnum.VF, ComponentTypeEnum.RESOURCE)).thenReturn(eitherCount); - when(toscaOperationFacade.validateComponentNameExists(RESOURCE_NAME, ResourceTypeEnum.PNF, ComponentTypeEnum.RESOURCE)).thenReturn(eitherCount); - + when(toscaOperationFacade.validateComponentNameExists(RESOURCE_NAME, ResourceTypeEnum.VFC, + ComponentTypeEnum.RESOURCE)).thenReturn(eitherCount); + when(toscaOperationFacade.validateComponentNameExists(RESOURCE_NAME, ResourceTypeEnum.VF, + ComponentTypeEnum.RESOURCE)).thenReturn(eitherCount); + when(toscaOperationFacade.validateComponentNameExists(RESOURCE_NAME, ResourceTypeEnum.PNF, + ComponentTypeEnum.RESOURCE)).thenReturn(eitherCount); + Either<Boolean, StorageOperationStatus> validateDerivedExists = Either.left(true); when(toscaOperationFacade.validateToscaResourceNameExists("Root")).thenReturn(validateDerivedExists); - + Either<Boolean, StorageOperationStatus> validateDerivedNotExists = Either.left(false); when(toscaOperationFacade.validateToscaResourceNameExists("kuku")).thenReturn(validateDerivedNotExists); - when(graphLockOperation.lockComponent(Mockito.anyString(), Mockito.eq(NodeTypeEnum.Resource))).thenReturn(StorageOperationStatus.OK); - when(graphLockOperation.lockComponentByName(Mockito.anyString(), Mockito.eq(NodeTypeEnum.Resource))).thenReturn(StorageOperationStatus.OK); - + when(graphLockOperation.lockComponent(Mockito.anyString(), Mockito.eq(NodeTypeEnum.Resource))) + .thenReturn(StorageOperationStatus.OK); + when(graphLockOperation.lockComponentByName(Mockito.anyString(), Mockito.eq(NodeTypeEnum.Resource))) + .thenReturn(StorageOperationStatus.OK); + // createResource resourceResponse = createResourceObject(true); Either<Resource, StorageOperationStatus> eitherCreate = Either.left(resourceResponse); @@ -287,7 +324,7 @@ public class ResourceBusinessLogicTest { if (afterCreate) { resource.setName(resource.getName()); resource.setVersion("0.1"); - + resource.setUniqueId(resource.getName().toLowerCase() + ":" + resource.getVersion()); resource.setCreatorUserId(user.getUserId()); resource.setCreatorFullName(user.getFirstName() + " " + user.getLastName()); @@ -305,7 +342,8 @@ public class ResourceBusinessLogicTest { @Test public void testHappyScenario() { Resource resource = createResourceObject(false); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resource, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resource, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); if (createResponse.isRight()) { assertEquals(new Integer(200), createResponse.right().value().getStatus()); @@ -317,15 +355,17 @@ public class ResourceBusinessLogicTest { public void testUpdateHappyScenario() { Resource resource = createResourceObjectCsar(true); setCanWorkOnResource(resource); - + Either<Resource, StorageOperationStatus> resourceLinkedToCsarRes = Either.left(resource); - when(toscaOperationFacade.getLatestComponentByCsarOrName(ComponentTypeEnum.RESOURCE, resource.getCsarUUID(), resource.getSystemName())).thenReturn(resourceLinkedToCsarRes); + when(toscaOperationFacade.getLatestComponentByCsarOrName(ComponentTypeEnum.RESOURCE, resource.getCsarUUID(), + resource.getSystemName())).thenReturn(resourceLinkedToCsarRes); Either<Boolean, StorageOperationStatus> validateDerivedExists = Either.left(true); when(toscaOperationFacade.validateToscaResourceNameExists("Root")).thenReturn(validateDerivedExists); - + Either<Resource, StorageOperationStatus> dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either<Resource, ResponseFormat> updateResponse = bl.validateAndUpdateResourceFromCsar(resource, user, null, null, resource.getUniqueId()); + Either<Resource, ResponseFormat> updateResponse = bl.validateAndUpdateResourceFromCsar(resource, user, null, + null, resource.getUniqueId()); if (updateResponse.isRight()) { assertEquals(new Integer(200), updateResponse.right().value().getStatus()); } @@ -353,7 +393,7 @@ public class ResourceBusinessLogicTest { testTagsExceedsLimitCreate(); testTagsNoServiceName(); testInvalidTag(); - + testContactIdTooLong(); testContactIdWrongFormatCreate(); testResourceContactIdEmpty(); @@ -381,15 +421,18 @@ public class ResourceBusinessLogicTest { resourceExist.setName(resourceName); resourceExist.getTags().add(resourceName); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); - assertResponse(createResponse, ActionStatus.COMPONENT_NAME_ALREADY_EXIST, ComponentTypeEnum.RESOURCE.getValue(), resourceName); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); + assertResponse(createResponse, ActionStatus.COMPONENT_NAME_ALREADY_EXIST, ComponentTypeEnum.RESOURCE.getValue(), + resourceName); } private void testResourceNameEmpty() { Resource resourceExist = createResourceObject(false); resourceExist.setName(null); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertResponse(createResponse, ActionStatus.MISSING_COMPONENT_NAME, ComponentTypeEnum.RESOURCE.getValue()); } @@ -399,9 +442,11 @@ public class ResourceBusinessLogicTest { String tooLongResourceName = "zCRCAWjqte0DtgcAAMmcJcXeNubeX1p1vOZNTShAHOYNAHvV3iK"; resourceExccedsNameLimit.setName(tooLongResourceName); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExccedsNameLimit, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExccedsNameLimit, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.COMPONENT_NAME_EXCEEDS_LIMIT, ComponentTypeEnum.RESOURCE.getValue(), "" + ValidationUtils.COMPONENT_NAME_MAX_LENGTH); + assertResponse(createResponse, ActionStatus.COMPONENT_NAME_EXCEEDS_LIMIT, ComponentTypeEnum.RESOURCE.getValue(), + "" + ValidationUtils.COMPONENT_NAME_MAX_LENGTH); } private void testResourceNameWrongFormat() { @@ -410,7 +455,8 @@ public class ResourceBusinessLogicTest { String nameWrongFormat = "ljg?fd"; resource.setName(nameWrongFormat); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resource, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resource, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.INVALID_COMPONENT_NAME, ComponentTypeEnum.RESOURCE.getValue()); } @@ -431,9 +477,11 @@ public class ResourceBusinessLogicTest { resourceExccedsDescLimit.setDescription(tooLongResourceDesc); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExccedsDescLimit, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExccedsDescLimit, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.COMPONENT_DESCRIPTION_EXCEEDS_LIMIT, ComponentTypeEnum.RESOURCE.getValue(), "" + ValidationUtils.COMPONENT_DESCRIPTION_MAX_LENGTH); + assertResponse(createResponse, ActionStatus.COMPONENT_DESCRIPTION_EXCEEDS_LIMIT, + ComponentTypeEnum.RESOURCE.getValue(), "" + ValidationUtils.COMPONENT_DESCRIPTION_MAX_LENGTH); } private void testResourceDescNotEnglish() { @@ -442,29 +490,35 @@ public class ResourceBusinessLogicTest { String notEnglishDesc = "\uC2B5"; notEnglish.setDescription(notEnglishDesc); - Either<Resource, ResponseFormat> createResponse = bl.createResource(notEnglish, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(notEnglish, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.COMPONENT_INVALID_DESCRIPTION, ComponentTypeEnum.RESOURCE.getValue()); + assertResponse(createResponse, ActionStatus.COMPONENT_INVALID_DESCRIPTION, + ComponentTypeEnum.RESOURCE.getValue()); } private void testResourceDescriptionEmpty() { Resource resourceExist = createResourceObject(false); resourceExist.setDescription(""); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.COMPONENT_MISSING_DESCRIPTION, ComponentTypeEnum.RESOURCE.getValue()); + assertResponse(createResponse, ActionStatus.COMPONENT_MISSING_DESCRIPTION, + ComponentTypeEnum.RESOURCE.getValue()); } private void testResourceDescriptionMissing() { Resource resourceExist = createResourceObject(false); resourceExist.setDescription(null); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.COMPONENT_MISSING_DESCRIPTION, ComponentTypeEnum.RESOURCE.getValue()); + assertResponse(createResponse, ActionStatus.COMPONENT_MISSING_DESCRIPTION, + ComponentTypeEnum.RESOURCE.getValue()); } // Resource description - end // Resource icon start @@ -473,7 +527,8 @@ public class ResourceBusinessLogicTest { Resource resourceExist = createResourceObject(false); resourceExist.setIcon(null); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_MISSING_ICON, ComponentTypeEnum.RESOURCE.getValue()); @@ -483,7 +538,8 @@ public class ResourceBusinessLogicTest { Resource resourceExist = createResourceObject(false); resourceExist.setIcon("kjk3453^&"); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_INVALID_ICON, ComponentTypeEnum.RESOURCE.getValue()); @@ -493,10 +549,12 @@ public class ResourceBusinessLogicTest { Resource resourceExist = createResourceObject(false); resourceExist.setIcon("dsjfhskdfhskjdhfskjdhkjdhfkshdfksjsdkfhsdfsdfsdfsfsdfsf"); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.COMPONENT_ICON_EXCEEDS_LIMIT, ComponentTypeEnum.RESOURCE.getValue(), "" + ValidationUtils.ICON_MAX_LENGTH); + assertResponse(createResponse, ActionStatus.COMPONENT_ICON_EXCEEDS_LIMIT, ComponentTypeEnum.RESOURCE.getValue(), + "" + ValidationUtils.ICON_MAX_LENGTH); } // Resource icon end @@ -505,7 +563,8 @@ public class ResourceBusinessLogicTest { Resource resourceExist = createResourceObject(false); resourceExist.setTags(null); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_MISSING_TAGS); @@ -515,7 +574,8 @@ public class ResourceBusinessLogicTest { Resource resourceExist = createResourceObject(false); resourceExist.setTags(new ArrayList<String>()); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_MISSING_TAGS); @@ -571,9 +631,11 @@ public class ResourceBusinessLogicTest { resourceExccedsNameLimit.setTags(tagsList); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExccedsNameLimit, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExccedsNameLimit, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.COMPONENT_TAGS_EXCEED_LIMIT, "" + ValidationUtils.TAG_LIST_MAX_LENGTH); + assertResponse(createResponse, ActionStatus.COMPONENT_TAGS_EXCEED_LIMIT, + "" + ValidationUtils.TAG_LIST_MAX_LENGTH); } @@ -587,9 +649,11 @@ public class ResourceBusinessLogicTest { resourceExccedsNameLimit.setTags(tagsList); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExccedsNameLimit, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExccedsNameLimit, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.COMPONENT_SINGLE_TAG_EXCEED_LIMIT, "" + ValidationUtils.TAG_MAX_LENGTH); + assertResponse(createResponse, ActionStatus.COMPONENT_SINGLE_TAG_EXCEED_LIMIT, + "" + ValidationUtils.TAG_MAX_LENGTH); } @@ -600,7 +664,8 @@ public class ResourceBusinessLogicTest { tagsList.add(tag1); serviceExccedsNameLimit.setTags(tagsList); - Either<Resource, ResponseFormat> createResponse = bl.createResource(serviceExccedsNameLimit, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(serviceExccedsNameLimit, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_INVALID_TAGS_NO_COMP_NAME); @@ -613,7 +678,8 @@ public class ResourceBusinessLogicTest { tagsList.add(tag1); serviceExccedsNameLimit.setTags(tagsList); - Either<Resource, ResponseFormat> createResponse = bl.createResource(serviceExccedsNameLimit, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(serviceExccedsNameLimit, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.INVALID_FIELD_FORMAT, new String[] { "Resource", "tag" }); @@ -621,14 +687,15 @@ public class ResourceBusinessLogicTest { // Resource tags - stop // Resource contact start - + private void testContactIdTooLong() { Resource resourceContactId = createResourceObject(false); // 59 chars instead of 50 String contactIdTooLong = "thisNameIsVeryLongAndExeccedsTheNormalLengthForContactId"; resourceContactId.setContactId(contactIdTooLong); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceContactId, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceContactId, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_INVALID_CONTACT, ComponentTypeEnum.RESOURCE.getValue()); } @@ -639,7 +706,8 @@ public class ResourceBusinessLogicTest { String contactIdFormatWrong = "yrt134!!!"; resourceContactId.setContactId(contactIdFormatWrong); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceContactId, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceContactId, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_INVALID_CONTACT, ComponentTypeEnum.RESOURCE.getValue()); } @@ -648,7 +716,8 @@ public class ResourceBusinessLogicTest { Resource resourceExist = createResourceObject(false); resourceExist.setContactId(""); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_MISSING_CONTACT, ComponentTypeEnum.RESOURCE.getValue()); @@ -658,7 +727,8 @@ public class ResourceBusinessLogicTest { Resource resourceExist = createResourceObject(false); resourceExist.setContactId(null); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_MISSING_CONTACT, ComponentTypeEnum.RESOURCE.getValue()); @@ -669,19 +739,23 @@ public class ResourceBusinessLogicTest { String tooLongVendorName = "h1KSyJh9Eh1KSyJh9Eh1KSyJh9Eh1KSyJh9Eh1KSyJh9Eh1KSyJh9Eh1KSyJh9Eh1KSyJh9E"; resourceExccedsVendorNameLimit.setVendorName(tooLongVendorName); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExccedsVendorNameLimit, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExccedsVendorNameLimit, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.VENDOR_NAME_EXCEEDS_LIMIT, "" + ValidationUtils.VENDOR_NAME_MAX_LENGTH); + assertResponse(createResponse, ActionStatus.VENDOR_NAME_EXCEEDS_LIMIT, + "" + ValidationUtils.VENDOR_NAME_MAX_LENGTH); } - + private void testResourceVendorModelNumberExceedsLimit() { Resource resourceExccedsVendorModelNumberLimit = createResourceObject(false); String tooLongVendorModelNumber = "h1KSyJh9Eh1KSyJh9Eh1KSyJh9Eh1KSyJh9Eh1KSyJh9Eh1KSyJh9Eh1KSyJh9Eh1KSyJh9E"; resourceExccedsVendorModelNumberLimit.setResourceVendorModelNumber(tooLongVendorModelNumber); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExccedsVendorModelNumberLimit, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExccedsVendorModelNumberLimit, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.RESOURCE_VENDOR_MODEL_NUMBER_EXCEEDS_LIMIT, "" + ValidationUtils.RESOURCE_VENDOR_MODEL_NUMBER_MAX_LENGTH); + assertResponse(createResponse, ActionStatus.RESOURCE_VENDOR_MODEL_NUMBER_EXCEEDS_LIMIT, + "" + ValidationUtils.RESOURCE_VENDOR_MODEL_NUMBER_MAX_LENGTH); } private void testVendorNameWrongFormatCreate() { @@ -690,7 +764,8 @@ public class ResourceBusinessLogicTest { String nameWrongFormat = "ljg*fd"; resource.setVendorName(nameWrongFormat); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resource, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resource, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.INVALID_VENDOR_NAME); } @@ -701,7 +776,8 @@ public class ResourceBusinessLogicTest { String nameWrongFormat = "1>2"; resource.setVendorRelease(nameWrongFormat); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resource, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resource, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.INVALID_VENDOR_RELEASE); @@ -712,16 +788,19 @@ public class ResourceBusinessLogicTest { String tooLongVendorRelease = "h1KSyJh9Eh1KSyJh9Eh1KSyJh9Eh1KSyJh9E"; resourceExccedsNameLimit.setVendorRelease(tooLongVendorRelease); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExccedsNameLimit, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExccedsNameLimit, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.VENDOR_RELEASE_EXCEEDS_LIMIT, "" + ValidationUtils.VENDOR_RELEASE_MAX_LENGTH); + assertResponse(createResponse, ActionStatus.VENDOR_RELEASE_EXCEEDS_LIMIT, + "" + ValidationUtils.VENDOR_RELEASE_MAX_LENGTH); } private void testResourceVendorNameMissing() { Resource resourceExist = createResourceObject(false); resourceExist.setVendorName(null); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.MISSING_VENDOR_NAME); @@ -731,7 +810,8 @@ public class ResourceBusinessLogicTest { Resource resourceExist = createResourceObject(false); resourceExist.setVendorRelease(null); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.MISSING_VENDOR_RELEASE); @@ -743,7 +823,8 @@ public class ResourceBusinessLogicTest { Resource resourceExist = createResourceObject(false); resourceExist.setCategories(null); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_MISSING_CATEGORY, ComponentTypeEnum.RESOURCE.getValue()); @@ -755,7 +836,8 @@ public class ResourceBusinessLogicTest { resourceExist.setCategories(null); resourceExist.addCategory("koko", "koko"); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_INVALID_CATEGORY, ComponentTypeEnum.RESOURCE.getValue()); @@ -774,7 +856,8 @@ public class ResourceBusinessLogicTest { String licenseType = "User"; createResourceObject.setCost(cost); createResourceObject.setLicenseType(licenseType); - Either<Resource, ResponseFormat> createResponse = bl.createResource(createResourceObject, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(createResourceObject, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); if (createResponse.isRight()) { assertEquals(new Integer(200), createResponse.right().value().getStatus()); @@ -790,7 +873,8 @@ public class ResourceBusinessLogicTest { String cost = "12356,464"; resourceCost.setCost(cost); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceCost, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceCost, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.INVALID_CONTENT); } @@ -803,7 +887,8 @@ public class ResourceBusinessLogicTest { String licenseType = "cpu"; resourceLicenseType.setLicenseType(licenseType); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceLicenseType, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceLicenseType, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.INVALID_CONTENT); } @@ -815,7 +900,8 @@ public class ResourceBusinessLogicTest { List<String> list = null; resourceExist.setDerivedFrom(list); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.MISSING_DERIVED_FROM_TEMPLATE); @@ -825,7 +911,8 @@ public class ResourceBusinessLogicTest { Resource resourceExist = createResourceObject(false); resourceExist.setDerivedFrom(new ArrayList<String>()); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.MISSING_DERIVED_FROM_TEMPLATE); @@ -837,18 +924,21 @@ public class ResourceBusinessLogicTest { derivedFrom.add("kuku"); resourceExist.setDerivedFrom(derivedFrom); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.PARENT_RESOURCE_NOT_FOUND); } // Derived from stop - private void assertResponse(Either<Resource, ResponseFormat> createResponse, ActionStatus expectedStatus, String... variables) { + private void assertResponse(Either<Resource, ResponseFormat> createResponse, ActionStatus expectedStatus, + String... variables) { ResponseFormat expectedResponse = responseManager.getResponseFormat(expectedStatus, variables); ResponseFormat actualResponse = createResponse.right().value(); assertEquals(expectedResponse.getStatus(), actualResponse.getStatus()); - assertEquals("assert error description", expectedResponse.getFormattedMessage(), actualResponse.getFormattedMessage()); + assertEquals("assert error description", expectedResponse.getFormattedMessage(), + actualResponse.getFormattedMessage()); } // UPDATE tests - start @@ -867,8 +957,9 @@ public class ResourceBusinessLogicTest { Either<Resource, StorageOperationStatus> dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - - Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resource.getUniqueId(), updatedResource, null, user, false); + + Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resource.getUniqueId(), + updatedResource, null, user, false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.INVALID_COMPONENT_NAME, ComponentTypeEnum.RESOURCE.getValue()); @@ -887,11 +978,12 @@ public class ResourceBusinessLogicTest { String name = "ljg"; updatedResource.setName(name); resource.setVersion("1.0"); - + Either<Resource, StorageOperationStatus> dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resource.getUniqueId(), updatedResource, null, user, false); + Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resource.getUniqueId(), + updatedResource, null, user, false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.RESOURCE_NAME_CANNOT_BE_CHANGED); @@ -912,9 +1004,11 @@ public class ResourceBusinessLogicTest { Either<Resource, StorageOperationStatus> dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resource.getUniqueId(), updatedResource, null, user, false); + Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resource.getUniqueId(), + updatedResource, null, user, false); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.COMPONENT_NAME_EXCEEDS_LIMIT, ComponentTypeEnum.RESOURCE.getValue(), "" + ValidationUtils.COMPONENT_NAME_MAX_LENGTH); + assertResponse(createResponse, ActionStatus.COMPONENT_NAME_EXCEEDS_LIMIT, ComponentTypeEnum.RESOURCE.getValue(), + "" + ValidationUtils.COMPONENT_NAME_MAX_LENGTH); } @Test @@ -930,9 +1024,11 @@ public class ResourceBusinessLogicTest { updatedResource.setName(resourceName); Either<Resource, StorageOperationStatus> dataModelResponse = Either.left(updatedResource); when(toscaOperationFacade.updateToscaElement(updatedResource)).thenReturn(dataModelResponse); - Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resource.getUniqueId(), updatedResource, null, user, false); + Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resource.getUniqueId(), + updatedResource, null, user, false); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.COMPONENT_NAME_ALREADY_EXIST, ComponentTypeEnum.RESOURCE.getValue(), resourceName); + assertResponse(createResponse, ActionStatus.COMPONENT_NAME_ALREADY_EXIST, ComponentTypeEnum.RESOURCE.getValue(), + resourceName); } // @@ -958,9 +1054,11 @@ public class ResourceBusinessLogicTest { updatedResource.setDescription(tooLongResourceDesc); Either<Resource, StorageOperationStatus> dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resource.getUniqueId(), updatedResource, null, user, false); + Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resource.getUniqueId(), + updatedResource, null, user, false); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.COMPONENT_DESCRIPTION_EXCEEDS_LIMIT, ComponentTypeEnum.RESOURCE.getValue(), "" + ValidationUtils.COMPONENT_DESCRIPTION_MAX_LENGTH); + assertResponse(createResponse, ActionStatus.COMPONENT_DESCRIPTION_EXCEEDS_LIMIT, + ComponentTypeEnum.RESOURCE.getValue(), "" + ValidationUtils.COMPONENT_DESCRIPTION_MAX_LENGTH); } @@ -979,7 +1077,8 @@ public class ResourceBusinessLogicTest { Either<Resource, StorageOperationStatus> dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resource.getUniqueId(), updatedResource, null, user, false); + Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resource.getUniqueId(), + updatedResource, null, user, false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_INVALID_ICON, ComponentTypeEnum.RESOURCE.getValue()); @@ -1002,7 +1101,8 @@ public class ResourceBusinessLogicTest { ; Either<Resource, StorageOperationStatus> dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resource.getUniqueId(), updatedResource, null, user, false); + Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resource.getUniqueId(), + updatedResource, null, user, false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.RESOURCE_ICON_CANNOT_BE_CHANGED); @@ -1066,10 +1166,12 @@ public class ResourceBusinessLogicTest { updatedResource.setTags(tagsList); Either<Resource, StorageOperationStatus> dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resource.getUniqueId(), updatedResource, null, user, false); + Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resource.getUniqueId(), + updatedResource, null, user, false); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.COMPONENT_TAGS_EXCEED_LIMIT, "" + ValidationUtils.TAG_LIST_MAX_LENGTH); + assertResponse(createResponse, ActionStatus.COMPONENT_TAGS_EXCEED_LIMIT, + "" + ValidationUtils.TAG_LIST_MAX_LENGTH); } @Test @@ -1086,7 +1188,8 @@ public class ResourceBusinessLogicTest { updatedResource.setVendorName(nameWrongFormat); Either<Resource, StorageOperationStatus> dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resource.getUniqueId(), updatedResource, null, user, false); + Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resource.getUniqueId(), + updatedResource, null, user, false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.INVALID_VENDOR_NAME); @@ -1108,7 +1211,8 @@ public class ResourceBusinessLogicTest { ; Either<Resource, StorageOperationStatus> dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resource.getUniqueId(), updatedResource, null, user, false); + Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resource.getUniqueId(), + updatedResource, null, user, false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.RESOURCE_VENDOR_NAME_CANNOT_BE_CHANGED); @@ -1127,9 +1231,11 @@ public class ResourceBusinessLogicTest { updatedResource.setVendorRelease(tooLongVendorRelease); Either<Resource, StorageOperationStatus> dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resource.getUniqueId(), updatedResource, null, user, false); + Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resource.getUniqueId(), + updatedResource, null, user, false); assertTrue(createResponse.isRight()); - assertResponse(createResponse, ActionStatus.VENDOR_RELEASE_EXCEEDS_LIMIT, "" + ValidationUtils.VENDOR_RELEASE_MAX_LENGTH); + assertResponse(createResponse, ActionStatus.VENDOR_RELEASE_EXCEEDS_LIMIT, + "" + ValidationUtils.VENDOR_RELEASE_MAX_LENGTH); } @Ignore @@ -1147,7 +1253,8 @@ public class ResourceBusinessLogicTest { updatedResource.setContactId(contactIdTooLong); Either<Resource, StorageOperationStatus> dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, user, false); + Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, + user, false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_INVALID_CONTACT, ComponentTypeEnum.RESOURCE.getValue()); @@ -1168,7 +1275,8 @@ public class ResourceBusinessLogicTest { updatedResource.addCategory(badCategory, "fikt"); Either<Resource, StorageOperationStatus> dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, user, false); + Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, + user, false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.COMPONENT_INVALID_CATEGORY, ComponentTypeEnum.RESOURCE.getValue()); @@ -1190,7 +1298,8 @@ public class ResourceBusinessLogicTest { ; Either<Resource, StorageOperationStatus> dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, user, false); + Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, + user, false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.RESOURCE_CATEGORY_CANNOT_BE_CHANGED); @@ -1211,7 +1320,8 @@ public class ResourceBusinessLogicTest { updatedResource.setDerivedFrom(list); Either<Resource, StorageOperationStatus> dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, user, false); + Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, + user, false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.MISSING_DERIVED_FROM_TEMPLATE); @@ -1230,7 +1340,8 @@ public class ResourceBusinessLogicTest { updatedResource.setDerivedFrom(new ArrayList<String>()); Either<Resource, StorageOperationStatus> dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, user, false); + Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, + user, false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.MISSING_DERIVED_FROM_TEMPLATE); @@ -1251,7 +1362,8 @@ public class ResourceBusinessLogicTest { updatedResource.setDerivedFrom(derivedFrom); Either<Resource, StorageOperationStatus> dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, user, false); + Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, + user, false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.PARENT_RESOURCE_NOT_FOUND); @@ -1266,13 +1378,16 @@ public class ResourceBusinessLogicTest { // this is in order to prevent failing with 403 earlier Either<Component, StorageOperationStatus> eitherUpdate = Either.left(setCanWorkOnResource(resource)); when(toscaOperationFacade.getToscaElement(resource.getUniqueId())).thenReturn(eitherUpdate); - + Either<Boolean, StorageOperationStatus> isToscaNameExtending = Either.left(true); - when(toscaOperationFacade.validateToscaResourceNameExtends(Mockito.anyString(), Mockito.anyString())).thenReturn(isToscaNameExtending); - - Either<Map<String, PropertyDefinition>, StorageOperationStatus> findPropertiesOfNode = Either.left(new HashMap<>()); - when(propertyOperation.deleteAllPropertiesAssociatedToNode(Mockito.any(NodeTypeEnum.class), Mockito.anyString())).thenReturn(findPropertiesOfNode); - + when(toscaOperationFacade.validateToscaResourceNameExtends(Mockito.anyString(), Mockito.anyString())) + .thenReturn(isToscaNameExtending); + + Either<Map<String, PropertyDefinition>, StorageOperationStatus> findPropertiesOfNode = Either + .left(new HashMap<>()); + when(propertyOperation.deleteAllPropertiesAssociatedToNode(Mockito.any(NodeTypeEnum.class), + Mockito.anyString())).thenReturn(findPropertiesOfNode); + resource.setVersion("1.0"); ArrayList<String> derivedFrom = new ArrayList<String>(); @@ -1280,10 +1395,11 @@ public class ResourceBusinessLogicTest { updatedResource.setDerivedFrom(derivedFrom); Either<Resource, StorageOperationStatus> dataModelResponse = Either.left(updatedResource); when(toscaOperationFacade.updateToscaElement(updatedResource)).thenReturn(dataModelResponse); - Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, user, false); + Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, + user, false); assertTrue(createResponse.isLeft()); } - + @Test public void testResourceTemplateCertify_UPDATE_SAD() { Resource resource = createResourceObject(true); @@ -1293,7 +1409,7 @@ public class ResourceBusinessLogicTest { // this is in order to prevent failing with 403 earlier Either<Component, StorageOperationStatus> eitherUpdate = Either.left(setCanWorkOnResource(resource)); when(toscaOperationFacade.getToscaElement(resource.getUniqueId())).thenReturn(eitherUpdate); - + Either<Boolean, StorageOperationStatus> isToscaNameExtending = Either.left(false); when(toscaOperationFacade.validateToscaResourceNameExtends(Mockito.anyString(), Mockito.anyString())) .thenReturn(isToscaNameExtending); @@ -1305,8 +1421,8 @@ public class ResourceBusinessLogicTest { updatedResource.setDerivedFrom(derivedFrom); Either<Resource, StorageOperationStatus> dataModelResponse = Either.left(resource); when(toscaOperationFacade.updateToscaElement(resource)).thenReturn(dataModelResponse); - Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, user, - false); + Either<Resource, ResponseFormat> createResponse = bl.updateResourceMetadata(resourceId, updatedResource, null, + user, false); assertTrue(createResponse.isRight()); assertResponse(createResponse, ActionStatus.PARENT_RESOURCE_DOES_NOT_EXTEND); @@ -1317,22 +1433,28 @@ public class ResourceBusinessLogicTest { public void createOrUpdateResourceAlreadyCheckout() { Resource resourceExist = createResourceObject(false); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); createResponse.left().value().setLastUpdaterUserId(user.getUserId()); assertTrue(createResponse.isLeft()); Either<Component, StorageOperationStatus> getLatestResult = Either.left(createResponse.left().value()); when(toscaOperationFacade.getLatestByName(resourceExist.getName())).thenReturn(getLatestResult); - when(toscaOperationFacade.overrideComponent(Mockito.any(Component.class), Mockito.any(Component.class))).thenReturn(getLatestResult); + when(toscaOperationFacade.overrideComponent(Mockito.any(Component.class), Mockito.any(Component.class))) + .thenReturn(getLatestResult); Resource resourceToUpdtae = createResourceObject(false); - Either<ImmutablePair<Resource, ActionStatus>, ResponseFormat> createOrUpdateResource = bl.createOrUpdateResourceByImport(resourceToUpdtae, user, false, false, false, null); + Either<ImmutablePair<Resource, ActionStatus>, ResponseFormat> createOrUpdateResource = bl + .createOrUpdateResourceByImport(resourceToUpdtae, user, false, false, false, null); assertTrue(createOrUpdateResource.isLeft()); - Mockito.verify(toscaOperationFacade, Mockito.times(1)).overrideComponent(Mockito.any(Resource.class), Mockito.any(Resource.class)); - Mockito.verify(lifecycleBl, Mockito.times(0)).changeState(Mockito.anyString(), Mockito.eq(user), Mockito.eq(LifeCycleTransitionEnum.CHECKOUT), Mockito.any(LifecycleChangeInfoWithAction.class), Mockito.anyBoolean(), Mockito.anyBoolean()); + Mockito.verify(toscaOperationFacade, Mockito.times(1)).overrideComponent(Mockito.any(Resource.class), + Mockito.any(Resource.class)); + Mockito.verify(lifecycleBl, Mockito.times(0)).changeState(Mockito.anyString(), Mockito.eq(user), + Mockito.eq(LifeCycleTransitionEnum.CHECKOUT), Mockito.any(LifecycleChangeInfoWithAction.class), + Mockito.anyBoolean(), Mockito.anyBoolean()); } @@ -1340,27 +1462,34 @@ public class ResourceBusinessLogicTest { public void createOrUpdateResourceCertified() { Resource resourceExist = createResourceObject(false); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resourceExist, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isLeft()); Resource certifiedResource = createResponse.left().value(); certifiedResource.setLifecycleState(LifecycleStateEnum.CERTIFIED); certifiedResource.setVersion("1.0"); - Either<Component, StorageOperationStatus> getLatestResult = Either.left(certifiedResource); when(toscaOperationFacade.getLatestByName(resourceExist.getName())).thenReturn(getLatestResult); - when(toscaOperationFacade.overrideComponent(Mockito.any(Component.class), Mockito.any(Component.class))).thenReturn(getLatestResult); + when(toscaOperationFacade.overrideComponent(Mockito.any(Component.class), Mockito.any(Component.class))) + .thenReturn(getLatestResult); - when(lifecycleBl.changeState(Mockito.anyString(), Mockito.eq(user), Mockito.eq(LifeCycleTransitionEnum.CHECKOUT), Mockito.any(LifecycleChangeInfoWithAction.class), Mockito.anyBoolean(), Mockito.anyBoolean())).thenReturn(createResponse); + when(lifecycleBl.changeState(Mockito.anyString(), Mockito.eq(user), + Mockito.eq(LifeCycleTransitionEnum.CHECKOUT), Mockito.any(LifecycleChangeInfoWithAction.class), + Mockito.anyBoolean(), Mockito.anyBoolean())).thenReturn(createResponse); Resource resourceToUpdtae = createResourceObject(false); - Either<ImmutablePair<Resource, ActionStatus>, ResponseFormat> createOrUpdateResource = bl.createOrUpdateResourceByImport(resourceToUpdtae, user, false, false, false, null); + Either<ImmutablePair<Resource, ActionStatus>, ResponseFormat> createOrUpdateResource = bl + .createOrUpdateResourceByImport(resourceToUpdtae, user, false, false, false, null); assertTrue(createOrUpdateResource.isLeft()); - Mockito.verify(toscaOperationFacade, Mockito.times(1)).overrideComponent(Mockito.any(Component.class), Mockito.any(Component.class)); - Mockito.verify(lifecycleBl, Mockito.times(1)).changeState(Mockito.anyString(), Mockito.eq(user), Mockito.eq(LifeCycleTransitionEnum.CHECKOUT), Mockito.any(LifecycleChangeInfoWithAction.class), Mockito.anyBoolean(), Mockito.anyBoolean()); + Mockito.verify(toscaOperationFacade, Mockito.times(1)).overrideComponent(Mockito.any(Component.class), + Mockito.any(Component.class)); + Mockito.verify(lifecycleBl, Mockito.times(1)).changeState(Mockito.anyString(), Mockito.eq(user), + Mockito.eq(LifeCycleTransitionEnum.CHECKOUT), Mockito.any(LifecycleChangeInfoWithAction.class), + Mockito.anyBoolean(), Mockito.anyBoolean()); } @@ -1371,14 +1500,20 @@ public class ResourceBusinessLogicTest { Either<Component, StorageOperationStatus> getLatestResult = Either.right(StorageOperationStatus.NOT_FOUND); when(toscaOperationFacade.getLatestByName(resourceToUpdtae.getName())).thenReturn(getLatestResult); - Either<Component, StorageOperationStatus> getLatestToscaNameResult = Either.right(StorageOperationStatus.NOT_FOUND); - when(toscaOperationFacade.getLatestByToscaResourceName(resourceToUpdtae.getToscaResourceName())).thenReturn(getLatestToscaNameResult); + Either<Component, StorageOperationStatus> getLatestToscaNameResult = Either + .right(StorageOperationStatus.NOT_FOUND); + when(toscaOperationFacade.getLatestByToscaResourceName(resourceToUpdtae.getToscaResourceName())) + .thenReturn(getLatestToscaNameResult); - Either<ImmutablePair<Resource, ActionStatus>, ResponseFormat> createOrUpdateResource = bl.createOrUpdateResourceByImport(resourceToUpdtae, user, false, false, false, null); + Either<ImmutablePair<Resource, ActionStatus>, ResponseFormat> createOrUpdateResource = bl + .createOrUpdateResourceByImport(resourceToUpdtae, user, false, false, false, null); assertTrue(createOrUpdateResource.isLeft()); - Mockito.verify(toscaOperationFacade, Mockito.times(0)).overrideComponent(Mockito.any(Component.class), Mockito.any(Component.class)); - Mockito.verify(lifecycleBl, Mockito.times(0)).changeState(Mockito.anyString(), Mockito.eq(user), Mockito.eq(LifeCycleTransitionEnum.CHECKOUT), Mockito.any(LifecycleChangeInfoWithAction.class), Mockito.anyBoolean(), Mockito.anyBoolean()); + Mockito.verify(toscaOperationFacade, Mockito.times(0)).overrideComponent(Mockito.any(Component.class), + Mockito.any(Component.class)); + Mockito.verify(lifecycleBl, Mockito.times(0)).changeState(Mockito.anyString(), Mockito.eq(user), + Mockito.eq(LifeCycleTransitionEnum.CHECKOUT), Mockito.any(LifecycleChangeInfoWithAction.class), + Mockito.anyBoolean(), Mockito.anyBoolean()); } @@ -1422,358 +1557,381 @@ public class ResourceBusinessLogicTest { assertTrue(validatePropertiesDefaultValues.isRight()); } -// @Test -// public void testDeleteMarkedResourcesNoResources() { -// List<GraphVertex> ids = new ArrayList<>(); -// Either<List<GraphVertex>, StorageOperationStatus> eitherNoResources = Either.left(ids); -// when(topologyTemplateOperation.getAllComponentsMarkedForDeletion(ComponentTypeEnum.RESOURCE)).thenReturn(eitherNoResources); -// -// Either<List<String>, ResponseFormat> deleteMarkedResources = bl.deleteMarkedComponents(); -// assertTrue(deleteMarkedResources.isLeft()); -// assertTrue(deleteMarkedResources.left().value().isEmpty()); -// -// Mockito.verify(artifactManager, Mockito.times(0)).deleteAllComponentArtifactsIfNotOnGraph(Mockito.anyList()); -// -// } -// -// @Test -// public void testDeleteMarkedResources() { -// List<String> ids = new ArrayList<String>(); -// String resourceInUse = "123"; -// ids.add(resourceInUse); -// String resourceFree = "456"; -// ids.add(resourceFree); -// Either<List<String>, StorageOperationStatus> eitherNoResources = Either.left(ids); -// when(toscaOperationFacade.getAllComponentsMarkedForDeletion()).thenReturn(eitherNoResources); -// -// Either<Boolean, StorageOperationStatus> resourceInUseResponse = Either.left(true); -// Either<Boolean, StorageOperationStatus> resourceFreeResponse = Either.left(false); -// -// List<ArtifactDefinition> artifacts = new ArrayList<ArtifactDefinition>(); -// Either<List<ArtifactDefinition>, StorageOperationStatus> getArtifactsResponse = Either.left(artifacts); -// when(toscaOperationFacade.getComponentArtifactsForDelete(resourceFree, NodeTypeEnum.Resource, true)).thenReturn(getArtifactsResponse); -// -// when(toscaOperationFacade.isComponentInUse(resourceFree)).thenReturn(resourceFreeResponse); -// when(toscaOperationFacade.isComponentInUse(resourceInUse)).thenReturn(resourceInUseResponse); -// -// Either<Component, StorageOperationStatus> eitherDelete = Either.left(new Resource()); -// when(toscaOperationFacade.deleteToscaComponent(resourceFree)).thenReturn(eitherDelete); -// -// when(artifactManager.deleteAllComponentArtifactsIfNotOnGraph(artifacts)).thenReturn(StorageOperationStatus.OK); -// List<String> deletedComponents = new ArrayList<>(); -// deletedComponents.add(resourceFree); -// when(toscaOperationFacade.deleteMarkedElements(ComponentTypeEnum.RESOURCE)).thenReturn(Either.left(deletedComponents)); -// -// Either<List<String>, ResponseFormat> deleteMarkedResources = bl.deleteMarkedComponents(); -// assertTrue(deleteMarkedResources.isLeft()); -// List<String> resourceIdList = deleteMarkedResources.left().value(); -// assertFalse(resourceIdList.isEmpty()); -// assertTrue(resourceIdList.contains(resourceFree)); -// assertFalse(resourceIdList.contains(resourceInUse)); -// -// Mockito.verify(artifactManager, Mockito.times(1)).deleteAllComponentArtifactsIfNotOnGraph(artifacts); -// } + // @Test + // public void testDeleteMarkedResourcesNoResources() { + // List<GraphVertex> ids = new ArrayList<>(); + // Either<List<GraphVertex>, StorageOperationStatus> eitherNoResources = + // Either.left(ids); + // when(topologyTemplateOperation.getAllComponentsMarkedForDeletion(ComponentTypeEnum.RESOURCE)).thenReturn(eitherNoResources); + // + // Either<List<String>, ResponseFormat> deleteMarkedResources = + // bl.deleteMarkedComponents(); + // assertTrue(deleteMarkedResources.isLeft()); + // assertTrue(deleteMarkedResources.left().value().isEmpty()); + // + // Mockito.verify(artifactManager, + // Mockito.times(0)).deleteAllComponentArtifactsIfNotOnGraph(Mockito.anyList()); + // + // } + // + // @Test + // public void testDeleteMarkedResources() { + // List<String> ids = new ArrayList<String>(); + // String resourceInUse = "123"; + // ids.add(resourceInUse); + // String resourceFree = "456"; + // ids.add(resourceFree); + // Either<List<String>, StorageOperationStatus> eitherNoResources = + // Either.left(ids); + // when(toscaOperationFacade.getAllComponentsMarkedForDeletion()).thenReturn(eitherNoResources); + // + // Either<Boolean, StorageOperationStatus> resourceInUseResponse = + // Either.left(true); + // Either<Boolean, StorageOperationStatus> resourceFreeResponse = + // Either.left(false); + // + // List<ArtifactDefinition> artifacts = new ArrayList<ArtifactDefinition>(); + // Either<List<ArtifactDefinition>, StorageOperationStatus> + // getArtifactsResponse = Either.left(artifacts); + // when(toscaOperationFacade.getComponentArtifactsForDelete(resourceFree, + // NodeTypeEnum.Resource, true)).thenReturn(getArtifactsResponse); + // + // when(toscaOperationFacade.isComponentInUse(resourceFree)).thenReturn(resourceFreeResponse); + // when(toscaOperationFacade.isComponentInUse(resourceInUse)).thenReturn(resourceInUseResponse); + // + // Either<Component, StorageOperationStatus> eitherDelete = Either.left(new + // Resource()); + // when(toscaOperationFacade.deleteToscaComponent(resourceFree)).thenReturn(eitherDelete); + // + // when(artifactManager.deleteAllComponentArtifactsIfNotOnGraph(artifacts)).thenReturn(StorageOperationStatus.OK); + // List<String> deletedComponents = new ArrayList<>(); + // deletedComponents.add(resourceFree); + // when(toscaOperationFacade.deleteMarkedElements(ComponentTypeEnum.RESOURCE)).thenReturn(Either.left(deletedComponents)); + // + // Either<List<String>, ResponseFormat> deleteMarkedResources = + // bl.deleteMarkedComponents(); + // assertTrue(deleteMarkedResources.isLeft()); + // List<String> resourceIdList = deleteMarkedResources.left().value(); + // assertFalse(resourceIdList.isEmpty()); + // assertTrue(resourceIdList.contains(resourceFree)); + // assertFalse(resourceIdList.contains(resourceInUse)); + // + // Mockito.verify(artifactManager, + // Mockito.times(1)).deleteAllComponentArtifactsIfNotOnGraph(artifacts); + // } + @SuppressWarnings("unchecked") @Test public void testFindVfCsarArtifactsToHandle() { - + Class<ResourceBusinessLogic> targetClass = ResourceBusinessLogic.class; String methodName = "findVfCsarArtifactsToHandle"; Resource resource = new Resource(); String deploymentArtifactToUpdateFileName = "deploymentArtifactToUpdate.yaml"; String deploymentArtifactToDeleteFileName = "deploymentArtifactToDelete.yaml"; String deploymentArtifactToCreateFileName = "deploymentArtifactToCreate.yaml"; - + String artifactInfoToUpdateFileName = "infoArtifactToUpdate.yaml"; String artifactInfoToDeleteFileName = "infoArtifactToDelete.yaml"; String artifactInfoToCreateFileName = "infoArtifactToCreate.yaml"; - + byte[] oldPayloadData = "oldPayloadData".getBytes(); byte[] newPayloadData = "newPayloadData".getBytes(); - Map<String, ArtifactDefinition> deploymentArtifacts =new HashMap<>(); - + Map<String, ArtifactDefinition> deploymentArtifacts = new HashMap<>(); + ArtifactDefinition deploymentArtifactToUpdate = new ArtifactDefinition(); deploymentArtifactToUpdate.setMandatory(false); deploymentArtifactToUpdate.setArtifactName(deploymentArtifactToUpdateFileName); deploymentArtifactToUpdate.setArtifactType("SNMP_POLL"); deploymentArtifactToUpdate.setPayload(oldPayloadData); - deploymentArtifactToUpdate.setArtifactChecksum(GeneralUtility.calculateMD5Base64EncodedByByteArray(oldPayloadData)); - + deploymentArtifactToUpdate + .setArtifactChecksum(GeneralUtility.calculateMD5Base64EncodedByByteArray(oldPayloadData)); + ArtifactDefinition deploymentArtifactToDelete = new ArtifactDefinition(); deploymentArtifactToDelete.setMandatory(false); deploymentArtifactToDelete.setArtifactName(deploymentArtifactToDeleteFileName); deploymentArtifactToDelete.setArtifactType("SNMP_TRAP"); deploymentArtifactToDelete.setPayload(oldPayloadData); - deploymentArtifactToDelete.setArtifactChecksum(GeneralUtility.calculateMD5Base64EncodedByByteArray(oldPayloadData)); - + deploymentArtifactToDelete + .setArtifactChecksum(GeneralUtility.calculateMD5Base64EncodedByByteArray(oldPayloadData)); + ArtifactDefinition deploymentArtifactToIgnore = new ArtifactDefinition(); - - deploymentArtifacts.put(ValidationUtils.normalizeArtifactLabel(deploymentArtifactToUpdate.getArtifactName()), deploymentArtifactToUpdate); - deploymentArtifacts.put(ValidationUtils.normalizeArtifactLabel(deploymentArtifactToDelete.getArtifactName()), deploymentArtifactToDelete); + + deploymentArtifacts.put(ValidationUtils.normalizeArtifactLabel(deploymentArtifactToUpdate.getArtifactName()), + deploymentArtifactToUpdate); + deploymentArtifacts.put(ValidationUtils.normalizeArtifactLabel(deploymentArtifactToDelete.getArtifactName()), + deploymentArtifactToDelete); deploymentArtifacts.put("ignore", deploymentArtifactToIgnore); - + Map<String, ArtifactDefinition> artifacts = new HashMap<>(); - + ArtifactDefinition artifactToUpdate = new ArtifactDefinition(); artifactToUpdate.setMandatory(false); artifactToUpdate.setArtifactName(artifactInfoToUpdateFileName); artifactToUpdate.setArtifactType("SNMP_POLL"); artifactToUpdate.setPayload(oldPayloadData); artifactToUpdate.setArtifactChecksum(GeneralUtility.calculateMD5Base64EncodedByByteArray(oldPayloadData)); - + ArtifactDefinition artifactToDelete = new ArtifactDefinition(); artifactToDelete.setMandatory(false); artifactToDelete.setArtifactName(artifactInfoToDeleteFileName); artifactToDelete.setArtifactType("SNMP_TRAP"); artifactToDelete.setPayload(oldPayloadData); artifactToDelete.setArtifactChecksum(GeneralUtility.calculateMD5Base64EncodedByByteArray(oldPayloadData)); - + ArtifactDefinition artifactToIgnore = new ArtifactDefinition(); - - artifacts.put(ValidationUtils.normalizeArtifactLabel(artifactToUpdate.getArtifactName()),artifactToUpdate); - artifacts.put(ValidationUtils.normalizeArtifactLabel(artifactToDelete.getArtifactName()),artifactToDelete); - artifacts.put("ignore",artifactToIgnore); - + + artifacts.put(ValidationUtils.normalizeArtifactLabel(artifactToUpdate.getArtifactName()), artifactToUpdate); + artifacts.put(ValidationUtils.normalizeArtifactLabel(artifactToDelete.getArtifactName()), artifactToDelete); + artifacts.put("ignore", artifactToIgnore); + resource.setDeploymentArtifacts(deploymentArtifacts); resource.setArtifacts(artifacts); - + List<NonMetaArtifactInfo> artifactPathAndNameList = new ArrayList<>(); - NonMetaArtifactInfo deploymentArtifactInfoToUpdate = new NonMetaArtifactInfo(deploymentArtifactToUpdate.getArtifactName(), null, - ArtifactTypeEnum.findType(deploymentArtifactToUpdate.getArtifactType()), ArtifactGroupTypeEnum.DEPLOYMENT, - newPayloadData, deploymentArtifactToUpdate.getArtifactName()); - - NonMetaArtifactInfo informationalArtifactInfoToUpdate = new NonMetaArtifactInfo(artifactToUpdate.getArtifactName(), null, - ArtifactTypeEnum.findType(artifactToUpdate.getArtifactType()), ArtifactGroupTypeEnum.DEPLOYMENT, - newPayloadData, artifactToUpdate.getArtifactName()); - - NonMetaArtifactInfo deploymentArtifactInfoToCreate = new NonMetaArtifactInfo(deploymentArtifactToCreateFileName, null, - ArtifactTypeEnum.OTHER, ArtifactGroupTypeEnum.DEPLOYMENT, newPayloadData, deploymentArtifactToCreateFileName); - - NonMetaArtifactInfo informationalArtifactInfoToCreate = new NonMetaArtifactInfo(artifactInfoToCreateFileName, null, - ArtifactTypeEnum.OTHER, ArtifactGroupTypeEnum.DEPLOYMENT, - newPayloadData, artifactInfoToCreateFileName); - + NonMetaArtifactInfo deploymentArtifactInfoToUpdate = new NonMetaArtifactInfo( + deploymentArtifactToUpdate.getArtifactName(), null, + ArtifactTypeEnum.findType(deploymentArtifactToUpdate.getArtifactType()), + ArtifactGroupTypeEnum.DEPLOYMENT, newPayloadData, deploymentArtifactToUpdate.getArtifactName()); + + NonMetaArtifactInfo informationalArtifactInfoToUpdate = new NonMetaArtifactInfo( + artifactToUpdate.getArtifactName(), null, ArtifactTypeEnum.findType(artifactToUpdate.getArtifactType()), + ArtifactGroupTypeEnum.DEPLOYMENT, newPayloadData, artifactToUpdate.getArtifactName()); + + NonMetaArtifactInfo deploymentArtifactInfoToCreate = new NonMetaArtifactInfo(deploymentArtifactToCreateFileName, + null, ArtifactTypeEnum.OTHER, ArtifactGroupTypeEnum.DEPLOYMENT, newPayloadData, + deploymentArtifactToCreateFileName); + + NonMetaArtifactInfo informationalArtifactInfoToCreate = new NonMetaArtifactInfo(artifactInfoToCreateFileName, + null, ArtifactTypeEnum.OTHER, ArtifactGroupTypeEnum.DEPLOYMENT, newPayloadData, + artifactInfoToCreateFileName); + artifactPathAndNameList.add(deploymentArtifactInfoToUpdate); artifactPathAndNameList.add(informationalArtifactInfoToUpdate); artifactPathAndNameList.add(deploymentArtifactInfoToCreate); artifactPathAndNameList.add(informationalArtifactInfoToCreate); - - Object[] argObjects = {resource, artifactPathAndNameList, user}; - Class[] argClasses = {Resource.class, List.class, User.class}; - try { - Method method = targetClass.getDeclaredMethod(methodName, argClasses); - method.setAccessible(true); - Either<EnumMap<ArtifactOperationEnum, List<NonMetaArtifactInfo>>, ResponseFormat> findVfCsarArtifactsToHandleRes = - (Either<EnumMap<ArtifactOperationEnum, List<NonMetaArtifactInfo>>, ResponseFormat>) method.invoke(bl, argObjects); - assertTrue(findVfCsarArtifactsToHandleRes.isLeft()); - EnumMap<ArtifactOperationEnum, List<NonMetaArtifactInfo>> foundVfArtifacts = findVfCsarArtifactsToHandleRes.left().value(); - assertTrue(foundVfArtifacts.get(ArtifactOperationEnum.Create).size()==2); - assertTrue(foundVfArtifacts.get(ArtifactOperationEnum.Update).size()==2); - assertTrue(foundVfArtifacts.get(ArtifactOperationEnum.Create).size()==2); - - } - catch (Exception e) { - e.printStackTrace(); - } + + Object[] argObjects = { resource, artifactPathAndNameList, user }; + Class[] argClasses = { Resource.class, List.class, User.class }; + try { + Method method = targetClass.getDeclaredMethod(methodName, argClasses); + method.setAccessible(true); + Either<EnumMap<ArtifactOperationEnum, List<NonMetaArtifactInfo>>, ResponseFormat> findVfCsarArtifactsToHandleRes = (Either<EnumMap<ArtifactOperationEnum, List<NonMetaArtifactInfo>>, ResponseFormat>) method + .invoke(bl, argObjects); + assertTrue(findVfCsarArtifactsToHandleRes.isLeft()); + EnumMap<ArtifactOperationEnum, List<NonMetaArtifactInfo>> foundVfArtifacts = findVfCsarArtifactsToHandleRes + .left().value(); + assertTrue(foundVfArtifacts.get(ArtifactOperationEnum.Create).size() == 2); + assertTrue(foundVfArtifacts.get(ArtifactOperationEnum.Update).size() == 2); + assertTrue(foundVfArtifacts.get(ArtifactOperationEnum.Create).size() == 2); + + } catch (Exception e) { + e.printStackTrace(); + } } - + @SuppressWarnings("rawtypes") @Test public void testBuildNestedVfcToscaNamespace() { - + Class<ResourceBusinessLogic> targetClass = ResourceBusinessLogic.class; String methodName = "buildNestedVfcToscaNamespace"; String nodeTypeFullName = "org.openecomp.resource.abstract.nodes.heat.FEAdd_On_Module_vLBAgentTemplate"; String expectedNestedVfcToscaNamespace = "org.openecomp.resource.vfc.nodes.heat.FEAdd_On_Module_vLBAgentTemplate"; - Object[] argObjects = {nodeTypeFullName}; - Class[] argClasses = {String.class}; - try { - Method method = targetClass.getDeclaredMethod(methodName, argClasses); - method.setAccessible(true); - String actualNestedVfcToscaNamespace = (String) method.invoke(bl, argObjects); - assertTrue(!actualNestedVfcToscaNamespace.isEmpty()); - assertTrue(actualNestedVfcToscaNamespace.equals(expectedNestedVfcToscaNamespace)); - - } - catch (Exception e) { - e.printStackTrace(); - } + Object[] argObjects = { nodeTypeFullName }; + Class[] argClasses = { String.class }; + try { + Method method = targetClass.getDeclaredMethod(methodName, argClasses); + method.setAccessible(true); + String actualNestedVfcToscaNamespace = (String) method.invoke(bl, argObjects); + assertTrue(!actualNestedVfcToscaNamespace.isEmpty()); + assertTrue(actualNestedVfcToscaNamespace.equals(expectedNestedVfcToscaNamespace)); + + } catch (Exception e) { + e.printStackTrace(); + } } - + @SuppressWarnings("rawtypes") @Test public void testBuildNestedVfcToscaResourceName() { - + Class<ResourceBusinessLogic> targetClass = ResourceBusinessLogic.class; String methodName = "buildNestedVfcToscaResourceName"; String vfResourceName = "vfname"; String nodeTypeFullName = "org.openecomp.resource.abstract.nodes.heat.FEAdd_On_Module_vLBAgentTemplate"; String expectedNestedVfcToscaResourceName = "org.openecomp.resource.vfc.vfname.abstract.nodes.heat.FEAdd_On_Module_vLBAgentTemplate"; - Object[] argObjects = {vfResourceName, nodeTypeFullName}; - Class[] argClasses = {String.class, String.class}; - try { - Method method = targetClass.getDeclaredMethod(methodName, argClasses); - method.setAccessible(true); - String actualNestedVfcToscaResourceName = (String) method.invoke(bl, argObjects); - assertTrue(!actualNestedVfcToscaResourceName.isEmpty()); - assertTrue(actualNestedVfcToscaResourceName.equals(expectedNestedVfcToscaResourceName)); - - } - catch (Exception e) { - e.printStackTrace(); - } + Object[] argObjects = { vfResourceName, nodeTypeFullName }; + Class[] argClasses = { String.class, String.class }; + try { + Method method = targetClass.getDeclaredMethod(methodName, argClasses); + method.setAccessible(true); + String actualNestedVfcToscaResourceName = (String) method.invoke(bl, argObjects); + assertTrue(!actualNestedVfcToscaResourceName.isEmpty()); + assertTrue(actualNestedVfcToscaResourceName.equals(expectedNestedVfcToscaResourceName)); + + } catch (Exception e) { + e.printStackTrace(); + } } - + @SuppressWarnings("rawtypes") @Test public void testBuildNestedSubstituteYamlName() { - + Class<ResourceBusinessLogic> targetClass = ResourceBusinessLogic.class; String methodName = "buildNestedSubstituteYamlName"; String nodeTypeFullName = "org.openecomp.resource.abstract.nodes.heat.FEAdd_On_Module_vLBAgentTemplate"; String expectedNestedSubstituteYamlName = "Definitions/FEAdd_On_Module_vLBAgentTemplateServiceTemplate.yaml"; - Object[] argObjects = {nodeTypeFullName}; - Class[] argClasses = {String.class}; - try { - Method method = targetClass.getDeclaredMethod(methodName, argClasses); - method.setAccessible(true); - String actualNestedSubstituteYamlName = (String) method.invoke(bl, argObjects); - assertTrue(!actualNestedSubstituteYamlName.isEmpty()); - assertTrue(actualNestedSubstituteYamlName.equals(expectedNestedSubstituteYamlName)); - - } - catch (Exception e) { - e.printStackTrace(); - } + Object[] argObjects = { nodeTypeFullName }; + Class[] argClasses = { String.class }; + try { + Method method = targetClass.getDeclaredMethod(methodName, argClasses); + method.setAccessible(true); + String actualNestedSubstituteYamlName = (String) method.invoke(bl, argObjects); + assertTrue(!actualNestedSubstituteYamlName.isEmpty()); + assertTrue(actualNestedSubstituteYamlName.equals(expectedNestedSubstituteYamlName)); + + } catch (Exception e) { + e.printStackTrace(); + } } - - + @Test public void testVFGeneratedInputs() { - + Resource resource = createVF(); List<InputDefinition> inputs = resource.getInputs(); assertTrue(8 == inputs.size()); - for(InputDefinition input : inputs){ + for (InputDefinition input : inputs) { assertNotNull(input.getOwnerId()); } assertTrue(resource.getDerivedFromGenericType().equals(genericVF.getToscaResourceName())); assertTrue(resource.getDerivedFromGenericVersion().equals(genericVF.getVersion())); } - + @Test public void testVFUpdateGenericInputsToLatestOnCheckout() { - - //create a VF that is derived from generic version 1.0 - Resource resource = createVF(); + + // create a VF that is derived from generic version 1.0 + Resource resource = createVF(); // create a new generic version without properties genericVF.setVersion("2.0"); genericVF.setProperties(null); String currentDerivedFromVersion = resource.getDerivedFromGenericVersion(); List<InputDefinition> currentInputs = resource.getInputs(); - //verify previous inputs ownerId fields exist - user may not delete generated inputs + // verify previous inputs ownerId fields exist - user may not delete + // generated inputs assertTrue(8 == currentInputs.stream().filter(p -> null != p.getOwnerId()).collect(Collectors.toList()).size()); Either<Boolean, ResponseFormat> upgradeToLatestGeneric = bl.shouldUpgradeToLatestGeneric(resource); - //verify success + // verify success assertTrue(upgradeToLatestGeneric.isLeft()); - //verify update required and valid + // verify update required and valid assertTrue(upgradeToLatestGeneric.left().value()); - //verify version was upgraded + // verify version was upgraded assertFalse(resource.getDerivedFromGenericVersion().equals(currentDerivedFromVersion)); - //verify inputs were not deleted + // verify inputs were not deleted assertTrue(8 == resource.getInputs().size()); - //verify inputs ownerId fields were removed - user may delete/edit inputs - assertTrue(8 == resource.getInputs().stream().filter(p -> null == p.getOwnerId()).collect(Collectors.toList()).size()); + // verify inputs ownerId fields were removed - user may delete/edit + // inputs + assertTrue(8 == resource.getInputs().stream().filter(p -> null == p.getOwnerId()).collect(Collectors.toList()) + .size()); } - - + @Test public void testVFUpdateGenericInputsToLatestOnCheckoutNotPerformed() { - - //create a VF that is derived from generic version 1.0 + + // create a VF that is derived from generic version 1.0 Resource resource = createVF(); - - //add an input to the VF + + // add an input to the VF PropertyDefinition newProp = new PropertyDefinition(); newProp.setType("integer"); newProp.setName("newProp"); resource.getInputs().add(new InputDefinition(newProp)); - - //create a new generic version with a new property which has the same name as a user defined input on the VF with a different type + + // create a new generic version with a new property which has the same + // name as a user defined input on the VF with a different type genericVF.setVersion("2.0"); newProp.setType("string"); genericVF.setProperties(new ArrayList<PropertyDefinition>()); genericVF.getProperties().add(newProp); - + String currentDerivedFromVersion = resource.getDerivedFromGenericVersion(); - assertTrue(8 == resource.getInputs().stream().filter(p -> null != p.getOwnerId()).collect(Collectors.toList()).size()); + assertTrue(8 == resource.getInputs().stream().filter(p -> null != p.getOwnerId()).collect(Collectors.toList()) + .size()); Either<Boolean, ResponseFormat> upgradeToLatestGeneric = bl.shouldUpgradeToLatestGeneric(resource); - //verify success + // verify success assertTrue(upgradeToLatestGeneric.isLeft()); - //verify update is invalid an void + // verify update is invalid an void assertFalse(upgradeToLatestGeneric.left().value()); - //verify version was not upgraded + // verify version was not upgraded assertTrue(resource.getDerivedFromGenericVersion().equals(currentDerivedFromVersion)); - //verify inputs were not removed + // verify inputs were not removed assertTrue(9 == resource.getInputs().size()); - //verify user defined input exists - assertTrue(1 == resource.getInputs().stream().filter(p -> null == p.getOwnerId()).collect(Collectors.toList()).size()); - assertTrue(resource.getInputs().stream().filter(p -> null == p.getOwnerId()).findAny().get().getType().equals("integer")); + // verify user defined input exists + assertTrue(1 == resource.getInputs().stream().filter(p -> null == p.getOwnerId()).collect(Collectors.toList()) + .size()); + assertTrue(resource.getInputs().stream().filter(p -> null == p.getOwnerId()).findAny().get().getType() + .equals("integer")); } - + @Test public void testPNFGeneratedInputsNoGeneratedInformationalArtifacts() { - + Resource resource = createPNF(); List<InputDefinition> inputs = resource.getInputs(); assertTrue(8 == inputs.size()); - for(InputDefinition input : inputs){ + for (InputDefinition input : inputs) { assertNotNull(input.getOwnerId()); } assertTrue(resource.getDerivedFromGenericType().equals(genericPNF.getToscaResourceName())); assertTrue(resource.getDerivedFromGenericVersion().equals(genericPNF.getVersion())); assertTrue(0 == resource.getArtifacts().size()); } - - + private Resource createVF() { - + genericVF = setupGenericTypeMock(GENERIC_VF_NAME); - when(toscaOperationFacade.getLatestCertifiedNodeTypeByToscaResourceName(GENERIC_VF_NAME)).thenReturn(Either.left(genericVF)); + when(toscaOperationFacade.getLatestCertifiedNodeTypeByToscaResourceName(GENERIC_VF_NAME)) + .thenReturn(Either.left(genericVF)); Resource resource = createResourceObject(true); resource.setDerivedFrom(null); resource.setResourceType(ResourceTypeEnum.VF); when(toscaOperationFacade.createToscaComponent(resource)).thenReturn(Either.left(resource)); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resource, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resource, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isLeft()); return createResponse.left().value(); } - - private Resource createPNF() { - + + private Resource createPNF() { + genericPNF = setupGenericTypeMock(GENERIC_PNF_NAME); - when(toscaOperationFacade.getLatestCertifiedNodeTypeByToscaResourceName(GENERIC_PNF_NAME)).thenReturn(Either.left(genericPNF)); + when(toscaOperationFacade.getLatestCertifiedNodeTypeByToscaResourceName(GENERIC_PNF_NAME)) + .thenReturn(Either.left(genericPNF)); Resource resource = createResourceObject(true); resource.setDerivedFrom(null); resource.setResourceType(ResourceTypeEnum.PNF); when(toscaOperationFacade.createToscaComponent(resource)).thenReturn(Either.left(resource)); - Either<Resource, ResponseFormat> createResponse = bl.createResource(resource, AuditingActionEnum.CREATE_RESOURCE, user, null, null); + Either<Resource, ResponseFormat> createResponse = bl.createResource(resource, + AuditingActionEnum.CREATE_RESOURCE, user, null, null); assertTrue(createResponse.isLeft()); return createResponse.left().value(); } - - - private Resource setupGenericTypeMock(String toscaName) { - + private Resource setupGenericTypeMock(String toscaName) { + Resource genericType = createResourceObject(true); genericType.setVersion("1.0"); genericType.setToscaResourceName(toscaName); - String[] propNames = {"nf_function", "nf_role", "nf_naming_code", "nf_type", "nf_naming", "availability_zone_max_count", "min_instances", "max_instances"}; - String[] propTypes = {"string", "string", "string", "string", "org.openecomp.datatypes.Naming", "integer", "integer", "integer"}; + String[] propNames = { "nf_function", "nf_role", "nf_naming_code", "nf_type", "nf_naming", + "availability_zone_max_count", "min_instances", "max_instances" }; + String[] propTypes = { "string", "string", "string", "string", "org.openecomp.datatypes.Naming", "integer", + "integer", "integer" }; List<PropertyDefinition> genericProps = new ArrayList<>(); - for(int i = 0; i < 8; ++i){ + for (int i = 0; i < 8; ++i) { PropertyDefinition prop = new PropertyDefinition(); prop.setName(propNames[i]); prop.setType(propTypes[i]); @@ -1783,6 +1941,289 @@ public class ResourceBusinessLogicTest { return genericType; } - - + private ResourceBusinessLogic createTestSubject() { + return new ResourceBusinessLogic(); + } + + @Test + public void testGetCsarOperation() throws Exception { + ResourceBusinessLogic testSubject; + CsarOperation result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getCsarOperation(); + } + + @Test + public void testSetCsarOperation() throws Exception { + ResourceBusinessLogic testSubject; + CsarOperation csarOperation = null; + + // default test + testSubject = createTestSubject(); + testSubject.setCsarOperation(csarOperation); + } + + + @Test + public void testGetLifecycleBusinessLogic() throws Exception { + ResourceBusinessLogic testSubject; + LifecycleBusinessLogic result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getLifecycleBusinessLogic(); + } + + + @Test + public void testSetLifecycleManager() throws Exception { + ResourceBusinessLogic testSubject; + LifecycleBusinessLogic lifecycleBusinessLogic = null; + + // default test + testSubject = createTestSubject(); + testSubject.setLifecycleManager(lifecycleBusinessLogic); + } + + + @Test + public void testGetElementDao() throws Exception { + ResourceBusinessLogic testSubject; + IElementOperation result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getElementDao(); + } + + + @Test + public void testSetElementDao() throws Exception { + ResourceBusinessLogic testSubject; + IElementOperation elementDao = null; + + // default test + testSubject = createTestSubject(); + testSubject.setElementDao(elementDao); + } + + + @Test + public void testGetUserAdmin() throws Exception { + ResourceBusinessLogic testSubject; + IUserBusinessLogic result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getUserAdmin(); + } + + + @Test + public void testSetUserAdmin() throws Exception { + ResourceBusinessLogic testSubject; + UserBusinessLogic userAdmin = null; + + // default test + testSubject = createTestSubject(); + testSubject.setUserAdmin(userAdmin); + } + + + @Test + public void testGetComponentsUtils() throws Exception { + ResourceBusinessLogic testSubject; + ComponentsUtils result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getComponentsUtils(); + } + + + @Test + public void testSetComponentsUtils() throws Exception { + ResourceBusinessLogic testSubject; + ComponentsUtils componentsUtils = null; + + // default test + testSubject = createTestSubject(); + testSubject.setComponentsUtils(componentsUtils); + } + + + @Test + public void testGetArtifactsManager() throws Exception { + ResourceBusinessLogic testSubject; + ArtifactsBusinessLogic result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getArtifactsManager(); + } + + + @Test + public void testSetArtifactsManager() throws Exception { + ResourceBusinessLogic testSubject; + ArtifactsBusinessLogic artifactsManager = null; + + // default test + testSubject = createTestSubject(); + testSubject.setArtifactsManager(artifactsManager); + } + + + @Test + public void testSetPropertyOperation() throws Exception { + ResourceBusinessLogic testSubject; + IPropertyOperation propertyOperation = null; + + // default test + testSubject = createTestSubject(); + testSubject.setPropertyOperation(propertyOperation); + } + + + @Test + public void testGetApplicationDataTypeCache() throws Exception { + ResourceBusinessLogic testSubject; + ApplicationDataTypeCache result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getApplicationDataTypeCache(); + } + + + @Test + public void testSetApplicationDataTypeCache() throws Exception { + ResourceBusinessLogic testSubject; + ApplicationDataTypeCache applicationDataTypeCache = null; + + // default test + testSubject = createTestSubject(); + testSubject.setApplicationDataTypeCache(applicationDataTypeCache); + } + + @Test + public void testSetDeploymentArtifactsPlaceHolder() throws Exception { + ResourceBusinessLogic testSubject; + Component component = new Resource() { + }; + User user = null; + + // default test + testSubject = createTestSubject(); + testSubject.setDeploymentArtifactsPlaceHolder(component, user); + } + + + + @Test + public void testValidateVendorReleaseName_1() throws Exception { + ResourceBusinessLogic testSubject; + String vendorRelease = ""; + Either<Boolean, ResponseFormat> result; + + // test 1 + testSubject = createTestSubject(); + vendorRelease = null; + result = testSubject.validateVendorReleaseName(vendorRelease); + Assert.assertEquals(false, result.left().value()); + + } + + + + + + + @Test + public void testGetCapabilityTypeOperation() throws Exception { + ResourceBusinessLogic testSubject; + ICapabilityTypeOperation result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getCapabilityTypeOperation(); + } + + + @Test + public void testSetCapabilityTypeOperation() throws Exception { + ResourceBusinessLogic testSubject; + ICapabilityTypeOperation capabilityTypeOperation = null; + + // default test + testSubject = createTestSubject(); + testSubject.setCapabilityTypeOperation(capabilityTypeOperation); + } + + + @Test + public void testValidatePropertiesDefaultValues() throws Exception { + ResourceBusinessLogic testSubject; + Resource resource = new Resource(); + Either<Boolean, ResponseFormat> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.validatePropertiesDefaultValues(resource); + } + + + @Test + public void testGetComponentInstanceBL() throws Exception { + ResourceBusinessLogic testSubject; + ComponentInstanceBusinessLogic result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getComponentInstanceBL(); + } + + + + @Test + public void testGetComponentInstancesFilteredByPropertiesAndInputs() throws Exception { + ResourceBusinessLogic testSubject; + String componentId = ""; + ComponentTypeEnum componentTypeEnum = null; + String userId = ""; + String searchText = ""; + Either<List<ComponentInstance>, ResponseFormat> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getComponentInstancesFilteredByPropertiesAndInputs(componentId, componentTypeEnum, userId, + searchText); + } + + + + @Test + public void testGetCacheManagerOperation() throws Exception { + ResourceBusinessLogic testSubject; + ICacheMangerOperation result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getCacheManagerOperation(); + } + + + @Test + public void testSetCacheManagerOperation() throws Exception { + ResourceBusinessLogic testSubject; + ICacheMangerOperation cacheManagerOperation = null; + + // default test + testSubject = createTestSubject(); + testSubject.setCacheManagerOperation(cacheManagerOperation); + } + + } diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/impl/ComponentsUtilsTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/impl/ComponentsUtilsTest.java new file mode 100644 index 0000000000..b726bee926 --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/impl/ComponentsUtilsTest.java @@ -0,0 +1,308 @@ +package org.openecomp.sdc.be.impl; + +import java.util.EnumMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.tinkerpop.gremlin.structure.T; +import org.codehaus.jackson.map.module.SimpleModule; +import org.junit.Assert; +import org.junit.Test; +import org.openecomp.sdc.be.auditing.api.IAuditingManager; +import org.openecomp.sdc.be.components.impl.ImportUtils.ResultStatusEnum; +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.dao.graph.datatype.AdditionalInformationEnum; +import org.openecomp.sdc.be.datatypes.elements.AdditionalInfoParameterInfo; +import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; +import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields; +import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum; +import org.openecomp.sdc.be.model.ArtifactDefinition; +import org.openecomp.sdc.be.model.CapabilityTypeDefinition; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ConsumerDefinition; +import org.openecomp.sdc.be.model.DataTypeDefinition; +import org.openecomp.sdc.be.model.GroupTypeDefinition; +import org.openecomp.sdc.be.model.PolicyTypeDefinition; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.User; +import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; +import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum; +import org.openecomp.sdc.be.tosca.ToscaError; +import org.openecomp.sdc.common.datastructure.AuditingFieldsKeysEnum; +import org.openecomp.sdc.exception.ResponseFormat; + +import com.fasterxml.jackson.databind.JsonDeserializer; + +import fj.data.Either; + +public class ComponentsUtilsTest { + + private ComponentsUtils createTestSubject() { + return new ComponentsUtils(); + } + + + @Test + public void testInit() throws Exception { + ComponentsUtils testSubject; + + // default test + testSubject = createTestSubject(); + testSubject.Init(); + } + + + @Test + public void testGetAuditingManager() throws Exception { + ComponentsUtils testSubject; + IAuditingManager result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getAuditingManager(); + } + + + @Test + public void testSetAuditingManager() throws Exception { + ComponentsUtils testSubject; + IAuditingManager auditingManager = null; + + // default test + testSubject = createTestSubject(); + testSubject.setAuditingManager(auditingManager); + } + + + @Test + public void testAuditResource() throws Exception { + ComponentsUtils testSubject; + ResponseFormat responseFormat = null; + User modifier = null; + Resource resource = null; + String prevState = ""; + String prevVersion = ""; + AuditingActionEnum actionEnum = null; + EnumMap<AuditingFieldsKeysEnum, Object> additionalParams = null; + + // test 1 + testSubject = createTestSubject(); + actionEnum = null; + testSubject.auditResource(responseFormat, modifier, resource, prevState, prevVersion, actionEnum, + additionalParams); + } + + + @Test + public void testConvertFromStorageResponse() throws Exception { + ComponentsUtils testSubject; + StorageOperationStatus storageResponse = null; + ActionStatus result; + + // default test + testSubject = createTestSubject(); + result = testSubject.convertFromStorageResponse(storageResponse); + } + + + @Test + public void testConvertFromStorageResponse_1() throws Exception { + ComponentsUtils testSubject; + StorageOperationStatus storageResponse = null; + ComponentTypeEnum type = null; + ActionStatus result; + + // test 1 + testSubject = createTestSubject(); + storageResponse = null; + result = testSubject.convertFromStorageResponse(storageResponse, type); + Assert.assertEquals(ActionStatus.GENERAL_ERROR, result); + } + + + @Test + public void testConvertFromToscaError() throws Exception { + ComponentsUtils testSubject; + ToscaError toscaError = null; + ActionStatus result; + + // test 1 + testSubject = createTestSubject(); + toscaError = null; + result = testSubject.convertFromToscaError(toscaError); + Assert.assertEquals(ActionStatus.GENERAL_ERROR, result); + } + + + @Test + public void testConvertFromStorageResponseForCapabilityType() throws Exception { + ComponentsUtils testSubject; + StorageOperationStatus storageResponse = StorageOperationStatus.ARTIFACT_NOT_FOUND; + ActionStatus result; + + // default test + testSubject = createTestSubject(); + result = testSubject.convertFromStorageResponseForCapabilityType(storageResponse); + } + + + @Test + public void testConvertFromStorageResponseForLifecycleType() throws Exception { + ComponentsUtils testSubject; + StorageOperationStatus storageResponse = StorageOperationStatus.ARTIFACT_NOT_FOUND; + ActionStatus result; + + // default test + testSubject = createTestSubject(); + result = testSubject.convertFromStorageResponseForLifecycleType(storageResponse); + } + + + @Test + public void testConvertFromStorageResponseForResourceInstance() throws Exception { + ComponentsUtils testSubject; + StorageOperationStatus storageResponse = StorageOperationStatus.ARTIFACT_NOT_FOUND; + boolean isRelation = false; + ActionStatus result; + + // default test + testSubject = createTestSubject(); + result = testSubject.convertFromStorageResponseForResourceInstance(storageResponse, isRelation); + } + + + @Test + public void testConvertFromStorageResponseForResourceInstanceProperty() throws Exception { + ComponentsUtils testSubject; + StorageOperationStatus storageResponse = StorageOperationStatus.ARTIFACT_NOT_FOUND; + ActionStatus result; + + // default test + testSubject = createTestSubject(); + result = testSubject.convertFromStorageResponseForResourceInstanceProperty(storageResponse); + } + + + @Test + public void testAuditComponentAdmin() throws Exception { + ComponentsUtils testSubject; + ResponseFormat responseFormat = null; + User modifier = null; + Component component = null; + String prevState = ""; + String prevVersion = ""; + AuditingActionEnum actionEnum = null; + ComponentTypeEnum type = null; + + // default test + testSubject = createTestSubject(); + testSubject.auditComponentAdmin(responseFormat, modifier, component, prevState, prevVersion, actionEnum, type); + } + + + @Test + public void testAuditComponent() throws Exception { + ComponentsUtils testSubject; + ResponseFormat responseFormat = null; + User modifier = null; + Component component = null; + String prevState = ""; + String prevVersion = ""; + AuditingActionEnum actionEnum = null; + ComponentTypeEnum type = null; + EnumMap<AuditingFieldsKeysEnum, Object> additionalParams = null; + + // test 1 + testSubject = createTestSubject(); + actionEnum = null; + testSubject.auditComponent(responseFormat, modifier, component, prevState, prevVersion, actionEnum, type, + additionalParams); + } + + + @Test + public void testValidateStringNotEmpty_1() throws Exception { + ComponentsUtils testSubject; + String value = ""; + Boolean result; + + // test 1 + testSubject = createTestSubject(); + value = null; + result = testSubject.validateStringNotEmpty(value); + Assert.assertEquals(false, result); + + // test 2 + testSubject = createTestSubject(); + value = ""; + result = testSubject.validateStringNotEmpty(value); + Assert.assertEquals(false, result); + } + + + @Test + public void testConvertFromStorageResponseForAdditionalInformation() throws Exception { + ComponentsUtils testSubject; + StorageOperationStatus storageResponse = StorageOperationStatus.ARTIFACT_NOT_FOUND; + ActionStatus result; + + // default test + testSubject = createTestSubject(); + result = testSubject.convertFromStorageResponseForAdditionalInformation(storageResponse); + } + + + @Test + public void testConvertFromResultStatusEnum() throws Exception { + ComponentsUtils testSubject; + ResultStatusEnum resultStatus = ResultStatusEnum.ELEMENT_NOT_FOUND; + JsonPresentationFields elementType = null; + ActionStatus result; + + // default test + testSubject = createTestSubject(); + result = testSubject.convertFromResultStatusEnum(resultStatus, elementType); + } + + + @Test + public void testConvertFromStorageResponseForConsumer() throws Exception { + ComponentsUtils testSubject; + StorageOperationStatus storageResponse = StorageOperationStatus.ARTIFACT_NOT_FOUND; + ActionStatus result; + + // default test + testSubject = createTestSubject(); + result = testSubject.convertFromStorageResponseForConsumer(storageResponse); + } + + + @Test + public void testConvertFromStorageResponseForGroupType() throws Exception { + ComponentsUtils testSubject; + StorageOperationStatus storageResponse = StorageOperationStatus.ARTIFACT_NOT_FOUND; + ActionStatus result; + + // default test + testSubject = createTestSubject(); + result = testSubject.convertFromStorageResponseForGroupType(storageResponse); + } + + + @Test + public void testConvertFromStorageResponseForDataType() throws Exception { + ComponentsUtils testSubject; + StorageOperationStatus storageResponse = StorageOperationStatus.ARTIFACT_NOT_FOUND; + ActionStatus result; + + // default test + testSubject = createTestSubject(); + result = testSubject.convertFromStorageResponseForDataType(storageResponse); + } + + + +}
\ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/info/ArtifactTypesInfoTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ArtifactTypesInfoTest.java new file mode 100644 index 0000000000..4010d9bf86 --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ArtifactTypesInfoTest.java @@ -0,0 +1,60 @@ +package org.openecomp.sdc.be.info; + +import java.util.List; + +import javax.annotation.Generated; + +import org.junit.Test; +import org.openecomp.sdc.be.model.ArtifactType; + + +public class ArtifactTypesInfoTest { + + private ArtifactTypesInfo createTestSubject() { + return new ArtifactTypesInfo(); + } + + + @Test + public void testGetArtifactTypes() throws Exception { + ArtifactTypesInfo testSubject; + List<ArtifactType> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getArtifactTypes(); + } + + + @Test + public void testSetArtifactTypes() throws Exception { + ArtifactTypesInfo testSubject; + List<ArtifactType> artifactTypes = null; + + // default test + testSubject = createTestSubject(); + testSubject.setArtifactTypes(artifactTypes); + } + + + @Test + public void testGetHeatDefaultTimeout() throws Exception { + ArtifactTypesInfo testSubject; + Integer result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getHeatDefaultTimeout(); + } + + + @Test + public void testSetHeatDefaultTimeout() throws Exception { + ArtifactTypesInfo testSubject; + Integer heatDefaultTimeout = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setHeatDefaultTimeout(heatDefaultTimeout); + } +}
\ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/info/DistributionStatusListResponseTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/info/DistributionStatusListResponseTest.java new file mode 100644 index 0000000000..db4d735a7e --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/info/DistributionStatusListResponseTest.java @@ -0,0 +1,36 @@ +package org.openecomp.sdc.be.info; + +import java.util.List; + +import javax.annotation.Generated; + +import org.junit.Test; + +public class DistributionStatusListResponseTest { + + private DistributionStatusListResponse createTestSubject() { + return new DistributionStatusListResponse(); + } + + + @Test + public void testGetDistributionStatusList() throws Exception { + DistributionStatusListResponse testSubject; + List<DistributionStatusInfo> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDistributionStatusList(); + } + + + @Test + public void testSetDistributionStatusList() throws Exception { + DistributionStatusListResponse testSubject; + List<DistributionStatusInfo> distribStatusInfoList = null; + + // default test + testSubject = createTestSubject(); + testSubject.setDistributionStatusList(distribStatusInfoList); + } +}
\ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/info/DistributionStatusOfServiceListResponceTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/info/DistributionStatusOfServiceListResponceTest.java new file mode 100644 index 0000000000..830292a66f --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/info/DistributionStatusOfServiceListResponceTest.java @@ -0,0 +1,37 @@ +package org.openecomp.sdc.be.info; + +import java.util.List; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class DistributionStatusOfServiceListResponceTest { + + private DistributionStatusOfServiceListResponce createTestSubject() { + return new DistributionStatusOfServiceListResponce(); + } + + + @Test + public void testGetDistributionStatusOfServiceList() throws Exception { + DistributionStatusOfServiceListResponce testSubject; + List<DistributionStatusOfServiceInfo> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDistributionStatusOfServiceList(); + } + + + @Test + public void testSetDistributionStatusOfServiceList() throws Exception { + DistributionStatusOfServiceListResponce testSubject; + List<DistributionStatusOfServiceInfo> distribStatusOfServiceInfoList = null; + + // default test + testSubject = createTestSubject(); + testSubject.setDistributionStatusOfServiceList(distribStatusOfServiceInfoList); + } +}
\ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/info/ServicesWrapperTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ServicesWrapperTest.java new file mode 100644 index 0000000000..085583aa2d --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ServicesWrapperTest.java @@ -0,0 +1,37 @@ +package org.openecomp.sdc.be.info; + +import java.util.List; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class ServicesWrapperTest { + + private ServicesWrapper createTestSubject() { + return new ServicesWrapper(); + } + + + @Test + public void testGetServices() throws Exception { + ServicesWrapper testSubject; + List<ServiceInfo> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getServices(); + } + + + @Test + public void testSetServices() throws Exception { + ServicesWrapper testSubject; + List<ServiceInfo> services = null; + + // default test + testSubject = createTestSubject(); + testSubject.setServices(services); + } +}
\ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/info/ToscaNodeTypeInterfaceTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ToscaNodeTypeInterfaceTest.java new file mode 100644 index 0000000000..80ae443afe --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/info/ToscaNodeTypeInterfaceTest.java @@ -0,0 +1,37 @@ +package org.openecomp.sdc.be.info; + +import java.util.List; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class ToscaNodeTypeInterfaceTest { + + private ToscaNodeTypeInterface createTestSubject() { + return new ToscaNodeTypeInterface(); + } + + + @Test + public void testGetScripts() throws Exception { + ToscaNodeTypeInterface testSubject; + List<String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getScripts(); + } + + + @Test + public void testSetScripts() throws Exception { + ToscaNodeTypeInterface testSubject; + List<String> scripts = null; + + // default test + testSubject = createTestSubject(); + testSubject.setScripts(scripts); + } +}
\ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/switchover/detector/SwitchoverDetectorTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/switchover/detector/SwitchoverDetectorTest.java new file mode 100644 index 0000000000..f93819c0a1 --- /dev/null +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/switchover/detector/SwitchoverDetectorTest.java @@ -0,0 +1,38 @@ +package org.openecomp.sdc.be.switchover.detector; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class SwitchoverDetectorTest { + + private SwitchoverDetector createTestSubject() { + return new SwitchoverDetector(); + } + + + @Test + public void testGetSiteMode() throws Exception { + SwitchoverDetector testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getSiteMode(); + } + + + @Test + public void testSetSiteMode() throws Exception { + SwitchoverDetector testSubject; + String mode = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setSiteMode(mode); + } + + + +}
\ No newline at end of file diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/CsarUtilsTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/CsarUtilsTest.java index faf70f4047..8acfe6cfea 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/CsarUtilsTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/tosca/CsarUtilsTest.java @@ -27,13 +27,18 @@ import java.util.List; import java.util.Map; import java.util.Set; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.openecomp.sdc.be.config.ConfigurationManager; +import org.openecomp.sdc.be.model.ArtifactDefinition; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.tosca.CsarUtils.NonMetaArtifactInfo; import org.openecomp.sdc.common.api.ConfigurationSource; import org.openecomp.sdc.common.impl.ExternalConfiguration; import org.openecomp.sdc.common.impl.FSConfigurationSource; +import org.openecomp.sdc.exception.ResponseFormat; import fj.data.Either; @@ -44,48 +49,90 @@ public class CsarUtilsTest { // Init Configuration String appConfigDir = "src/test/resources/config/catalog-be"; - ConfigurationSource configurationSource = new FSConfigurationSource(ExternalConfiguration.getChangeListener(), appConfigDir); + ConfigurationSource configurationSource = new FSConfigurationSource(ExternalConfiguration.getChangeListener(), + appConfigDir); ConfigurationManager configurationManager = new ConfigurationManager(configurationSource); } - + @Test - public void testValidateNonMetaArtifactHappyScenario(){ + public void testValidateNonMetaArtifactHappyScenario() { String artifactPath = "Artifacts/Deployment/YANG_XML/myYang.xml"; byte[] payloadData = "some payload data".getBytes(); Map<String, Set<List<String>>> collectedWarningMessages = new HashMap<>(); - Either<NonMetaArtifactInfo, Boolean> eitherNonMetaArtifact = CsarUtils.validateNonMetaArtifact(artifactPath, payloadData, collectedWarningMessages); - assertTrue(eitherNonMetaArtifact.isLeft() ); - assertTrue(collectedWarningMessages.isEmpty() ); + Either<NonMetaArtifactInfo, Boolean> eitherNonMetaArtifact = CsarUtils.validateNonMetaArtifact(artifactPath, + payloadData, collectedWarningMessages); + assertTrue(eitherNonMetaArtifact.isLeft()); + assertTrue(collectedWarningMessages.isEmpty()); artifactPath = "Artifacts/Informational/OTHER/someArtifact.xml"; eitherNonMetaArtifact = CsarUtils.validateNonMetaArtifact(artifactPath, payloadData, collectedWarningMessages); - assertTrue(eitherNonMetaArtifact.isLeft() ); - assertTrue(collectedWarningMessages.isEmpty() ); + assertTrue(eitherNonMetaArtifact.isLeft()); + assertTrue(collectedWarningMessages.isEmpty()); } - + @Test - public void testValidateNonMetaArtifactScenarioWithWarnnings(){ + public void testValidateNonMetaArtifactScenarioWithWarnnings() { String artifactPath = "Artifacts/Deployment/Buga/myYang.xml"; byte[] payloadData = "some payload data".getBytes(); Map<String, Set<List<String>>> collectedWarningMessages = new HashMap<>(); - Either<NonMetaArtifactInfo, Boolean> eitherNonMetaArtifact = CsarUtils.validateNonMetaArtifact(artifactPath, payloadData, collectedWarningMessages); - assertTrue(eitherNonMetaArtifact.isLeft() ); - + Either<NonMetaArtifactInfo, Boolean> eitherNonMetaArtifact = CsarUtils.validateNonMetaArtifact(artifactPath, + payloadData, collectedWarningMessages); + assertTrue(eitherNonMetaArtifact.isLeft()); + artifactPath = "Artifacts/Informational/Buga2/someArtifact.xml"; eitherNonMetaArtifact = CsarUtils.validateNonMetaArtifact(artifactPath, payloadData, collectedWarningMessages); - assertTrue(eitherNonMetaArtifact.isLeft() ); - - assertTrue(collectedWarningMessages.size() == 1 ); + assertTrue(eitherNonMetaArtifact.isLeft()); + + assertTrue(collectedWarningMessages.size() == 1); assertTrue(collectedWarningMessages.values().iterator().next().size() == 2); } - + @Test - public void testValidateNonMetaArtifactUnhappyScenario(){ + public void testValidateNonMetaArtifactUnhappyScenario() { String artifactPath = "Artifacts/Buga/YANG_XML/myYang.xml"; byte[] payloadData = "some payload data".getBytes(); Map<String, Set<List<String>>> collectedWarningMessages = new HashMap<>(); - Either<NonMetaArtifactInfo, Boolean> eitherNonMetaArtifact = CsarUtils.validateNonMetaArtifact(artifactPath, payloadData, collectedWarningMessages); - assertTrue(eitherNonMetaArtifact.isRight() ); - assertTrue( !collectedWarningMessages.isEmpty() ); + Either<NonMetaArtifactInfo, Boolean> eitherNonMetaArtifact = CsarUtils.validateNonMetaArtifact(artifactPath, + payloadData, collectedWarningMessages); + assertTrue(eitherNonMetaArtifact.isRight()); + assertTrue(!collectedWarningMessages.isEmpty()); + } + + private CsarUtils createTestSubject() { + return new CsarUtils(); } + + + @Test + public void testExtractVfcsArtifactsFromCsar() throws Exception { + Map<String, byte[]> csar = null; + Map<String, List<ArtifactDefinition>> result; + + // test 1 + csar = null; + result = CsarUtils.extractVfcsArtifactsFromCsar(csar); + Assert.assertEquals(new HashMap<String, List<ArtifactDefinition>>() , result); + } + + + @Test + public void testHandleWarningMessages() throws Exception { + Map<String, Set<List<String>>> collectedWarningMessages = new HashMap<>(); + + // default test + CsarUtils.handleWarningMessages(collectedWarningMessages); + } + + + @Test + public void testValidateNonMetaArtifact() throws Exception { + String artifactPath = ""; + byte[] payloadData = new byte[] { ' ' }; + Map<String, Set<List<String>>> collectedWarningMessages = null; + Either<NonMetaArtifactInfo, Boolean> result; + + // default test + result = CsarUtils.validateNonMetaArtifact(artifactPath, payloadData, collectedWarningMessages); + } + } diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/AccountTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/AccountTest.java new file mode 100644 index 0000000000..414748a416 --- /dev/null +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/AccountTest.java @@ -0,0 +1,71 @@ +package org.openecomp.sdc.be.dao; + +import org.junit.Test; + +public class AccountTest { + + private Account createTestSubject() { + return new Account(); + } + + @Test + public void testGetName() throws Exception { + Account testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getName(); + } + + @Test + public void testSetName() throws Exception { + Account testSubject; + String name = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setName(name); + } + + @Test + public void testGetEmail() throws Exception { + Account testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getEmail(); + } + + @Test + public void testSetEmail() throws Exception { + Account testSubject; + String email = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setEmail(email); + } + + @Test + public void testEquals() throws Exception { + Account testSubject; + Object other = null; + boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.equals(other); + } + + @Test + public void testHashCode() throws Exception { + Account testSubject; + int result; + + // default test + testSubject = createTestSubject(); + result = testSubject.hashCode(); + } +}
\ No newline at end of file diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/AuditCassandraDaoTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/AuditCassandraDaoTest.java new file mode 100644 index 0000000000..6936f4e5be --- /dev/null +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/AuditCassandraDaoTest.java @@ -0,0 +1,154 @@ +package org.openecomp.sdc.be.dao.cassandra; + +import java.util.List; + +import javax.annotation.Generated; + +import org.apache.tinkerpop.gremlin.structure.T; +import org.junit.Test; +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.resources.data.auditing.AuditingGenericEvent; +import org.openecomp.sdc.be.resources.data.auditing.DistributionDeployEvent; +import org.openecomp.sdc.be.resources.data.auditing.DistributionNotificationEvent; +import org.openecomp.sdc.be.resources.data.auditing.DistributionStatusEvent; +import org.openecomp.sdc.be.resources.data.auditing.ResourceAdminEvent; + +import fj.data.Either; + + +public class AuditCassandraDaoTest { + + private AuditCassandraDao createTestSubject() { + return new AuditCassandraDao(); + } + + + + + + + + @Test + public void testGetListOfDistributionStatuses() throws Exception { + AuditCassandraDao testSubject; + String did = ""; + Either<List<DistributionStatusEvent>, ActionStatus> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getListOfDistributionStatuses(did); + } + + + @Test + public void testGetDistributionDeployByStatus() throws Exception { + AuditCassandraDao testSubject; + String did = ""; + String action = ""; + String status = ""; + Either<List<DistributionDeployEvent>, ActionStatus> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDistributionDeployByStatus(did, action, status); + } + + + @Test + public void testGetDistributionRequest() throws Exception { + AuditCassandraDao testSubject; + String did = ""; + String action = ""; + Either<List<ResourceAdminEvent>, ActionStatus> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDistributionRequest(did, action); + } + + + @Test + public void testGetDistributionNotify() throws Exception { + AuditCassandraDao testSubject; + String did = ""; + String action = ""; + Either<List<DistributionNotificationEvent>, ActionStatus> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDistributionNotify(did, action); + } + + + @Test + public void testGetByServiceInstanceId() throws Exception { + AuditCassandraDao testSubject; + String serviceInstanceId = ""; + Either<List<ResourceAdminEvent>, ActionStatus> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getByServiceInstanceId(serviceInstanceId); + } + + + @Test + public void testGetServiceDistributionStatusesList() throws Exception { + AuditCassandraDao testSubject; + String serviceInstanceId = ""; + Either<List<? extends AuditingGenericEvent>, ActionStatus> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getServiceDistributionStatusesList(serviceInstanceId); + } + + + @Test + public void testGetAuditByServiceIdAndPrevVersion() throws Exception { + AuditCassandraDao testSubject; + String serviceInstanceId = ""; + String prevVersion = ""; + Either<List<ResourceAdminEvent>, ActionStatus> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getAuditByServiceIdAndPrevVersion(serviceInstanceId, prevVersion); + } + + + @Test + public void testGetAuditByServiceIdAndCurrVersion() throws Exception { + AuditCassandraDao testSubject; + String serviceInstanceId = ""; + String currVersion = ""; + Either<List<ResourceAdminEvent>, ActionStatus> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getAuditByServiceIdAndCurrVersion(serviceInstanceId, currVersion); + } + + + @Test + public void testIsTableEmpty() throws Exception { + AuditCassandraDao testSubject; + String tableName = ""; + Either<Boolean, CassandraOperationStatus> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.isTableEmpty(tableName); + } + + + @Test + public void testDeleteAllAudit() throws Exception { + AuditCassandraDao testSubject; + CassandraOperationStatus result; + + // default test + testSubject = createTestSubject(); + result = testSubject.deleteAllAudit(); + } +}
\ No newline at end of file diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/ComponentCassandraDaoTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/ComponentCassandraDaoTest.java new file mode 100644 index 0000000000..f4f9fd5fc2 --- /dev/null +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/ComponentCassandraDaoTest.java @@ -0,0 +1,55 @@ +package org.openecomp.sdc.be.dao.cassandra; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.annotation.Generated; + +import org.apache.commons.lang3.tuple.ImmutablePair; +import org.junit.Assert; +import org.junit.Test; +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.resources.data.ComponentCacheData; + +import fj.data.Either; + + +public class ComponentCassandraDaoTest { + + private ComponentCassandraDao createTestSubject() { + return new ComponentCassandraDao(); + } + + @Test + public void testGetAllComponentIdTimeAndType() throws Exception { + ComponentCassandraDao testSubject; + Either<List<ComponentCacheData>, ActionStatus> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getAllComponentIdTimeAndType(); + } + + + + + + + + @Test + public void testIsTableEmpty() throws Exception { + ComponentCassandraDao testSubject; + String tableName = ""; + Either<Boolean, CassandraOperationStatus> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.isTableEmpty(tableName); + } + + + + + +}
\ No newline at end of file diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/SdcSchemaFilesCassandraDaoTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/SdcSchemaFilesCassandraDaoTest.java new file mode 100644 index 0000000000..141aeebc5d --- /dev/null +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/SdcSchemaFilesCassandraDaoTest.java @@ -0,0 +1,55 @@ +package org.openecomp.sdc.be.dao.cassandra; + +import java.util.List; + +import javax.annotation.Generated; + +import org.junit.Test; +import org.openecomp.sdc.be.resources.data.SdcSchemaFilesData; + +import fj.data.Either; + + +public class SdcSchemaFilesCassandraDaoTest { + + private SdcSchemaFilesCassandraDao createTestSubject() { + return new SdcSchemaFilesCassandraDao(); + } + + + + @Test + public void testGetSpecificSchemaFiles() throws Exception { + SdcSchemaFilesCassandraDao testSubject; + String sdcreleasenum = ""; + String conformancelevel = ""; + Either<List<SdcSchemaFilesData>, CassandraOperationStatus> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getSpecificSchemaFiles(sdcreleasenum, conformancelevel); + } + + + @Test + public void testDeleteAllArtifacts() throws Exception { + SdcSchemaFilesCassandraDao testSubject; + CassandraOperationStatus result; + + // default test + testSubject = createTestSubject(); + result = testSubject.deleteAllArtifacts(); + } + + + @Test + public void testIsTableEmpty() throws Exception { + SdcSchemaFilesCassandraDao testSubject; + String tableName = ""; + Either<Boolean, CassandraOperationStatus> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.isTableEmpty(tableName); + } +}
\ No newline at end of file diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaUtilsTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaUtilsTest.java new file mode 100644 index 0000000000..f4844a9800 --- /dev/null +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/SdcSchemaUtilsTest.java @@ -0,0 +1,38 @@ +package org.openecomp.sdc.be.dao.cassandra.schema; + +import javax.annotation.Generated; + +import org.junit.Test; + +import com.datastax.driver.core.Cluster; + + +public class SdcSchemaUtilsTest { + + private SdcSchemaUtils createTestSubject() { + return new SdcSchemaUtils(); + } + + + + + + @Test + public void testExecuteStatement() throws Exception { + String statement = ""; + boolean result; + + // default test + result = SdcSchemaUtils.executeStatement(statement); + } + + + @Test + public void testExecuteStatements() throws Exception { + String[] statements = new String[] { "" }; + boolean result; + + // default test + result = SdcSchemaUtils.executeStatements(statements); + } +}
\ No newline at end of file diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/TableTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/TableTest.java new file mode 100644 index 0000000000..3c891c97f3 --- /dev/null +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/TableTest.java @@ -0,0 +1,24 @@ +package org.openecomp.sdc.be.dao.cassandra.schema; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class TableTest { + + private Table createTestSubject() { + return Table.ARTIFACT; + } + + + @Test + public void testGetTableDescription() throws Exception { + Table testSubject; + ITableDescription result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getTableDescription(); + } +}
\ No newline at end of file diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/CategoryEventTableDescriptionTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/CategoryEventTableDescriptionTest.java index c83595d591..4f12640b1f 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/CategoryEventTableDescriptionTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/CategoryEventTableDescriptionTest.java @@ -40,15 +40,6 @@ public class CategoryEventTableDescriptionTest { } - @Test - public void testGetColumnDescription() throws Exception { - CategoryEventTableDescription testSubject; - Map<String, ImmutablePair<DataType, Boolean>> result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getColumnDescription(); - } @Test diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribStatusEventTableDescTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribStatusEventTableDescTest.java index 23b7301a68..e4defc068c 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribStatusEventTableDescTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/DistribStatusEventTableDescTest.java @@ -40,15 +40,7 @@ public class DistribStatusEventTableDescTest { } - @Test - public void testGetColumnDescription() throws Exception { - DistribStatusEventTableDesc testSubject; - Map<String, ImmutablePair<DataType, Boolean>> result; - // default test - testSubject = createTestSubject(); - result = testSubject.getColumnDescription(); - } @Test diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ResAdminEventTableDescriptionTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ResAdminEventTableDescriptionTest.java index 68b06e1b66..6e6afb7424 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ResAdminEventTableDescriptionTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/ResAdminEventTableDescriptionTest.java @@ -40,15 +40,7 @@ public class ResAdminEventTableDescriptionTest { } - @Test - public void testGetColumnDescription() throws Exception { - ResAdminEventTableDescription testSubject; - Map<String, ImmutablePair<DataType, Boolean>> result; - // default test - testSubject = createTestSubject(); - result = testSubject.getColumnDescription(); - } @Test diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/UserAdminEventTableDescriptionTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/UserAdminEventTableDescriptionTest.java index 1efb68c1a9..66f6861f83 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/UserAdminEventTableDescriptionTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/cassandra/schema/tables/UserAdminEventTableDescriptionTest.java @@ -40,15 +40,6 @@ public class UserAdminEventTableDescriptionTest { } - @Test - public void testGetColumnDescription() throws Exception { - UserAdminEventTableDescription testSubject; - Map<String, ImmutablePair<DataType, Boolean>> result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getColumnDescription(); - } @Test diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertexTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertexTest.java new file mode 100644 index 0000000000..9a8b67dbd0 --- /dev/null +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/GraphVertexTest.java @@ -0,0 +1,204 @@ +package org.openecomp.sdc.be.dao.jsongraph; + +import java.util.Map; + +import javax.annotation.Generated; + +import org.junit.Test; +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; +import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields; +import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; + +import com.thinkaurelius.titan.core.TitanVertex; + + +public class GraphVertexTest { + + private GraphVertex createTestSubject() { + return new GraphVertex(); + } + + + @Test + public void testGetUniqueId() throws Exception { + GraphVertex testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getUniqueId(); + } + + + @Test + public void testSetUniqueId() throws Exception { + GraphVertex testSubject; + String uniqueId = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setUniqueId(uniqueId); + } + + + @Test + public void testGetJson() throws Exception { + GraphVertex testSubject; + Map<String, ? extends ToscaDataDefinition> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getJson(); + } + + + @Test + public void testSetJson() throws Exception { + GraphVertex testSubject; + Map<String, ? extends ToscaDataDefinition> json = null; + + // default test + testSubject = createTestSubject(); + testSubject.setJson(json); + } + + + @Test + public void testGetVertex() throws Exception { + GraphVertex testSubject; + TitanVertex result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getVertex(); + } + + + @Test + public void testSetVertex() throws Exception { + GraphVertex testSubject; + TitanVertex vertex = null; + + // default test + testSubject = createTestSubject(); + testSubject.setVertex(vertex); + } + + + @Test + public void testGetLabel() throws Exception { + GraphVertex testSubject; + VertexTypeEnum result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getLabel(); + } + + + @Test + public void testSetLabel() throws Exception { + GraphVertex testSubject; + VertexTypeEnum label = null; + + // default test + testSubject = createTestSubject(); + testSubject.setLabel(label); + } + + + + @Test + public void testAddMetadataProperty() throws Exception { + GraphVertex testSubject; + GraphPropertyEnum propName = null; + Object propValue = null; + + // test 1 + testSubject = createTestSubject(); + propValue = null; + testSubject.addMetadataProperty(propName, propValue); + } + + + @Test + public void testGetMetadataProperty() throws Exception { + GraphVertex testSubject; + GraphPropertyEnum metadataProperty = null; + Object result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getMetadataProperty(metadataProperty); + } + + + @Test + public void testGetMetadataProperties() throws Exception { + GraphVertex testSubject; + Map<GraphPropertyEnum, Object> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getMetadataProperties(); + } + + + @Test + public void testSetMetadataProperties() throws Exception { + GraphVertex testSubject; + Map<GraphPropertyEnum, Object> metadataProperties = null; + + // default test + testSubject = createTestSubject(); + testSubject.setMetadataProperties(metadataProperties); + } + + + @Test + public void testGetMetadataJson() throws Exception { + GraphVertex testSubject; + Map<String, Object> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getMetadataJson(); + } + + + @Test + public void testSetMetadataJson() throws Exception { + GraphVertex testSubject; + Map<String, Object> metadataJson = null; + + // default test + testSubject = createTestSubject(); + testSubject.setMetadataJson(metadataJson); + } + + + + + @Test + public void testGetJsonMetadataField() throws Exception { + GraphVertex testSubject; + JsonPresentationFields field = null; + Object result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getJsonMetadataField(field); + } + + + @Test + public void testUpdateMetadataJsonWithCurrentMetadataProperties() throws Exception { + GraphVertex testSubject; + + // default test + testSubject = createTestSubject(); + testSubject.updateMetadataJsonWithCurrentMetadataProperties(); + } +}
\ No newline at end of file diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/TitanDaoTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/TitanDaoTest.java new file mode 100644 index 0000000000..bf059219c2 --- /dev/null +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/TitanDaoTest.java @@ -0,0 +1,300 @@ +package org.openecomp.sdc.be.dao.jsongraph; + +import java.util.List; +import java.util.Map; + +import javax.annotation.Generated; +import javax.lang.model.element.Element; + +import org.apache.commons.lang3.tuple.ImmutablePair; +import org.apache.tinkerpop.gremlin.structure.Edge; +import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.junit.Assert; +import org.junit.Test; +import org.openecomp.sdc.be.dao.jsongraph.types.EdgeLabelEnum; +import org.openecomp.sdc.be.dao.jsongraph.types.EdgePropertyEnum; +import org.openecomp.sdc.be.dao.jsongraph.types.JsonParseFlagEnum; +import org.openecomp.sdc.be.dao.jsongraph.types.VertexTypeEnum; +import org.openecomp.sdc.be.dao.titan.TitanGraphClient; +import org.openecomp.sdc.be.dao.titan.TitanOperationStatus; +import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; + +import com.datastax.driver.core.schemabuilder.SchemaBuilder.Direction; +import com.google.common.collect.Multiset.Entry; +import com.thinkaurelius.titan.core.TitanGraph; +import com.thinkaurelius.titan.core.TitanGraphQuery; +import com.thinkaurelius.titan.core.TitanVertex; + +import fj.data.Either; + + +public class TitanDaoTest { + + private TitanDao createTestSubject() { + return new TitanDao(new TitanGraphClient()); + } + + + @Test + public void testCommit() throws Exception { + TitanDao testSubject; + TitanOperationStatus result; + + // default test + testSubject = createTestSubject(); + result = testSubject.commit(); + } + + + @Test + public void testRollback() throws Exception { + TitanDao testSubject; + TitanOperationStatus result; + + // default test + testSubject = createTestSubject(); + result = testSubject.rollback(); + } + + + @Test + public void testGetGraph() throws Exception { + TitanDao testSubject; + Either<TitanGraph, TitanOperationStatus> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getGraph(); + } + + + + + + @Test + public void testGetVertexByPropertyAndLabel() throws Exception { + TitanDao testSubject; + GraphPropertyEnum name = null; + Object value = null; + VertexTypeEnum label = null; + Either<GraphVertex, TitanOperationStatus> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getVertexByPropertyAndLabel(name, value, label); + } + + + @Test + public void testGetVertexByPropertyAndLabel_1() throws Exception { + TitanDao testSubject; + GraphPropertyEnum name = null; + Object value = null; + VertexTypeEnum label = null; + JsonParseFlagEnum parseFlag = null; + Either<GraphVertex, TitanOperationStatus> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getVertexByPropertyAndLabel(name, value, label, parseFlag); + } + + + @Test + public void testGetVertexById() throws Exception { + TitanDao testSubject; + String id = ""; + Either<GraphVertex, TitanOperationStatus> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getVertexById(id); + } + + + + + + + + + + + + + + + + + + @Test + public void testGetByCriteria() throws Exception { + TitanDao testSubject; + VertexTypeEnum type = null; + Map<GraphPropertyEnum, Object> props = null; + Either<List<GraphVertex>, TitanOperationStatus> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getByCriteria(type, props); + } + + + @Test + public void testGetByCriteria_1() throws Exception { + TitanDao testSubject; + VertexTypeEnum type = null; + Map<GraphPropertyEnum, Object> props = null; + JsonParseFlagEnum parseFlag = null; + Either<List<GraphVertex>, TitanOperationStatus> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getByCriteria(type, props, parseFlag); + } + + + @Test + public void testGetByCriteria_2() throws Exception { + TitanDao testSubject; + VertexTypeEnum type = null; + Map<GraphPropertyEnum, Object> props = null; + Map<GraphPropertyEnum, Object> hasNotProps = null; + JsonParseFlagEnum parseFlag = null; + Either<List<GraphVertex>, TitanOperationStatus> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getByCriteria(type, props, hasNotProps, parseFlag); + } + + + + + + @Test + public void testGetChildVertex() throws Exception { + TitanDao testSubject; + GraphVertex parentVertex = null; + EdgeLabelEnum edgeLabel = null; + JsonParseFlagEnum parseFlag = null; + Either<GraphVertex, TitanOperationStatus> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getChildVertex(parentVertex, edgeLabel, parseFlag); + } + + + @Test + public void testGetParentVertex() throws Exception { + TitanDao testSubject; + GraphVertex parentVertex = null; + EdgeLabelEnum edgeLabel = null; + JsonParseFlagEnum parseFlag = null; + Either<GraphVertex, TitanOperationStatus> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getParentVertex(parentVertex, edgeLabel, parseFlag); + } + + + @Test + public void testGetChildrenVertecies() throws Exception { + TitanDao testSubject; + GraphVertex parentVertex = null; + EdgeLabelEnum edgeLabel = null; + JsonParseFlagEnum parseFlag = null; + Either<List<GraphVertex>, TitanOperationStatus> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getChildrenVertecies(parentVertex, edgeLabel, parseFlag); + } + + + @Test + public void testGetParentVertecies() throws Exception { + TitanDao testSubject; + GraphVertex parentVertex = null; + EdgeLabelEnum edgeLabel = null; + JsonParseFlagEnum parseFlag = null; + Either<List<GraphVertex>, TitanOperationStatus> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getParentVertecies(parentVertex, edgeLabel, parseFlag); + } + + + + + + + + + + + + + + + + + + + + + + + + + + + @Test + public void testUpdateVertexMetadataPropertiesWithJson() throws Exception { + TitanDao testSubject; + Vertex vertex = null; + Map<GraphPropertyEnum, Object> properties = null; + TitanOperationStatus result; + + // default test + testSubject = createTestSubject(); + result = testSubject.updateVertexMetadataPropertiesWithJson(vertex, properties); + } + + + + + + + + @Test + public void testGetProperty_1() throws Exception { + TitanDao testSubject; + Edge edge = null; + EdgePropertyEnum key = null; + Object result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getProperty(edge, key); + } + + + + + @Test + public void testGetBelongingEdgeByCriteria_1() throws Exception { + TitanDao testSubject; + String parentId = ""; + EdgeLabelEnum label = null; + Map<GraphPropertyEnum, Object> properties = null; + Either<Edge, TitanOperationStatus> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getBelongingEdgeByCriteria(parentId, label, properties); + } +}
\ No newline at end of file diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgeLabelEnumTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgeLabelEnumTest.java new file mode 100644 index 0000000000..6b50f6e806 --- /dev/null +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgeLabelEnumTest.java @@ -0,0 +1,34 @@ +package org.openecomp.sdc.be.dao.jsongraph.types; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class EdgeLabelEnumTest { + + private EdgeLabelEnum createTestSubject() { + return EdgeLabelEnum.ARTIFACTS; + } + + + @Test + public void testGetEdgeLabelEnum() throws Exception { + String name = ""; + EdgeLabelEnum result; + + // default test + result = EdgeLabelEnum.getEdgeLabelEnum(name); + } + + + @Test + public void testIsInstanceArtifactsLabel() throws Exception { + EdgeLabelEnum testSubject; + boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.isInstanceArtifactsLabel(); + } +}
\ No newline at end of file diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgePropertyEnumTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgePropertyEnumTest.java new file mode 100644 index 0000000000..544a9ce38b --- /dev/null +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/EdgePropertyEnumTest.java @@ -0,0 +1,34 @@ +package org.openecomp.sdc.be.dao.jsongraph.types; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class EdgePropertyEnumTest { + + private EdgePropertyEnum createTestSubject() { + return EdgePropertyEnum.STATE; + } + + + @Test + public void testGetProperty() throws Exception { + EdgePropertyEnum testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getProperty(); + } + + + @Test + public void testGetByProperty() throws Exception { + String property = ""; + EdgePropertyEnum result; + + // default test + result = EdgePropertyEnum.getByProperty(property); + } +}
\ No newline at end of file diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/VertexTypeEnumTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/VertexTypeEnumTest.java new file mode 100644 index 0000000000..ed924bda04 --- /dev/null +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/jsongraph/types/VertexTypeEnumTest.java @@ -0,0 +1,45 @@ +package org.openecomp.sdc.be.dao.jsongraph.types; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class VertexTypeEnumTest { + + private VertexTypeEnum createTestSubject() { + return VertexTypeEnum.ADDITIONAL_INFORMATION; + } + + + @Test + public void testGetName() throws Exception { + VertexTypeEnum testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getName(); + } + + + @Test + public void testGetClassOfJson() throws Exception { + VertexTypeEnum testSubject; + Class result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getClassOfJson(); + } + + + @Test + public void testGetByName() throws Exception { + String name = ""; + VertexTypeEnum result; + + // default test + result = VertexTypeEnum.getByName(name); + } +}
\ No newline at end of file diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/model/FacetedSearchFacetTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/model/FacetedSearchFacetTest.java new file mode 100644 index 0000000000..18dffacfe2 --- /dev/null +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/dao/model/FacetedSearchFacetTest.java @@ -0,0 +1,57 @@ +package org.openecomp.sdc.be.dao.model; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class FacetedSearchFacetTest { + + private FacetedSearchFacet createTestSubject() { + return new FacetedSearchFacet("", 0); + } + + + @Test + public void testGetFacetValue() throws Exception { + FacetedSearchFacet testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getFacetValue(); + } + + + @Test + public void testSetFacetValue() throws Exception { + FacetedSearchFacet testSubject; + String facetValue = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setFacetValue(facetValue); + } + + + @Test + public void testGetCount() throws Exception { + FacetedSearchFacet testSubject; + long result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getCount(); + } + + + @Test + public void testSetCount() throws Exception { + FacetedSearchFacet testSubject; + long count = 555; + + // default test + testSubject = createTestSubject(); + testSubject.setCount(count); + } +}
\ No newline at end of file diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/exception/ResourceDAOExceptionTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/exception/ResourceDAOExceptionTest.java new file mode 100644 index 0000000000..5424e712fc --- /dev/null +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/exception/ResourceDAOExceptionTest.java @@ -0,0 +1,36 @@ +package org.openecomp.sdc.be.resources.exception; + +import javax.annotation.Generated; + +import org.junit.Test; +import org.openecomp.sdc.be.dao.api.ResourceUploadStatus; + + +public class ResourceDAOExceptionTest { + + private ResourceDAOException createTestSubject() { + return new ResourceDAOException("", null); + } + + + @Test + public void testGetStatus() throws Exception { + ResourceDAOException testSubject; + ResourceUploadStatus result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getStatus(); + } + + + @Test + public void testSetStatus() throws Exception { + ResourceDAOException testSubject; + ResourceUploadStatus status = null; + + // default test + testSubject = createTestSubject(); + testSubject.setStatus(status); + } +}
\ No newline at end of file diff --git a/catalog-fe/src/test/java/org/openecomp/sdc/fe/GzipFilterTest.java b/catalog-fe/src/test/java/org/openecomp/sdc/fe/GzipFilterTest.java new file mode 100644 index 0000000000..b91048dfa1 --- /dev/null +++ b/catalog-fe/src/test/java/org/openecomp/sdc/fe/GzipFilterTest.java @@ -0,0 +1,40 @@ +package org.openecomp.sdc.fe; + +import javax.annotation.Generated; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; + +import org.junit.Test; + + +public class GzipFilterTest { + + private GzipFilter createTestSubject() { + return new GzipFilter(); + } + + + + + @Test + public void testInit() throws Exception { + GzipFilter testSubject; + FilterConfig filterConfig = null; + + // default test + testSubject = createTestSubject(); + testSubject.init(filterConfig); + } + + + @Test + public void testDestroy() throws Exception { + GzipFilter testSubject; + + // default test + testSubject = createTestSubject(); + testSubject.destroy(); + } +}
\ No newline at end of file diff --git a/catalog-fe/src/test/java/org/openecomp/sdc/fe/client/BackendClientTest.java b/catalog-fe/src/test/java/org/openecomp/sdc/fe/client/BackendClientTest.java new file mode 100644 index 0000000000..d851899f59 --- /dev/null +++ b/catalog-fe/src/test/java/org/openecomp/sdc/fe/client/BackendClientTest.java @@ -0,0 +1,34 @@ +package org.openecomp.sdc.fe.client; + +import java.util.List; + +import javax.annotation.Generated; +import javax.net.ssl.HostnameVerifier; +import javax.ws.rs.container.AsyncResponse; + +import org.apache.http.client.methods.HttpPost; +import org.apache.http.impl.client.CloseableHttpClient; +import org.eclipse.jetty.http.HttpGenerator.ResponseInfo; +import org.junit.Test; +import org.openecomp.sdc.fe.impl.HttpRequestInfo; + + +public class BackendClientTest { + + private BackendClient createTestSubject() { + return new BackendClient("", "", ""); + } + + + @Test + public void testGetHostnameVerifier() throws Exception { + BackendClient testSubject; + HostnameVerifier result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getHostnameVerifier(); + } + + +}
\ No newline at end of file diff --git a/catalog-fe/src/test/java/org/openecomp/sdc/fe/listen/MyObjectMapperProviderTest.java b/catalog-fe/src/test/java/org/openecomp/sdc/fe/listen/MyObjectMapperProviderTest.java new file mode 100644 index 0000000000..a6885bfe1b --- /dev/null +++ b/catalog-fe/src/test/java/org/openecomp/sdc/fe/listen/MyObjectMapperProviderTest.java @@ -0,0 +1,30 @@ +package org.openecomp.sdc.fe.listen; + +import javax.annotation.Generated; + +import org.junit.Test; + +import com.fasterxml.jackson.databind.ObjectMapper; + + +public class MyObjectMapperProviderTest { + + private MyObjectMapperProvider createTestSubject() { + return new MyObjectMapperProvider(); + } + + + @Test + public void testGetContext() throws Exception { + MyObjectMapperProvider testSubject; + Class<?> type = null; + ObjectMapper result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getContext(type); + } + + + +}
\ No newline at end of file diff --git a/catalog-fe/src/test/java/org/openecomp/sdc/fe/servlets/PortalServletTest.java b/catalog-fe/src/test/java/org/openecomp/sdc/fe/servlets/PortalServletTest.java new file mode 100644 index 0000000000..25a7c6962d --- /dev/null +++ b/catalog-fe/src/test/java/org/openecomp/sdc/fe/servlets/PortalServletTest.java @@ -0,0 +1,35 @@ +package org.openecomp.sdc.fe.servlets; + +import java.util.List; + +import javax.annotation.Generated; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.junit.Test; +import org.openecomp.sdc.common.impl.MutableHttpServletRequest; + +import io.netty.handler.codec.http2.Http2FrameReader.Configuration; + + +public class PortalServletTest { + + private PortalServlet createTestSubject() { + return new PortalServlet(); + } + + + @Test + public void testDoGet() throws Exception { + PortalServlet testSubject; + HttpServletRequest request = null; + HttpServletResponse response = null; + + // default test + testSubject = createTestSubject(); + testSubject.doGet(request, response); + } + + + +}
\ No newline at end of file diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaElementOperationTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaElementOperationTest.java index 339023f9a4..806c22a8fb 100644 --- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaElementOperationTest.java +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaElementOperationTest.java @@ -1,7 +1,14 @@ package org.openecomp.sdc.be.model.jsontitan.operations; -import fj.data.Either; -import org.apache.cassandra.cql3.CQL3Type; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import org.junit.Before; import org.junit.BeforeClass; import org.junit.Rule; @@ -21,10 +28,7 @@ import org.openecomp.sdc.be.model.operations.api.StorageOperationStatus; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import java.util.*; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import fj.data.Either; /** * Created by chaya on 6/12/2017. diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/ToscaTypeTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/ToscaTypeTest.java new file mode 100644 index 0000000000..0cea40fcec --- /dev/null +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/tosca/ToscaTypeTest.java @@ -0,0 +1,67 @@ +package org.openecomp.sdc.be.model.tosca; + +import javax.annotation.Generated; + +import org.junit.Assert; +import org.junit.Test; + + +public class ToscaTypeTest { + + private ToscaType createTestSubject() { + return ToscaType.BOOLEAN; + } + + + @Test + public void testFromYamlTypeName() throws Exception { + String typeName = ""; + ToscaType result; + + // test 1 + typeName = null; + result = ToscaType.fromYamlTypeName(typeName); + Assert.assertEquals(null, result); + + // test 2 + typeName = ""; + result = ToscaType.fromYamlTypeName(typeName); + Assert.assertEquals(null, result); + } + + + @Test + public void testIsValidValue() throws Exception { + ToscaType testSubject; + String value = ""; + boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.isValidValue(value); + } + + + + @Test + public void testConvert() throws Exception { + ToscaType testSubject; + String value = ""; + Object result; + + // default test + testSubject = createTestSubject(); + result = testSubject.convert(value); + } + + + @Test + public void testToString() throws Exception { + ToscaType testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.toString(); + } +}
\ No newline at end of file diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiCategoriesTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiCategoriesTest.java new file mode 100644 index 0000000000..b57342f637 --- /dev/null +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiCategoriesTest.java @@ -0,0 +1,82 @@ +package org.openecomp.sdc.be.ui.model; + +import java.util.List; + +import javax.annotation.Generated; + +import org.junit.Test; +import org.openecomp.sdc.be.model.category.CategoryDefinition; + + +public class UiCategoriesTest { + + private UiCategories createTestSubject() { + return new UiCategories(); + } + + + @Test + public void testGetResourceCategories() throws Exception { + UiCategories testSubject; + List<CategoryDefinition> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getResourceCategories(); + } + + + @Test + public void testSetResourceCategories() throws Exception { + UiCategories testSubject; + List<CategoryDefinition> resourceCategories = null; + + // default test + testSubject = createTestSubject(); + testSubject.setResourceCategories(resourceCategories); + } + + + @Test + public void testGetServiceCategories() throws Exception { + UiCategories testSubject; + List<CategoryDefinition> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getServiceCategories(); + } + + + @Test + public void testSetServiceCategories() throws Exception { + UiCategories testSubject; + List<CategoryDefinition> serviceCategories = null; + + // default test + testSubject = createTestSubject(); + testSubject.setServiceCategories(serviceCategories); + } + + + @Test + public void testGetProductCategories() throws Exception { + UiCategories testSubject; + List<CategoryDefinition> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getProductCategories(); + } + + + @Test + public void testSetProductCategories() throws Exception { + UiCategories testSubject; + List<CategoryDefinition> productCategories = null; + + // default test + testSubject = createTestSubject(); + testSubject.setProductCategories(productCategories); + } +}
\ No newline at end of file diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiComponentDataTransferTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiComponentDataTransferTest.java new file mode 100644 index 0000000000..52767a2934 --- /dev/null +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiComponentDataTransferTest.java @@ -0,0 +1,446 @@ +package org.openecomp.sdc.be.ui.model; + +import java.util.List; +import java.util.Map; + +import javax.annotation.Generated; + +import org.junit.Test; +import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; +import org.openecomp.sdc.be.model.AdditionalInformationDefinition; +import org.openecomp.sdc.be.model.ArtifactDefinition; +import org.openecomp.sdc.be.model.CapabilityDefinition; +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.ComponentInstanceInput; +import org.openecomp.sdc.be.model.ComponentInstanceProperty; +import org.openecomp.sdc.be.model.GroupDefinition; +import org.openecomp.sdc.be.model.InputDefinition; +import org.openecomp.sdc.be.model.RequirementCapabilityRelDef; +import org.openecomp.sdc.be.model.RequirementDefinition; +import org.openecomp.sdc.be.model.category.CategoryDefinition; + + +public class UiComponentDataTransferTest { + + private UiComponentDataTransfer createTestSubject() { + return new UiComponentDataTransfer(); + } + + + @Test + public void testGetArtifacts() throws Exception { + UiComponentDataTransfer testSubject; + Map<String, ArtifactDefinition> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getArtifacts(); + } + + + @Test + public void testSetArtifacts() throws Exception { + UiComponentDataTransfer testSubject; + Map<String, ArtifactDefinition> artifacts = null; + + // default test + testSubject = createTestSubject(); + testSubject.setArtifacts(artifacts); + } + + + @Test + public void testGetDeploymentArtifacts() throws Exception { + UiComponentDataTransfer testSubject; + Map<String, ArtifactDefinition> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDeploymentArtifacts(); + } + + + @Test + public void testSetDeploymentArtifacts() throws Exception { + UiComponentDataTransfer testSubject; + Map<String, ArtifactDefinition> deploymentArtifacts = null; + + // default test + testSubject = createTestSubject(); + testSubject.setDeploymentArtifacts(deploymentArtifacts); + } + + + @Test + public void testGetToscaArtifacts() throws Exception { + UiComponentDataTransfer testSubject; + Map<String, ArtifactDefinition> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getToscaArtifacts(); + } + + + @Test + public void testSetToscaArtifacts() throws Exception { + UiComponentDataTransfer testSubject; + Map<String, ArtifactDefinition> toscaArtifacts = null; + + // default test + testSubject = createTestSubject(); + testSubject.setToscaArtifacts(toscaArtifacts); + } + + + @Test + public void testGetCategories() throws Exception { + UiComponentDataTransfer testSubject; + List<CategoryDefinition> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getCategories(); + } + + + @Test + public void testSetCategories() throws Exception { + UiComponentDataTransfer testSubject; + List<CategoryDefinition> categories = null; + + // default test + testSubject = createTestSubject(); + testSubject.setCategories(categories); + } + + + @Test + public void testGetCreatorUserId() throws Exception { + UiComponentDataTransfer testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getCreatorUserId(); + } + + + @Test + public void testSetCreatorUserId() throws Exception { + UiComponentDataTransfer testSubject; + String creatorUserId = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setCreatorUserId(creatorUserId); + } + + + @Test + public void testGetCreatorFullName() throws Exception { + UiComponentDataTransfer testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getCreatorFullName(); + } + + + @Test + public void testSetCreatorFullName() throws Exception { + UiComponentDataTransfer testSubject; + String creatorFullName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setCreatorFullName(creatorFullName); + } + + + @Test + public void testGetLastUpdaterUserId() throws Exception { + UiComponentDataTransfer testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getLastUpdaterUserId(); + } + + + @Test + public void testSetLastUpdaterUserId() throws Exception { + UiComponentDataTransfer testSubject; + String lastUpdaterUserId = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setLastUpdaterUserId(lastUpdaterUserId); + } + + + @Test + public void testGetLastUpdaterFullName() throws Exception { + UiComponentDataTransfer testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getLastUpdaterFullName(); + } + + + @Test + public void testSetLastUpdaterFullName() throws Exception { + UiComponentDataTransfer testSubject; + String lastUpdaterFullName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setLastUpdaterFullName(lastUpdaterFullName); + } + + + @Test + public void testGetComponentType() throws Exception { + UiComponentDataTransfer testSubject; + ComponentTypeEnum result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getComponentType(); + } + + + @Test + public void testSetComponentType() throws Exception { + UiComponentDataTransfer testSubject; + ComponentTypeEnum componentType = null; + + // default test + testSubject = createTestSubject(); + testSubject.setComponentType(componentType); + } + + + @Test + public void testGetComponentInstances() throws Exception { + UiComponentDataTransfer testSubject; + List<ComponentInstance> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getComponentInstances(); + } + + + @Test + public void testSetComponentInstances() throws Exception { + UiComponentDataTransfer testSubject; + List<ComponentInstance> componentInstances = null; + + // default test + testSubject = createTestSubject(); + testSubject.setComponentInstances(componentInstances); + } + + + @Test + public void testGetComponentInstancesRelations() throws Exception { + UiComponentDataTransfer testSubject; + List<RequirementCapabilityRelDef> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getComponentInstancesRelations(); + } + + + @Test + public void testSetComponentInstancesRelations() throws Exception { + UiComponentDataTransfer testSubject; + List<RequirementCapabilityRelDef> componentInstancesRelations = null; + + // default test + testSubject = createTestSubject(); + testSubject.setComponentInstancesRelations(componentInstancesRelations); + } + + + @Test + public void testGetComponentInstancesInputs() throws Exception { + UiComponentDataTransfer testSubject; + Map<String, List<ComponentInstanceInput>> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getComponentInstancesInputs(); + } + + + @Test + public void testSetComponentInstancesInputs() throws Exception { + UiComponentDataTransfer testSubject; + Map<String, List<ComponentInstanceInput>> componentInstancesInputs = null; + + // default test + testSubject = createTestSubject(); + testSubject.setComponentInstancesInputs(componentInstancesInputs); + } + + + @Test + public void testGetComponentInstancesProperties() throws Exception { + UiComponentDataTransfer testSubject; + Map<String, List<ComponentInstanceProperty>> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getComponentInstancesProperties(); + } + + + @Test + public void testSetComponentInstancesProperties() throws Exception { + UiComponentDataTransfer testSubject; + Map<String, List<ComponentInstanceProperty>> componentInstancesProperties = null; + + // default test + testSubject = createTestSubject(); + testSubject.setComponentInstancesProperties(componentInstancesProperties); + } + + + @Test + public void testGetComponentInstancesAttributes() throws Exception { + UiComponentDataTransfer testSubject; + Map<String, List<ComponentInstanceProperty>> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getComponentInstancesAttributes(); + } + + + @Test + public void testSetComponentInstancesAttributes() throws Exception { + UiComponentDataTransfer testSubject; + Map<String, List<ComponentInstanceProperty>> componentInstancesAttributes = null; + + // default test + testSubject = createTestSubject(); + testSubject.setComponentInstancesAttributes(componentInstancesAttributes); + } + + + @Test + public void testGetCapabilities() throws Exception { + UiComponentDataTransfer testSubject; + Map<String, List<CapabilityDefinition>> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getCapabilities(); + } + + + @Test + public void testSetCapabilities() throws Exception { + UiComponentDataTransfer testSubject; + Map<String, List<CapabilityDefinition>> capabilities = null; + + // default test + testSubject = createTestSubject(); + testSubject.setCapabilities(capabilities); + } + + + @Test + public void testGetRequirements() throws Exception { + UiComponentDataTransfer testSubject; + Map<String, List<RequirementDefinition>> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getRequirements(); + } + + + @Test + public void testSetRequirements() throws Exception { + UiComponentDataTransfer testSubject; + Map<String, List<RequirementDefinition>> requirements = null; + + // default test + testSubject = createTestSubject(); + testSubject.setRequirements(requirements); + } + + + @Test + public void testGetInputs() throws Exception { + UiComponentDataTransfer testSubject; + List<InputDefinition> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getInputs(); + } + + + @Test + public void testSetInputs() throws Exception { + UiComponentDataTransfer testSubject; + List<InputDefinition> inputs = null; + + // default test + testSubject = createTestSubject(); + testSubject.setInputs(inputs); + } + + + @Test + public void testGetGroups() throws Exception { + UiComponentDataTransfer testSubject; + List<GroupDefinition> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getGroups(); + } + + + @Test + public void testSetGroups() throws Exception { + UiComponentDataTransfer testSubject; + List<GroupDefinition> groups = null; + + // default test + testSubject = createTestSubject(); + testSubject.setGroups(groups); + } + + + @Test + public void testGetAdditionalInformation() throws Exception { + UiComponentDataTransfer testSubject; + List<AdditionalInformationDefinition> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getAdditionalInformation(); + } + + + @Test + public void testSetAdditionalInformation() throws Exception { + UiComponentDataTransfer testSubject; + List<AdditionalInformationDefinition> additionalInformation = null; + + // default test + testSubject = createTestSubject(); + testSubject.setAdditionalInformation(additionalInformation); + } +}
\ No newline at end of file diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiResourceDataTransferTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiResourceDataTransferTest.java new file mode 100644 index 0000000000..040b94520f --- /dev/null +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiResourceDataTransferTest.java @@ -0,0 +1,195 @@ +package org.openecomp.sdc.be.ui.model; + +import java.util.List; +import java.util.Map; + +import javax.annotation.Generated; + +import org.junit.Test; +import org.openecomp.sdc.be.model.AdditionalInformationDefinition; +import org.openecomp.sdc.be.model.InterfaceDefinition; +import org.openecomp.sdc.be.model.PropertyDefinition; + + +public class UiResourceDataTransferTest { + + private UiResourceDataTransfer createTestSubject() { + return new UiResourceDataTransfer(); + } + + + @Test + public void testGetAdditionalInformation() throws Exception { + UiResourceDataTransfer testSubject; + List<AdditionalInformationDefinition> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getAdditionalInformation(); + } + + + @Test + public void testSetAdditionalInformation() throws Exception { + UiResourceDataTransfer testSubject; + List<AdditionalInformationDefinition> additionalInformation = null; + + // default test + testSubject = createTestSubject(); + testSubject.setAdditionalInformation(additionalInformation); + } + + + @Test + public void testGetMetadata() throws Exception { + UiResourceDataTransfer testSubject; + UiResourceMetadata result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getMetadata(); + } + + + @Test + public void testSetMetadata() throws Exception { + UiResourceDataTransfer testSubject; + UiResourceMetadata metadata = null; + + // default test + testSubject = createTestSubject(); + testSubject.setMetadata(metadata); + } + + + @Test + public void testGetDerivedFrom() throws Exception { + UiResourceDataTransfer testSubject; + List<String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDerivedFrom(); + } + + + @Test + public void testSetDerivedFrom() throws Exception { + UiResourceDataTransfer testSubject; + List<String> derivedFrom = null; + + // default test + testSubject = createTestSubject(); + testSubject.setDerivedFrom(derivedFrom); + } + + + @Test + public void testGetDerivedList() throws Exception { + UiResourceDataTransfer testSubject; + List<String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDerivedList(); + } + + + @Test + public void testSetDerivedList() throws Exception { + UiResourceDataTransfer testSubject; + List<String> derivedList = null; + + // default test + testSubject = createTestSubject(); + testSubject.setDerivedList(derivedList); + } + + + @Test + public void testGetProperties() throws Exception { + UiResourceDataTransfer testSubject; + List<PropertyDefinition> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getProperties(); + } + + + @Test + public void testSetProperties() throws Exception { + UiResourceDataTransfer testSubject; + List<PropertyDefinition> properties = null; + + // default test + testSubject = createTestSubject(); + testSubject.setProperties(properties); + } + + + @Test + public void testGetAttributes() throws Exception { + UiResourceDataTransfer testSubject; + List<PropertyDefinition> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getAttributes(); + } + + + @Test + public void testSetAttributes() throws Exception { + UiResourceDataTransfer testSubject; + List<PropertyDefinition> attributes = null; + + // default test + testSubject = createTestSubject(); + testSubject.setAttributes(attributes); + } + + + @Test + public void testGetInterfaces() throws Exception { + UiResourceDataTransfer testSubject; + Map<String, InterfaceDefinition> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getInterfaces(); + } + + + @Test + public void testSetInterfaces() throws Exception { + UiResourceDataTransfer testSubject; + Map<String, InterfaceDefinition> interfaces = null; + + // default test + testSubject = createTestSubject(); + testSubject.setInterfaces(interfaces); + } + + + @Test + public void testGetDefaultCapabilities() throws Exception { + UiResourceDataTransfer testSubject; + List<String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDefaultCapabilities(); + } + + + @Test + public void testSetDefaultCapabilities() throws Exception { + UiResourceDataTransfer testSubject; + List<String> defaultCapabilities = null; + + // default test + testSubject = createTestSubject(); + testSubject.setDefaultCapabilities(defaultCapabilities); + } +}
\ No newline at end of file diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiResourceMetadataTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiResourceMetadataTest.java new file mode 100644 index 0000000000..9248b4d176 --- /dev/null +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiResourceMetadataTest.java @@ -0,0 +1,215 @@ +package org.openecomp.sdc.be.ui.model; + +import java.util.List; + +import javax.annotation.Generated; + +import org.junit.Test; +import org.openecomp.sdc.be.datatypes.components.ResourceMetadataDataDefinition; +import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; + + +public class UiResourceMetadataTest { + + private UiResourceMetadata createTestSubject() { + return new UiResourceMetadata(null, null, new ResourceMetadataDataDefinition()); + } + + + @Test + public void testGetDerivedFrom() throws Exception { + UiResourceMetadata testSubject; + List<String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDerivedFrom(); + } + + + @Test + public void testSetDerivedFrom() throws Exception { + UiResourceMetadata testSubject; + List<String> derivedFrom = null; + + // default test + testSubject = createTestSubject(); + testSubject.setDerivedFrom(derivedFrom); + } + + + @Test + public void testGetVendorName() throws Exception { + UiResourceMetadata testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getVendorName(); + } + + + @Test + public void testSetVendorName() throws Exception { + UiResourceMetadata testSubject; + String vendorName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setVendorName(vendorName); + } + + + @Test + public void testGetVendorRelease() throws Exception { + UiResourceMetadata testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getVendorRelease(); + } + + + @Test + public void testSetVendorRelease() throws Exception { + UiResourceMetadata testSubject; + String vendorRelease = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setVendorRelease(vendorRelease); + } + + + @Test + public void testGetResourceVendorModelNumber() throws Exception { + UiResourceMetadata testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getResourceVendorModelNumber(); + } + + + @Test + public void testSetResourceVendorModelNumber() throws Exception { + UiResourceMetadata testSubject; + String resourceVendorModelNumber = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setResourceVendorModelNumber(resourceVendorModelNumber); + } + + + @Test + public void testGetResourceType() throws Exception { + UiResourceMetadata testSubject; + ResourceTypeEnum result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getResourceType(); + } + + + @Test + public void testSetResourceType() throws Exception { + UiResourceMetadata testSubject; + ResourceTypeEnum resourceType = null; + + // default test + testSubject = createTestSubject(); + testSubject.setResourceType(resourceType); + } + + + @Test + public void testGetIsAbstract() throws Exception { + UiResourceMetadata testSubject; + Boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getIsAbstract(); + } + + + @Test + public void testSetIsAbstract() throws Exception { + UiResourceMetadata testSubject; + Boolean isAbstract = null; + + // default test + testSubject = createTestSubject(); + testSubject.setIsAbstract(isAbstract); + } + + + @Test + public void testGetCost() throws Exception { + UiResourceMetadata testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getCost(); + } + + + @Test + public void testSetCost() throws Exception { + UiResourceMetadata testSubject; + String cost = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setCost(cost); + } + + + @Test + public void testGetLicenseType() throws Exception { + UiResourceMetadata testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getLicenseType(); + } + + + @Test + public void testSetLicenseType() throws Exception { + UiResourceMetadata testSubject; + String licenseType = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setLicenseType(licenseType); + } + + + @Test + public void testGetToscaResourceName() throws Exception { + UiResourceMetadata testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getToscaResourceName(); + } + + + @Test + public void testSetToscaResourceName() throws Exception { + UiResourceMetadata testSubject; + String toscaResourceName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setToscaResourceName(toscaResourceName); + } +}
\ No newline at end of file diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiServiceDataTransferTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiServiceDataTransferTest.java new file mode 100644 index 0000000000..83a1281172 --- /dev/null +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiServiceDataTransferTest.java @@ -0,0 +1,60 @@ +package org.openecomp.sdc.be.ui.model; + +import java.util.Map; + +import javax.annotation.Generated; + +import org.junit.Test; +import org.openecomp.sdc.be.model.ArtifactDefinition; + + +public class UiServiceDataTransferTest { + + private UiServiceDataTransfer createTestSubject() { + return new UiServiceDataTransfer(); + } + + + @Test + public void testGetMetadata() throws Exception { + UiServiceDataTransfer testSubject; + UiServiceMetadata result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getMetadata(); + } + + + @Test + public void testSetMetadata() throws Exception { + UiServiceDataTransfer testSubject; + UiServiceMetadata metadata = null; + + // default test + testSubject = createTestSubject(); + testSubject.setMetadata(metadata); + } + + + @Test + public void testGetServiceApiArtifacts() throws Exception { + UiServiceDataTransfer testSubject; + Map<String, ArtifactDefinition> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getServiceApiArtifacts(); + } + + + @Test + public void testSetServiceApiArtifacts() throws Exception { + UiServiceDataTransfer testSubject; + Map<String, ArtifactDefinition> serviceApiArtifacts = null; + + // default test + testSubject = createTestSubject(); + testSubject.setServiceApiArtifacts(serviceApiArtifacts); + } +}
\ No newline at end of file diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiServiceMetadataTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiServiceMetadataTest.java new file mode 100644 index 0000000000..1d203b1ce3 --- /dev/null +++ b/catalog-model/src/test/java/org/openecomp/sdc/be/ui/model/UiServiceMetadataTest.java @@ -0,0 +1,124 @@ +package org.openecomp.sdc.be.ui.model; + +import javax.annotation.Generated; + +import org.junit.Test; +import org.openecomp.sdc.be.datatypes.components.ServiceMetadataDataDefinition; + + +public class UiServiceMetadataTest { + + private UiServiceMetadata createTestSubject() { + return new UiServiceMetadata(null, new ServiceMetadataDataDefinition()); + } + + + @Test + public void testGetDistributionStatus() throws Exception { + UiServiceMetadata testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDistributionStatus(); + } + + + @Test + public void testSetDistributionStatus() throws Exception { + UiServiceMetadata testSubject; + String distributionStatus = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setDistributionStatus(distributionStatus); + } + + + @Test + public void testGetEcompGeneratedNaming() throws Exception { + UiServiceMetadata testSubject; + Boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getEcompGeneratedNaming(); + } + + + @Test + public void testSetEcompGeneratedNaming() throws Exception { + UiServiceMetadata testSubject; + Boolean ecompGeneratedNaming = null; + + // default test + testSubject = createTestSubject(); + testSubject.setEcompGeneratedNaming(ecompGeneratedNaming); + } + + + @Test + public void testGetNamingPolicy() throws Exception { + UiServiceMetadata testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getNamingPolicy(); + } + + + @Test + public void testSetNamingPolicy() throws Exception { + UiServiceMetadata testSubject; + String namingPolicy = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setNamingPolicy(namingPolicy); + } + + + @Test + public void testGetServiceType() throws Exception { + UiServiceMetadata testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getServiceType(); + } + + + @Test + public void testSetServiceType() throws Exception { + UiServiceMetadata testSubject; + String serviceType = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setServiceType(serviceType); + } + + + @Test + public void testGetServiceRole() throws Exception { + UiServiceMetadata testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getServiceRole(); + } + + + @Test + public void testSetServiceRole() throws Exception { + UiServiceMetadata testSubject; + String serviceRole = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setServiceRole(serviceRole); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/be/config/BeEcompErrorManagerTest.java b/common-app-api/src/test/java/org/openecomp/sdc/be/config/BeEcompErrorManagerTest.java new file mode 100644 index 0000000000..592ab058b0 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/be/config/BeEcompErrorManagerTest.java @@ -0,0 +1,735 @@ +package org.openecomp.sdc.be.config; + +import javax.annotation.Generated; + +import org.junit.Test; +import org.openecomp.sdc.be.config.BeEcompErrorManager.ErrorSeverity; +import org.openecomp.sdc.common.config.IEcompConfigurationManager; + + +public class BeEcompErrorManagerTest { + + private BeEcompErrorManager createTestSubject() { + return BeEcompErrorManager.getInstance(); + } + + + @Test + public void testGetInstance() throws Exception { + BeEcompErrorManager result; + + // default test + result = BeEcompErrorManager.getInstance(); + } + + + + + @Test + public void testGetConfigurationManager() throws Exception { + BeEcompErrorManager testSubject; + IEcompConfigurationManager result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getConfigurationManager(); + } + + + @Test + public void testLogBeUebAuthenticationError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String reason = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeUebAuthenticationError(context, reason); + } + + + @Test + public void testLogBeHealthCheckRecovery() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeHealthCheckRecovery(context); + } + + + @Test + public void testLogBeHealthCheckTitanRecovery() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeHealthCheckTitanRecovery(context); + } + + + @Test + public void testLogBeHealthCheckElasticSearchRecovery() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeHealthCheckElasticSearchRecovery(context); + } + + + @Test + public void testLogBeHealthCheckUebClusterRecovery() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeHealthCheckUebClusterRecovery(context); + } + + + @Test + public void testLogFeHealthCheckRecovery() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logFeHealthCheckRecovery(context); + } + + + @Test + public void testLogBeHealthCheckError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeHealthCheckError(context); + } + + + @Test + public void testLogBeHealthCheckTitanError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeHealthCheckTitanError(context); + } + + + @Test + public void testLogBeHealthCheckElasticSearchError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeHealthCheckElasticSearchError(context); + } + + + @Test + public void testLogBeHealthCheckUebClusterError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeHealthCheckUebClusterError(context); + } + + + @Test + public void testLogFeHealthCheckError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logFeHealthCheckError(context); + } + + + @Test + public void testLogBeUebConnectionError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String reason = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeUebConnectionError(context, reason); + } + + + @Test + public void testLogBeUebUnkownHostError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String host = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeUebUnkownHostError(context, host); + } + + + @Test + public void testLogBeComponentMissingError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String componentType = ""; + String name = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeComponentMissingError(context, componentType, name); + } + + + @Test + public void testLogBeIncorrectComponentError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String componentType = ""; + String name = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeIncorrectComponentError(context, componentType, name); + } + + + @Test + public void testLogBeInvalidConfigurationError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String parameterName = ""; + String parameterValue = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeInvalidConfigurationError(context, parameterName, parameterValue); + } + + + @Test + public void testLogBeUebObjectNotFoundError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String notFoundObjectName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeUebObjectNotFoundError(context, notFoundObjectName); + } + + + @Test + public void testLogBeDistributionEngineInvalidArtifactType() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String artifactType = ""; + String validArtifactTypes = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeDistributionEngineInvalidArtifactType(context, artifactType, validArtifactTypes); + } + + + @Test + public void testLogBeMissingConfigurationError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String parameterName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeMissingConfigurationError(context, parameterName); + } + + + @Test + public void testLogBeConfigurationInvalidListSizeError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String parameterName = ""; + int listMinimumSize = 0; + + // default test + testSubject = createTestSubject(); + testSubject.logBeConfigurationInvalidListSizeError(context, parameterName, listMinimumSize); + } + + + @Test + public void testLogErrorConfigFileFormat() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String description = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logErrorConfigFileFormat(context, description); + } + + + @Test + public void testLogBeMissingArtifactInformationError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String missingInfo = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeMissingArtifactInformationError(context, missingInfo); + } + + + @Test + public void testLogBeArtifactMissingError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String artifactName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeArtifactMissingError(context, artifactName); + } + + + @Test + public void testLogBeUserMissingError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String userId = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeUserMissingError(context, userId); + } + + + @Test + public void testLogBeInvalidTypeError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String type = ""; + String name = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeInvalidTypeError(context, type, name); + } + + + @Test + public void testLogBeInvalidValueError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String value = ""; + String name = ""; + String type = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeInvalidValueError(context, value, name, type); + } + + + @Test + public void testLogBeArtifactPayloadInvalid() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeArtifactPayloadInvalid(context); + } + + + @Test + public void testLogBeArtifactInformationInvalidError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeArtifactInformationInvalidError(context); + } + + + @Test + public void testLogBeDistributionMissingError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String distributionName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeDistributionMissingError(context, distributionName); + } + + + @Test + public void testLogBeGraphObjectMissingError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String objectType = ""; + String objectName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeGraphObjectMissingError(context, objectType, objectName); + } + + + @Test + public void testLogBeInvalidJsonInput() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeInvalidJsonInput(context); + } + + + @Test + public void testLogBeInitializationError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeInitializationError(context); + } + + + @Test + public void testLogBeFailedAddingResourceInstanceError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String resourceName = ""; + String serviceId = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeFailedAddingResourceInstanceError(context, resourceName, serviceId); + } + + + @Test + public void testLogBeUebSystemError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String operation = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeUebSystemError(context, operation); + } + + + @Test + public void testLogBeDistributionEngineSystemError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String operation = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeDistributionEngineSystemError(context, operation); + } + + + @Test + public void testLogBeFailedAddingNodeTypeError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String nodeType = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeFailedAddingNodeTypeError(context, nodeType); + } + + + @Test + public void testLogBeDaoSystemError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeDaoSystemError(context); + } + + + @Test + public void testLogBeSystemError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeSystemError(context); + } + + + @Test + public void testLogBeExecuteRollbackError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeExecuteRollbackError(context); + } + + + @Test + public void testLogBeFailedLockObjectError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String type = ""; + String id = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeFailedLockObjectError(context, type, id); + } + + + @Test + public void testLogBeFailedCreateNodeError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String nodeName = ""; + String status = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeFailedCreateNodeError(context, nodeName, status); + } + + + @Test + public void testLogBeFailedUpdateNodeError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String nodeName = ""; + String status = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeFailedUpdateNodeError(context, nodeName, status); + } + + + @Test + public void testLogBeFailedDeleteNodeError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String nodeName = ""; + String status = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeFailedDeleteNodeError(context, nodeName, status); + } + + + @Test + public void testLogBeFailedRetrieveNodeError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String nodeName = ""; + String status = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeFailedRetrieveNodeError(context, nodeName, status); + } + + + @Test + public void testLogBeFailedFindParentError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String node = ""; + String status = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeFailedFindParentError(context, node, status); + } + + + @Test + public void testLogBeFailedFindAllNodesError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String nodeType = ""; + String parentNode = ""; + String status = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeFailedFindAllNodesError(context, nodeType, parentNode, status); + } + + + @Test + public void testLogBeFailedFindAssociationError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String nodeType = ""; + String fromNode = ""; + String status = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeFailedFindAssociationError(context, nodeType, fromNode, status); + } + + + @Test + public void testLogBeComponentCleanerSystemError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String operation = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeComponentCleanerSystemError(context, operation); + } + + + @Test + public void testLogBeRestApiGeneralError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logBeRestApiGeneralError(context); + } + + + @Test + public void testLogFqdnResolveError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String description = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logFqdnResolveError(context, description); + } + + + @Test + public void testLogSiteSwitchoverInfo() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String description = ""; + + // default test + testSubject = createTestSubject(); + testSubject.logSiteSwitchoverInfo(context, description); + } + + + @Test + public void testLogInternalAuthenticationError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String description = ""; + ErrorSeverity severity = null; + + // test 1 + testSubject = createTestSubject(); + severity = null; + testSubject.logInternalAuthenticationError(context, description, severity); + } + + + @Test + public void testLogInternalConnectionError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String description = ""; + ErrorSeverity severity = null; + + // test 1 + testSubject = createTestSubject(); + severity = null; + testSubject.logInternalConnectionError(context, description, severity); + } + + + @Test + public void testLogInternalDataError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String description = ""; + ErrorSeverity severity = null; + + // test 1 + testSubject = createTestSubject(); + severity = null; + testSubject.logInternalDataError(context, description, severity); + } + + + @Test + public void testLogInvalidInputError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String description = ""; + ErrorSeverity severity = null; + + // test 1 + testSubject = createTestSubject(); + severity = null; + testSubject.logInvalidInputError(context, description, severity); + } + + + @Test + public void testLogInternalFlowError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String description = ""; + ErrorSeverity severity = null; + + // test 1 + testSubject = createTestSubject(); + severity = null; + testSubject.logInternalFlowError(context, description, severity); + } + + + @Test + public void testLogInternalUnexpectedError() throws Exception { + BeEcompErrorManager testSubject; + String context = ""; + String description = ""; + ErrorSeverity severity = null; + + // test 1 + testSubject = createTestSubject(); + severity = null; + testSubject.logInternalUnexpectedError(context, description, severity); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/be/config/CleanComponentsConfigurationTest.java b/common-app-api/src/test/java/org/openecomp/sdc/be/config/CleanComponentsConfigurationTest.java new file mode 100644 index 0000000000..86c78b236e --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/be/config/CleanComponentsConfigurationTest.java @@ -0,0 +1,51 @@ +package org.openecomp.sdc.be.config; + +import java.util.List; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class CleanComponentsConfigurationTest { + + private CleanComponentsConfiguration createTestSubject() { + return new CleanComponentsConfiguration(); + } + + + @Test + public void testGetCleanIntervalInMinutes() throws Exception { + CleanComponentsConfiguration testSubject; + long result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getCleanIntervalInMinutes(); + } + + + + + + @Test + public void testGetComponentsToClean() throws Exception { + CleanComponentsConfiguration testSubject; + List<String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getComponentsToClean(); + } + + + @Test + public void testSetComponentsToClean() throws Exception { + CleanComponentsConfiguration testSubject; + List<String> componentsToClean = null; + + // default test + testSubject = createTestSubject(); + testSubject.setComponentsToClean(componentsToClean); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/be/config/ConfigurationTest.java b/common-app-api/src/test/java/org/openecomp/sdc/be/config/ConfigurationTest.java new file mode 100644 index 0000000000..5b98270ee9 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/be/config/ConfigurationTest.java @@ -0,0 +1,1455 @@ +package org.openecomp.sdc.be.config; + +import java.util.Date; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.annotation.Generated; + +import org.junit.Test; +import org.openecomp.sdc.be.config.Configuration.ApplicationL1CacheConfig; +import org.openecomp.sdc.be.config.Configuration.ApplicationL2CacheConfig; +import org.openecomp.sdc.be.config.Configuration.ArtifactTypeConfig; +import org.openecomp.sdc.be.config.Configuration.BeMonitoringConfig; +import org.openecomp.sdc.be.config.Configuration.CassandrConfig; +import org.openecomp.sdc.be.config.Configuration.EcompPortalConfig; +import org.openecomp.sdc.be.config.Configuration.ElasticSearchConfig; +import org.openecomp.sdc.be.config.Configuration.OnboardingConfig; +import org.openecomp.sdc.be.config.Configuration.SwitchoverDetectorConfig; +import org.openecomp.sdc.be.config.Configuration.ToscaValidatorsConfig; +import org.openecomp.sdc.be.config.Configuration.VfModuleProperty; + + +public class ConfigurationTest { + + private Configuration createTestSubject() { + return new Configuration(); + } + + + @Test + public void testGetGenericAssetNodeTypes() throws Exception { + Configuration testSubject; + Map<String, String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getGenericAssetNodeTypes(); + } + + + @Test + public void testSetGenericAssetNodeTypes() throws Exception { + Configuration testSubject; + Map<String, String> genericAssetNodeTypes = null; + + // default test + testSubject = createTestSubject(); + testSubject.setGenericAssetNodeTypes(genericAssetNodeTypes); + } + + + @Test + public void testGetSwitchoverDetector() throws Exception { + Configuration testSubject; + SwitchoverDetectorConfig result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getSwitchoverDetector(); + } + + + @Test + public void testSetSwitchoverDetector() throws Exception { + Configuration testSubject; + SwitchoverDetectorConfig switchoverDetector = null; + + // default test + testSubject = createTestSubject(); + testSubject.setSwitchoverDetector(switchoverDetector); + } + + + @Test + public void testGetApplicationL1Cache() throws Exception { + Configuration testSubject; + ApplicationL1CacheConfig result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getApplicationL1Cache(); + } + + + @Test + public void testSetApplicationL1Cache() throws Exception { + Configuration testSubject; + ApplicationL1CacheConfig applicationL1Cache = null; + + // default test + testSubject = createTestSubject(); + testSubject.setApplicationL1Cache(applicationL1Cache); + } + + + @Test + public void testGetApplicationL2Cache() throws Exception { + Configuration testSubject; + ApplicationL2CacheConfig result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getApplicationL2Cache(); + } + + + @Test + public void testSetApplicationL2Cache() throws Exception { + Configuration testSubject; + ApplicationL2CacheConfig applicationL2Cache = null; + + // default test + testSubject = createTestSubject(); + testSubject.setApplicationL2Cache(applicationL2Cache); + } + + + @Test + public void testGetCassandraConfig() throws Exception { + Configuration testSubject; + CassandrConfig result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getCassandraConfig(); + } + + + @Test + public void testSetCassandraConfig() throws Exception { + Configuration testSubject; + CassandrConfig cassandraKeySpace = null; + + // default test + testSubject = createTestSubject(); + testSubject.setCassandraConfig(cassandraKeySpace); + } + + + @Test + public void testGetIdentificationHeaderFields() throws Exception { + Configuration testSubject; + List<String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getIdentificationHeaderFields(); + } + + + @Test + public void testSetIdentificationHeaderFields() throws Exception { + Configuration testSubject; + List<String> identificationHeaderFields = null; + + // default test + testSubject = createTestSubject(); + testSubject.setIdentificationHeaderFields(identificationHeaderFields); + } + + + @Test + public void testGetReleased() throws Exception { + Configuration testSubject; + Date result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getReleased(); + } + + + @Test + public void testGetVersion() throws Exception { + Configuration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getVersion(); + } + + + @Test + public void testSetReleased() throws Exception { + Configuration testSubject; + Date released = null; + + // default test + testSubject = createTestSubject(); + testSubject.setReleased(released); + } + + + @Test + public void testSetVersion() throws Exception { + Configuration testSubject; + String version = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setVersion(version); + } + + + @Test + public void testGetProtocols() throws Exception { + Configuration testSubject; + List<String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getProtocols(); + } + + + @Test + public void testSetProtocols() throws Exception { + Configuration testSubject; + List<String> protocols = null; + + // default test + testSubject = createTestSubject(); + testSubject.setProtocols(protocols); + } + + + @Test + public void testGetUsers() throws Exception { + Configuration testSubject; + Map<String, String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getUsers(); + } + + + @Test + public void testSetUsers() throws Exception { + Configuration testSubject; + Map<String, String> users = null; + + // default test + testSubject = createTestSubject(); + testSubject.setUsers(users); + } + + + @Test + public void testGetBeFqdn() throws Exception { + Configuration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getBeFqdn(); + } + + + @Test + public void testSetBeFqdn() throws Exception { + Configuration testSubject; + String beHost = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setBeFqdn(beHost); + } + + + @Test + public void testGetBeHttpPort() throws Exception { + Configuration testSubject; + Integer result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getBeHttpPort(); + } + + + @Test + public void testSetBeHttpPort() throws Exception { + Configuration testSubject; + Integer beHttpPort = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setBeHttpPort(beHttpPort); + } + + + @Test + public void testGetBeSslPort() throws Exception { + Configuration testSubject; + Integer result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getBeSslPort(); + } + + + @Test + public void testSetBeSslPort() throws Exception { + Configuration testSubject; + Integer beSslPort = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setBeSslPort(beSslPort); + } + + + @Test + public void testGetBeContext() throws Exception { + Configuration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getBeContext(); + } + + + @Test + public void testSetBeContext() throws Exception { + Configuration testSubject; + String beContext = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setBeContext(beContext); + } + + + @Test + public void testGetBeProtocol() throws Exception { + Configuration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getBeProtocol(); + } + + + @Test + public void testSetBeProtocol() throws Exception { + Configuration testSubject; + String beProtocol = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setBeProtocol(beProtocol); + } + + + @Test + public void testGetNeo4j() throws Exception { + Configuration testSubject; + Map<String, Object> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getNeo4j(); + } + + + @Test + public void testSetNeo4j() throws Exception { + Configuration testSubject; + Map<String, Object> neo4j = null; + + // default test + testSubject = createTestSubject(); + testSubject.setNeo4j(neo4j); + } + + + @Test + public void testGetElasticSearch() throws Exception { + Configuration testSubject; + ElasticSearchConfig result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getElasticSearch(); + } + + + @Test + public void testSetElasticSearch() throws Exception { + Configuration testSubject; + ElasticSearchConfig elasticSearch = null; + + // default test + testSubject = createTestSubject(); + testSubject.setElasticSearch(elasticSearch); + } + + + @Test + public void testGetTitanCfgFile() throws Exception { + Configuration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getTitanCfgFile(); + } + + + @Test + public void testSetTitanCfgFile() throws Exception { + Configuration testSubject; + String titanCfgFile = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setTitanCfgFile(titanCfgFile); + } + + + @Test + public void testGetTitanMigrationKeySpaceCfgFile() throws Exception { + Configuration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getTitanMigrationKeySpaceCfgFile(); + } + + + @Test + public void testSetTitanMigrationKeySpaceCfgFile() throws Exception { + Configuration testSubject; + String titanMigrationKeySpaceCfgFile = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setTitanMigrationKeySpaceCfgFile(titanMigrationKeySpaceCfgFile); + } + + + @Test + public void testGetTitanInMemoryGraph() throws Exception { + Configuration testSubject; + Boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getTitanInMemoryGraph(); + } + + + @Test + public void testSetTitanInMemoryGraph() throws Exception { + Configuration testSubject; + Boolean titanInMemoryGraph = null; + + // default test + testSubject = createTestSubject(); + testSubject.setTitanInMemoryGraph(titanInMemoryGraph); + } + + + @Test + public void testGetStartMigrationFrom() throws Exception { + Configuration testSubject; + int result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getStartMigrationFrom(); + } + + + @Test + public void testSetStartMigrationFrom() throws Exception { + Configuration testSubject; + int startMigrationFrom = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setStartMigrationFrom(startMigrationFrom); + } + + + @Test + public void testGetTitanLockTimeout() throws Exception { + Configuration testSubject; + Long result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getTitanLockTimeout(); + } + + + @Test + public void testSetTitanLockTimeout() throws Exception { + Configuration testSubject; + Long titanLockTimeout = null; + + // default test + testSubject = createTestSubject(); + testSubject.setTitanLockTimeout(titanLockTimeout); + } + + + @Test + public void testGetTitanHealthCheckReadTimeout() throws Exception { + Configuration testSubject; + Long result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getTitanHealthCheckReadTimeout(); + } + + + + + @Test + public void testSetTitanHealthCheckReadTimeout() throws Exception { + Configuration testSubject; + Long titanHealthCheckReadTimeout = null; + + // default test + testSubject = createTestSubject(); + testSubject.setTitanHealthCheckReadTimeout(titanHealthCheckReadTimeout); + } + + + @Test + public void testGetTitanReconnectIntervalInSeconds() throws Exception { + Configuration testSubject; + Long result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getTitanReconnectIntervalInSeconds(); + } + + + + + @Test + public void testSetTitanReconnectIntervalInSeconds() throws Exception { + Configuration testSubject; + Long titanReconnectIntervalInSeconds = null; + + // default test + testSubject = createTestSubject(); + testSubject.setTitanReconnectIntervalInSeconds(titanReconnectIntervalInSeconds); + } + + + @Test + public void testGetEsReconnectIntervalInSeconds() throws Exception { + Configuration testSubject; + Long result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getEsReconnectIntervalInSeconds(); + } + + + + + @Test + public void testSetEsReconnectIntervalInSeconds() throws Exception { + Configuration testSubject; + Long esReconnectIntervalInSeconds = null; + + // default test + testSubject = createTestSubject(); + testSubject.setEsReconnectIntervalInSeconds(esReconnectIntervalInSeconds); + } + + + @Test + public void testGetArtifactTypes() throws Exception { + Configuration testSubject; + List<String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getArtifactTypes(); + } + + + @Test + public void testSetArtifactTypes() throws Exception { + Configuration testSubject; + List<String> artifactTypes = null; + + // default test + testSubject = createTestSubject(); + testSubject.setArtifactTypes(artifactTypes); + } + + + @Test + public void testGetExcludeResourceCategory() throws Exception { + Configuration testSubject; + List<String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getExcludeResourceCategory(); + } + + + @Test + public void testSetExcludeResourceCategory() throws Exception { + Configuration testSubject; + List<String> excludeResourceCategory = null; + + // default test + testSubject = createTestSubject(); + testSubject.setExcludeResourceCategory(excludeResourceCategory); + } + + + @Test + public void testGetExcludeResourceType() throws Exception { + Configuration testSubject; + List<String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getExcludeResourceType(); + } + + + @Test + public void testSetExcludeResourceType() throws Exception { + Configuration testSubject; + List<String> excludeResourceType = null; + + // default test + testSubject = createTestSubject(); + testSubject.setExcludeResourceType(excludeResourceType); + } + + + @Test + public void testGetToscaArtifacts() throws Exception { + Configuration testSubject; + Map<String, Object> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getToscaArtifacts(); + } + + + @Test + public void testSetToscaArtifacts() throws Exception { + Configuration testSubject; + Map<String, Object> toscaArtifacts = null; + + // default test + testSubject = createTestSubject(); + testSubject.setToscaArtifacts(toscaArtifacts); + } + + + @Test + public void testGetInformationalResourceArtifacts() throws Exception { + Configuration testSubject; + Map<String, Object> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getInformationalResourceArtifacts(); + } + + + @Test + public void testSetInformationalResourceArtifacts() throws Exception { + Configuration testSubject; + Map<String, Object> informationalResourceArtifacts = null; + + // default test + testSubject = createTestSubject(); + testSubject.setInformationalResourceArtifacts(informationalResourceArtifacts); + } + + + @Test + public void testGetInformationalServiceArtifacts() throws Exception { + Configuration testSubject; + Map<String, Object> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getInformationalServiceArtifacts(); + } + + + @Test + public void testSetInformationalServiceArtifacts() throws Exception { + Configuration testSubject; + Map<String, Object> informationalServiceArtifacts = null; + + // default test + testSubject = createTestSubject(); + testSubject.setInformationalServiceArtifacts(informationalServiceArtifacts); + } + + + @Test + public void testGetServiceApiArtifacts() throws Exception { + Configuration testSubject; + Map<String, Object> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getServiceApiArtifacts(); + } + + + @Test + public void testSetServiceApiArtifacts() throws Exception { + Configuration testSubject; + Map<String, Object> serviceApiArtifacts = null; + + // default test + testSubject = createTestSubject(); + testSubject.setServiceApiArtifacts(serviceApiArtifacts); + } + + + @Test + public void testGetServiceDeploymentArtifacts() throws Exception { + Configuration testSubject; + Map<String, ArtifactTypeConfig> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getServiceDeploymentArtifacts(); + } + + + @Test + public void testSetServiceDeploymentArtifacts() throws Exception { + Configuration testSubject; + Map<String, ArtifactTypeConfig> serviceDeploymentArtifacts = null; + + // default test + testSubject = createTestSubject(); + testSubject.setServiceDeploymentArtifacts(serviceDeploymentArtifacts); + } + + + @Test + public void testGetResourceDeploymentArtifacts() throws Exception { + Configuration testSubject; + Map<String, ArtifactTypeConfig> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getResourceDeploymentArtifacts(); + } + + + @Test + public void testSetResourceDeploymentArtifacts() throws Exception { + Configuration testSubject; + Map<String, ArtifactTypeConfig> resourceDeploymentArtifacts = null; + + // default test + testSubject = createTestSubject(); + testSubject.setResourceDeploymentArtifacts(resourceDeploymentArtifacts); + } + + + @Test + public void testSetResourceInstanceDeploymentArtifacts() throws Exception { + Configuration testSubject; + Map<String, ArtifactTypeConfig> resourceInstanceDeploymentArtifacts = null; + + // default test + testSubject = createTestSubject(); + testSubject.setResourceInstanceDeploymentArtifacts(resourceInstanceDeploymentArtifacts); + } + + + @Test + public void testGetResourceInstanceDeploymentArtifacts() throws Exception { + Configuration testSubject; + Map<String, ArtifactTypeConfig> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getResourceInstanceDeploymentArtifacts(); + } + + + @Test + public void testGetExcludeServiceCategory() throws Exception { + Configuration testSubject; + List<String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getExcludeServiceCategory(); + } + + + @Test + public void testSetExcludeServiceCategory() throws Exception { + Configuration testSubject; + List<String> excludeServiceCategory = null; + + // default test + testSubject = createTestSubject(); + testSubject.setExcludeServiceCategory(excludeServiceCategory); + } + + + @Test + public void testGetLicenseTypes() throws Exception { + Configuration testSubject; + List<String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getLicenseTypes(); + } + + + @Test + public void testSetLicenseTypes() throws Exception { + Configuration testSubject; + List<String> licenseTypes = null; + + // default test + testSubject = createTestSubject(); + testSubject.setLicenseTypes(licenseTypes); + } + + + @Test + public void testGetAdditionalInformationMaxNumberOfKeys() throws Exception { + Configuration testSubject; + Integer result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getAdditionalInformationMaxNumberOfKeys(); + } + + + @Test + public void testSetAdditionalInformationMaxNumberOfKeys() throws Exception { + Configuration testSubject; + Integer additionalInformationMaxNumberOfKeys = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setAdditionalInformationMaxNumberOfKeys(additionalInformationMaxNumberOfKeys); + } + + + @Test + public void testGetSystemMonitoring() throws Exception { + Configuration testSubject; + BeMonitoringConfig result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getSystemMonitoring(); + } + + + @Test + public void testSetSystemMonitoring() throws Exception { + Configuration testSubject; + BeMonitoringConfig systemMonitoring = null; + + // default test + testSubject = createTestSubject(); + testSubject.setSystemMonitoring(systemMonitoring); + } + + + @Test + public void testGetDefaultHeatArtifactTimeoutMinutes() throws Exception { + Configuration testSubject; + Integer result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDefaultHeatArtifactTimeoutMinutes(); + } + + + @Test + public void testSetDefaultHeatArtifactTimeoutMinutes() throws Exception { + Configuration testSubject; + Integer defaultHeatArtifactTimeoutMinutes = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setDefaultHeatArtifactTimeoutMinutes(defaultHeatArtifactTimeoutMinutes); + } + + + @Test + public void testGetUebHealthCheckReconnectIntervalInSeconds() throws Exception { + Configuration testSubject; + Long result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getUebHealthCheckReconnectIntervalInSeconds(); + } + + + @Test + public void testSetUebHealthCheckReconnectIntervalInSeconds() throws Exception { + Configuration testSubject; + Long uebHealthCheckReconnectIntervalInSeconds = null; + + // default test + testSubject = createTestSubject(); + testSubject.setUebHealthCheckReconnectIntervalInSeconds(uebHealthCheckReconnectIntervalInSeconds); + } + + + @Test + public void testGetUebHealthCheckReadTimeout() throws Exception { + Configuration testSubject; + Long result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getUebHealthCheckReadTimeout(); + } + + + @Test + public void testSetUebHealthCheckReadTimeout() throws Exception { + Configuration testSubject; + Long uebHealthCheckReadTimeout = null; + + // default test + testSubject = createTestSubject(); + testSubject.setUebHealthCheckReadTimeout(uebHealthCheckReadTimeout); + } + + + @Test + public void testGetCleanComponentsConfiguration() throws Exception { + Configuration testSubject; + CleanComponentsConfiguration result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getCleanComponentsConfiguration(); + } + + + @Test + public void testSetCleanComponentsConfiguration() throws Exception { + Configuration testSubject; + CleanComponentsConfiguration cleanComponentsConfiguration = null; + + // default test + testSubject = createTestSubject(); + testSubject.setCleanComponentsConfiguration(cleanComponentsConfiguration); + } + + + @Test + public void testToString() throws Exception { + Configuration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.toString(); + } + + + @Test + public void testGetUnLoggedUrls() throws Exception { + Configuration testSubject; + List<String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getUnLoggedUrls(); + } + + + @Test + public void testSetUnLoggedUrls() throws Exception { + Configuration testSubject; + List<String> unLoggedUrls = null; + + // default test + testSubject = createTestSubject(); + testSubject.setUnLoggedUrls(unLoggedUrls); + } + + + @Test + public void testGetDeploymentResourceArtifacts() throws Exception { + Configuration testSubject; + Map<String, Object> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDeploymentResourceArtifacts(); + } + + + @Test + public void testSetDeploymentResourceArtifacts() throws Exception { + Configuration testSubject; + Map<String, Object> deploymentResourceArtifacts = null; + + // default test + testSubject = createTestSubject(); + testSubject.setDeploymentResourceArtifacts(deploymentResourceArtifacts); + } + + + @Test + public void testGetHeatEnvArtifactHeader() throws Exception { + Configuration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getHeatEnvArtifactHeader(); + } + + + @Test + public void testSetHeatEnvArtifactHeader() throws Exception { + Configuration testSubject; + String heatEnvArtifactHeader = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setHeatEnvArtifactHeader(heatEnvArtifactHeader); + } + + + @Test + public void testGetHeatEnvArtifactFooter() throws Exception { + Configuration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getHeatEnvArtifactFooter(); + } + + + @Test + public void testSetHeatEnvArtifactFooter() throws Exception { + Configuration testSubject; + String heatEnvArtifactFooter = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setHeatEnvArtifactFooter(heatEnvArtifactFooter); + } + + + @Test + public void testGetDeploymentResourceInstanceArtifacts() throws Exception { + Configuration testSubject; + Map<String, Object> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDeploymentResourceInstanceArtifacts(); + } + + + @Test + public void testSetDeploymentResourceInstanceArtifacts() throws Exception { + Configuration testSubject; + Map<String, Object> deploymentResourceInstanceArtifacts = null; + + // default test + testSubject = createTestSubject(); + testSubject.setDeploymentResourceInstanceArtifacts(deploymentResourceInstanceArtifacts); + } + + + @Test + public void testGetArtifactsIndex() throws Exception { + Configuration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getArtifactsIndex(); + } + + + @Test + public void testSetArtifactsIndex() throws Exception { + Configuration testSubject; + String artifactsIndex = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setArtifactsIndex(artifactsIndex); + } + + + @Test + public void testGetResourceInformationalDeployedArtifacts() throws Exception { + Configuration testSubject; + Map<String, ArtifactTypeConfig> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getResourceInformationalDeployedArtifacts(); + } + + + @Test + public void testSetResourceInformationalDeployedArtifacts() throws Exception { + Configuration testSubject; + Map<String, ArtifactTypeConfig> resourceInformationalDeployedArtifacts = null; + + // default test + testSubject = createTestSubject(); + testSubject.setResourceInformationalDeployedArtifacts(resourceInformationalDeployedArtifacts); + } + + + @Test + public void testGetResourceTypes() throws Exception { + Configuration testSubject; + List<String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getResourceTypes(); + } + + + @Test + public void testSetResourceTypes() throws Exception { + Configuration testSubject; + List<String> resourceTypes = null; + + // default test + testSubject = createTestSubject(); + testSubject.setResourceTypes(resourceTypes); + } + + + @Test + public void testGetToscaFilesDir() throws Exception { + Configuration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getToscaFilesDir(); + } + + + @Test + public void testSetToscaFilesDir() throws Exception { + Configuration testSubject; + String toscaFilesDir = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setToscaFilesDir(toscaFilesDir); + } + + + @Test + public void testGetHeatTranslatorPath() throws Exception { + Configuration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getHeatTranslatorPath(); + } + + + @Test + public void testSetHeatTranslatorPath() throws Exception { + Configuration testSubject; + String heatTranslatorPath = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setHeatTranslatorPath(heatTranslatorPath); + } + + + @Test + public void testGetRequirementsToFulfillBeforeCert() throws Exception { + Configuration testSubject; + Map<String, Set<String>> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getRequirementsToFulfillBeforeCert(); + } + + + @Test + public void testSetRequirementsToFulfillBeforeCert() throws Exception { + Configuration testSubject; + Map<String, Set<String>> requirementsToFulfillBeforeCert = null; + + // default test + testSubject = createTestSubject(); + testSubject.setRequirementsToFulfillBeforeCert(requirementsToFulfillBeforeCert); + } + + + @Test + public void testGetCapabilitiesToConsumeBeforeCert() throws Exception { + Configuration testSubject; + Map<String, Set<String>> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getCapabilitiesToConsumeBeforeCert(); + } + + + @Test + public void testSetCapabilitiesToConsumeBeforeCert() throws Exception { + Configuration testSubject; + Map<String, Set<String>> capabilitiesToConsumeBeforeCert = null; + + // default test + testSubject = createTestSubject(); + testSubject.setCapabilitiesToConsumeBeforeCert(capabilitiesToConsumeBeforeCert); + } + + + @Test + public void testGetOnboarding() throws Exception { + Configuration testSubject; + OnboardingConfig result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getOnboarding(); + } + + + @Test + public void testSetOnboarding() throws Exception { + Configuration testSubject; + OnboardingConfig onboarding = null; + + // default test + testSubject = createTestSubject(); + testSubject.setOnboarding(onboarding); + } + + + @Test + public void testGetEcompPortal() throws Exception { + Configuration testSubject; + EcompPortalConfig result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getEcompPortal(); + } + + + @Test + public void testSetEcompPortal() throws Exception { + Configuration testSubject; + EcompPortalConfig ecompPortal = null; + + // default test + testSubject = createTestSubject(); + testSubject.setEcompPortal(ecompPortal); + } + + + @Test + public void testGetToscaValidators() throws Exception { + Configuration testSubject; + ToscaValidatorsConfig result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getToscaValidators(); + } + + + @Test + public void testSetToscaValidators() throws Exception { + Configuration testSubject; + ToscaValidatorsConfig toscaValidators = null; + + // default test + testSubject = createTestSubject(); + testSubject.setToscaValidators(toscaValidators); + } + + + @Test + public void testIsDisableAudit() throws Exception { + Configuration testSubject; + boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.isDisableAudit(); + } + + + @Test + public void testSetDisableAudit() throws Exception { + Configuration testSubject; + boolean enableAudit = false; + + // default test + testSubject = createTestSubject(); + testSubject.setDisableAudit(enableAudit); + } + + + @Test + public void testGetResourceInformationalArtifacts() throws Exception { + Configuration testSubject; + Map<String, ArtifactTypeConfig> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getResourceInformationalArtifacts(); + } + + + @Test + public void testSetResourceInformationalArtifacts() throws Exception { + Configuration testSubject; + Map<String, ArtifactTypeConfig> resourceInformationalArtifacts = null; + + // default test + testSubject = createTestSubject(); + testSubject.setResourceInformationalArtifacts(resourceInformationalArtifacts); + } + + + @Test + public void testGetVfModuleProperties() throws Exception { + Configuration testSubject; + Map<String, VfModuleProperty> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getVfModuleProperties(); + } + + + @Test + public void testSetVfModuleProperties() throws Exception { + Configuration testSubject; + Map<String, VfModuleProperty> vfModuleProperties = null; + + // default test + testSubject = createTestSubject(); + testSubject.setVfModuleProperties(vfModuleProperties); + } + + + @Test + public void testGetToscaConformanceLevel() throws Exception { + Configuration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getToscaConformanceLevel(); + } + + + @Test + public void testSetToscaConformanceLevel() throws Exception { + Configuration testSubject; + String toscaConformanceLevel = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setToscaConformanceLevel(toscaConformanceLevel); + } + + + @Test + public void testGetMinToscaConformanceLevel() throws Exception { + Configuration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getMinToscaConformanceLevel(); + } + + + @Test + public void testSetMinToscaConformanceLevel() throws Exception { + Configuration testSubject; + String toscaConformanceLevel = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setMinToscaConformanceLevel(toscaConformanceLevel); + } + + + @Test + public void testGetDefaultImports() throws Exception { + Configuration testSubject; + LinkedList<Map<String, Map<String, String>>> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDefaultImports(); + } + + + @Test + public void testSetDefaultImports() throws Exception { + Configuration testSubject; + LinkedList<Map<String, Map<String, String>>> defaultImports = null; + + // default test + testSubject = createTestSubject(); + testSubject.setDefaultImports(defaultImports); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/be/config/DistributionEngineConfigurationTest.java b/common-app-api/src/test/java/org/openecomp/sdc/be/config/DistributionEngineConfigurationTest.java new file mode 100644 index 0000000000..8eb9befa7f --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/be/config/DistributionEngineConfigurationTest.java @@ -0,0 +1,372 @@ +package org.openecomp.sdc.be.config; + +import java.util.List; + +import javax.annotation.Generated; + +import org.junit.Test; +import org.openecomp.sdc.be.config.DistributionEngineConfiguration.ComponentArtifactTypesConfig; +import org.openecomp.sdc.be.config.DistributionEngineConfiguration.CreateTopicConfig; +import org.openecomp.sdc.be.config.DistributionEngineConfiguration.DistributionNotificationTopicConfig; +import org.openecomp.sdc.be.config.DistributionEngineConfiguration.DistributionStatusTopicConfig; + + +public class DistributionEngineConfigurationTest { + + private DistributionEngineConfiguration createTestSubject() { + return new DistributionEngineConfiguration(); + } + + + @Test + public void testGetUebServers() throws Exception { + DistributionEngineConfiguration testSubject; + List<String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getUebServers(); + } + + + @Test + public void testSetUebServers() throws Exception { + DistributionEngineConfiguration testSubject; + List<String> uebServers = null; + + // default test + testSubject = createTestSubject(); + testSubject.setUebServers(uebServers); + } + + + @Test + public void testGetDistributionNotifTopicName() throws Exception { + DistributionEngineConfiguration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDistributionNotifTopicName(); + } + + + @Test + public void testSetDistributionNotifTopicName() throws Exception { + DistributionEngineConfiguration testSubject; + String distributionNotifTopicName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setDistributionNotifTopicName(distributionNotifTopicName); + } + + + @Test + public void testGetDistributionStatusTopicName() throws Exception { + DistributionEngineConfiguration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDistributionStatusTopicName(); + } + + + @Test + public void testSetDistributionStatusTopicName() throws Exception { + DistributionEngineConfiguration testSubject; + String distributionStatusTopicName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setDistributionStatusTopicName(distributionStatusTopicName); + } + + + @Test + public void testGetInitRetryIntervalSec() throws Exception { + DistributionEngineConfiguration testSubject; + Integer result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getInitRetryIntervalSec(); + } + + + @Test + public void testSetInitRetryIntervalSec() throws Exception { + DistributionEngineConfiguration testSubject; + Integer initRetryIntervalSec = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setInitRetryIntervalSec(initRetryIntervalSec); + } + + + @Test + public void testGetDistribNotifServiceArtifactTypes() throws Exception { + DistributionEngineConfiguration testSubject; + ComponentArtifactTypesConfig result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDistribNotifServiceArtifactTypes(); + } + + + @Test + public void testSetDistribNotifServiceArtifactTypes() throws Exception { + DistributionEngineConfiguration testSubject; + ComponentArtifactTypesConfig distribNotifServiceArtifactTypes = null; + + // default test + testSubject = createTestSubject(); + testSubject.setDistribNotifServiceArtifactTypes(distribNotifServiceArtifactTypes); + } + + + @Test + public void testGetDistribNotifResourceArtifactTypes() throws Exception { + DistributionEngineConfiguration testSubject; + ComponentArtifactTypesConfig result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDistribNotifResourceArtifactTypes(); + } + + + @Test + public void testSetDistribNotifResourceArtifactTypes() throws Exception { + DistributionEngineConfiguration testSubject; + ComponentArtifactTypesConfig distribNotifResourceArtifactTypes = null; + + // default test + testSubject = createTestSubject(); + testSubject.setDistribNotifResourceArtifactTypes(distribNotifResourceArtifactTypes); + } + + + @Test + public void testGetUebPublicKey() throws Exception { + DistributionEngineConfiguration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getUebPublicKey(); + } + + + @Test + public void testSetUebPublicKey() throws Exception { + DistributionEngineConfiguration testSubject; + String uebPublicKey = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setUebPublicKey(uebPublicKey); + } + + + @Test + public void testGetUebSecretKey() throws Exception { + DistributionEngineConfiguration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getUebSecretKey(); + } + + + @Test + public void testSetUebSecretKey() throws Exception { + DistributionEngineConfiguration testSubject; + String uebSecretKey = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setUebSecretKey(uebSecretKey); + } + + + @Test + public void testGetEnvironments() throws Exception { + DistributionEngineConfiguration testSubject; + List<String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getEnvironments(); + } + + + @Test + public void testSetEnvironments() throws Exception { + DistributionEngineConfiguration testSubject; + List<String> environments = null; + + // test 1 + testSubject = createTestSubject(); + environments = null; + testSubject.setEnvironments(environments); + } + + + @Test + public void testGetDistributionStatusTopic() throws Exception { + DistributionEngineConfiguration testSubject; + DistributionStatusTopicConfig result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDistributionStatusTopic(); + } + + + @Test + public void testSetDistributionStatusTopic() throws Exception { + DistributionEngineConfiguration testSubject; + DistributionStatusTopicConfig distributionStatusTopic = null; + + // default test + testSubject = createTestSubject(); + testSubject.setDistributionStatusTopic(distributionStatusTopic); + } + + + @Test + public void testGetInitMaxIntervalSec() throws Exception { + DistributionEngineConfiguration testSubject; + Integer result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getInitMaxIntervalSec(); + } + + + @Test + public void testSetInitMaxIntervalSec() throws Exception { + DistributionEngineConfiguration testSubject; + Integer initMaxIntervalSec = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setInitMaxIntervalSec(initMaxIntervalSec); + } + + + @Test + public void testGetCreateTopic() throws Exception { + DistributionEngineConfiguration testSubject; + CreateTopicConfig result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getCreateTopic(); + } + + + @Test + public void testSetCreateTopic() throws Exception { + DistributionEngineConfiguration testSubject; + CreateTopicConfig createTopic = null; + + // default test + testSubject = createTestSubject(); + testSubject.setCreateTopic(createTopic); + } + + + @Test + public void testIsStartDistributionEngine() throws Exception { + DistributionEngineConfiguration testSubject; + boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.isStartDistributionEngine(); + } + + + @Test + public void testSetStartDistributionEngine() throws Exception { + DistributionEngineConfiguration testSubject; + boolean startDistributionEngine = false; + + // default test + testSubject = createTestSubject(); + testSubject.setStartDistributionEngine(startDistributionEngine); + } + + + @Test + public void testGetDistributionNotificationTopic() throws Exception { + DistributionEngineConfiguration testSubject; + DistributionNotificationTopicConfig result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDistributionNotificationTopic(); + } + + + @Test + public void testSetDistributionNotificationTopic() throws Exception { + DistributionEngineConfiguration testSubject; + DistributionNotificationTopicConfig distributionNotificationTopic = null; + + // default test + testSubject = createTestSubject(); + testSubject.setDistributionNotificationTopic(distributionNotificationTopic); + } + + + @Test + public void testGetDefaultArtifactInstallationTimeout() throws Exception { + DistributionEngineConfiguration testSubject; + int result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDefaultArtifactInstallationTimeout(); + } + + + @Test + public void testSetDefaultArtifactInstallationTimeout() throws Exception { + DistributionEngineConfiguration testSubject; + int defaultArtifactInstallationTimeout = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setDefaultArtifactInstallationTimeout(defaultArtifactInstallationTimeout); + } + + + @Test + public void testIsUseHttpsWithDmaap() throws Exception { + DistributionEngineConfiguration testSubject; + boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.isUseHttpsWithDmaap(); + } + + + @Test + public void testSetUseHttpsWithDmaap() throws Exception { + DistributionEngineConfiguration testSubject; + boolean useHttpsWithDmaap = false; + + // default test + testSubject = createTestSubject(); + testSubject.setUseHttpsWithDmaap(useHttpsWithDmaap); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/be/config/ErrorConfigurationTest.java b/common-app-api/src/test/java/org/openecomp/sdc/be/config/ErrorConfigurationTest.java new file mode 100644 index 0000000000..47e380b7cc --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/be/config/ErrorConfigurationTest.java @@ -0,0 +1,51 @@ +package org.openecomp.sdc.be.config; + +import java.util.Map; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class ErrorConfigurationTest { + + private ErrorConfiguration createTestSubject() { + return new ErrorConfiguration(); + } + + + @Test + public void testGetErrors() throws Exception { + ErrorConfiguration testSubject; + Map<String, ErrorInfo> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getErrors(); + } + + + @Test + public void testSetErrors() throws Exception { + ErrorConfiguration testSubject; + Map<String, ErrorInfo> errors = null; + + // default test + testSubject = createTestSubject(); + testSubject.setErrors(errors); + } + + + + + + @Test + public void testToString() throws Exception { + ErrorConfiguration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.toString(); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/be/config/ErrorInfoTest.java b/common-app-api/src/test/java/org/openecomp/sdc/be/config/ErrorInfoTest.java new file mode 100644 index 0000000000..86bedf6beb --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/be/config/ErrorInfoTest.java @@ -0,0 +1,110 @@ +package org.openecomp.sdc.be.config; + +import javax.annotation.Generated; + +import org.junit.Test; +import org.openecomp.sdc.be.config.ErrorInfo.ErrorInfoType; + + +public class ErrorInfoTest { + + private ErrorInfo createTestSubject() { + return new ErrorInfo(); + } + + + @Test + public void testGetCode() throws Exception { + ErrorInfo testSubject; + Integer result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getCode(); + } + + + @Test + public void testSetCode() throws Exception { + ErrorInfo testSubject; + Integer code = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setCode(code); + } + + + @Test + public void testGetMessage() throws Exception { + ErrorInfo testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getMessage(); + } + + + @Test + public void testSetMessage() throws Exception { + ErrorInfo testSubject; + String message = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setMessage(message); + } + + + @Test + public void testGetMessageId() throws Exception { + ErrorInfo testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getMessageId(); + } + + + @Test + public void testSetMessageId() throws Exception { + ErrorInfo testSubject; + String messageId = ""; + + // test 1 + testSubject = createTestSubject(); + messageId = null; + testSubject.setMessageId(messageId); + + // test 2 + testSubject = createTestSubject(); + messageId = ""; + testSubject.setMessageId(messageId); + } + + + @Test + public void testGetErrorInfoType() throws Exception { + ErrorInfo testSubject; + ErrorInfoType result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getErrorInfoType(); + } + + + + + @Test + public void testToString() throws Exception { + ErrorInfo testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.toString(); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/be/config/Neo4jErrorsConfigurationTest.java b/common-app-api/src/test/java/org/openecomp/sdc/be/config/Neo4jErrorsConfigurationTest.java new file mode 100644 index 0000000000..2c62d6677c --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/be/config/Neo4jErrorsConfigurationTest.java @@ -0,0 +1,51 @@ +package org.openecomp.sdc.be.config; + +import java.util.Map; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class Neo4jErrorsConfigurationTest { + + private Neo4jErrorsConfiguration createTestSubject() { + return new Neo4jErrorsConfiguration(); + } + + + @Test + public void testGetErrors() throws Exception { + Neo4jErrorsConfiguration testSubject; + Map<String, String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getErrors(); + } + + + @Test + public void testSetErrors() throws Exception { + Neo4jErrorsConfiguration testSubject; + Map<String, String> errors = null; + + // default test + testSubject = createTestSubject(); + testSubject.setErrors(errors); + } + + + + + + @Test + public void testToString() throws Exception { + Neo4jErrorsConfiguration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.toString(); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/be/config/validation/DeploymentArtifactHeatConfigurationTest.java b/common-app-api/src/test/java/org/openecomp/sdc/be/config/validation/DeploymentArtifactHeatConfigurationTest.java new file mode 100644 index 0000000000..616dbf9491 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/be/config/validation/DeploymentArtifactHeatConfigurationTest.java @@ -0,0 +1,59 @@ +package org.openecomp.sdc.be.config.validation; + +import java.util.Map; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class DeploymentArtifactHeatConfigurationTest { + + private DeploymentArtifactHeatConfiguration createTestSubject() { + return new DeploymentArtifactHeatConfiguration(); + } + + + @Test + public void testGetHeat_template_version() throws Exception { + DeploymentArtifactHeatConfiguration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getHeat_template_version(); + } + + + @Test + public void testSetHeat_template_version() throws Exception { + DeploymentArtifactHeatConfiguration testSubject; + String heat_template_version = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setHeat_template_version(heat_template_version); + } + + + @Test + public void testGetResources() throws Exception { + DeploymentArtifactHeatConfiguration testSubject; + Map<String, Object> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getResources(); + } + + + @Test + public void testSetResources() throws Exception { + DeploymentArtifactHeatConfiguration testSubject; + Map<String, Object> resources = null; + + // default test + testSubject = createTestSubject(); + testSubject.setResources(resources); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/api/ArtifactGroupTypeEnumTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/api/ArtifactGroupTypeEnumTest.java new file mode 100644 index 0000000000..ef313377c6 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/api/ArtifactGroupTypeEnumTest.java @@ -0,0 +1,56 @@ +package org.openecomp.sdc.common.api; + +import java.util.List; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class ArtifactGroupTypeEnumTest { + + private ArtifactGroupTypeEnum createTestSubject() { + return ArtifactGroupTypeEnum.DEPLOYMENT; + } + + + @Test + public void testGetType() throws Exception { + ArtifactGroupTypeEnum testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getType(); + } + + + @Test + public void testSetType() throws Exception { + ArtifactGroupTypeEnum testSubject; + String type = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setType(type); + } + + + @Test + public void testFindType() throws Exception { + String type = ""; + ArtifactGroupTypeEnum result; + + // default test + result = ArtifactGroupTypeEnum.findType(type); + } + + + @Test + public void testGetAllTypes() throws Exception { + List<String> result; + + // default test + result = ArtifactGroupTypeEnum.getAllTypes(); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/api/ArtifactTypeEnumTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/api/ArtifactTypeEnumTest.java new file mode 100644 index 0000000000..466eb3bab2 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/api/ArtifactTypeEnumTest.java @@ -0,0 +1,56 @@ +package org.openecomp.sdc.common.api; + +import java.util.List; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class ArtifactTypeEnumTest { + + private ArtifactTypeEnum createTestSubject() { + return ArtifactTypeEnum.AAI_SERVICE_MODEL; + } + + + @Test + public void testGetType() throws Exception { + ArtifactTypeEnum testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getType(); + } + + + @Test + public void testSetType() throws Exception { + ArtifactTypeEnum testSubject; + String type = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setType(type); + } + + + @Test + public void testFindType() throws Exception { + String type = ""; + ArtifactTypeEnum result; + + // default test + result = ArtifactTypeEnum.findType(type); + } + + + @Test + public void testGetAllTypes() throws Exception { + List<String> result; + + // default test + result = ArtifactTypeEnum.getAllTypes(); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/api/HealthCheckInfoTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/api/HealthCheckInfoTest.java new file mode 100644 index 0000000000..7d2e3de68a --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/api/HealthCheckInfoTest.java @@ -0,0 +1,114 @@ +package org.openecomp.sdc.common.api; + +import java.util.List; + +import javax.annotation.Generated; + +import org.junit.Test; +import org.openecomp.sdc.common.api.HealthCheckInfo.HealthCheckComponent; +import org.openecomp.sdc.common.api.HealthCheckInfo.HealthCheckStatus; + + +public class HealthCheckInfoTest { + + private HealthCheckInfo createTestSubject() { + return new HealthCheckInfo(null, null, "", ""); + } + + + @Test + public void testGetHealthCheckComponent() throws Exception { + HealthCheckInfo testSubject; + HealthCheckComponent result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getHealthCheckComponent(); + } + + + @Test + public void testGetHealthCheckStatus() throws Exception { + HealthCheckInfo testSubject; + HealthCheckStatus result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getHealthCheckStatus(); + } + + + @Test + public void testGetComponentsInfo() throws Exception { + HealthCheckInfo testSubject; + List<HealthCheckInfo> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getComponentsInfo(); + } + + + @Test + public void testSetComponentsInfo() throws Exception { + HealthCheckInfo testSubject; + List<HealthCheckInfo> componentsInfo = null; + + // default test + testSubject = createTestSubject(); + testSubject.setComponentsInfo(componentsInfo); + } + + + @Test + public void testGetVersion() throws Exception { + HealthCheckInfo testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getVersion(); + } + + + @Test + public void testSetVersion() throws Exception { + HealthCheckInfo testSubject; + String version = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setVersion(version); + } + + + @Test + public void testGetDescription() throws Exception { + HealthCheckInfo testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDescription(); + } + + + @Test + public void testToString() throws Exception { + HealthCheckInfo testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.toString(); + } + + + @Test + public void testMain() throws Exception { + String[] args = new String[] { "" }; + + // default test + HealthCheckInfo.main(args); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/api/ResponseInfoTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/api/ResponseInfoTest.java new file mode 100644 index 0000000000..50c53d0587 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/api/ResponseInfoTest.java @@ -0,0 +1,61 @@ +package org.openecomp.sdc.common.api; + +import javax.annotation.Generated; + +import org.junit.Test; +import org.openecomp.sdc.common.api.ResponseInfo.ResponseStatusEnum; + + +public class ResponseInfoTest { + + private ResponseInfo createTestSubject() { + return new ResponseInfo(null, ""); + } + + + @Test + public void testGetApplicativeStatus() throws Exception { + ResponseInfo testSubject; + ResponseStatusEnum result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getApplicativeStatus(); + } + + + @Test + public void testSetApplicativeStatus() throws Exception { + ResponseInfo testSubject; + ResponseStatusEnum applicativeStatus = null; + + // default test + testSubject = createTestSubject(); + testSubject.setApplicativeStatus(applicativeStatus); + } + + + @Test + public void testGetDescription() throws Exception { + ResponseInfo testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDescription(); + } + + + @Test + public void testSetDescription() throws Exception { + ResponseInfo testSubject; + String description = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setDescription(description); + } + + + +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/api/ToscaNodeTypeInfoTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/api/ToscaNodeTypeInfoTest.java new file mode 100644 index 0000000000..0a83b8ec61 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/api/ToscaNodeTypeInfoTest.java @@ -0,0 +1,136 @@ +package org.openecomp.sdc.common.api; + +import java.util.List; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class ToscaNodeTypeInfoTest { + + private ToscaNodeTypeInfo createTestSubject() { + return new ToscaNodeTypeInfo(); + } + + + @Test + public void testGetTemplateName() throws Exception { + ToscaNodeTypeInfo testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getTemplateName(); + } + + + @Test + public void testSetTemplateName() throws Exception { + ToscaNodeTypeInfo testSubject; + String templateName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setTemplateName(templateName); + } + + + @Test + public void testGetNodeName() throws Exception { + ToscaNodeTypeInfo testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getNodeName(); + } + + + @Test + public void testSetNodeName() throws Exception { + ToscaNodeTypeInfo testSubject; + String nodeName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setNodeName(nodeName); + } + + + @Test + public void testGetTemplateVersion() throws Exception { + ToscaNodeTypeInfo testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getTemplateVersion(); + } + + + @Test + public void testSetTemplateVersion() throws Exception { + ToscaNodeTypeInfo testSubject; + String templateVersion = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setTemplateVersion(templateVersion); + } + + + @Test + public void testGetInterfaces() throws Exception { + ToscaNodeTypeInfo testSubject; + List<ToscaNodeTypeInterface> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getInterfaces(); + } + + + @Test + public void testSetInterfaces() throws Exception { + ToscaNodeTypeInfo testSubject; + List<ToscaNodeTypeInterface> interfaces = null; + + // default test + testSubject = createTestSubject(); + testSubject.setInterfaces(interfaces); + } + + + @Test + public void testGetIconPath() throws Exception { + ToscaNodeTypeInfo testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getIconPath(); + } + + + @Test + public void testSetIconPath() throws Exception { + ToscaNodeTypeInfo testSubject; + String iconPath = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setIconPath(iconPath); + } + + + @Test + public void testToString() throws Exception { + ToscaNodeTypeInfo testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.toString(); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/api/ToscaNodeTypeInterfaceTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/api/ToscaNodeTypeInterfaceTest.java new file mode 100644 index 0000000000..7d14df9c6d --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/api/ToscaNodeTypeInterfaceTest.java @@ -0,0 +1,37 @@ +package org.openecomp.sdc.common.api; + +import java.util.List; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class ToscaNodeTypeInterfaceTest { + + private ToscaNodeTypeInterface createTestSubject() { + return new ToscaNodeTypeInterface(); + } + + + @Test + public void testGetScripts() throws Exception { + ToscaNodeTypeInterface testSubject; + List<String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getScripts(); + } + + + @Test + public void testSetScripts() throws Exception { + ToscaNodeTypeInterface testSubject; + List<String> scripts = null; + + // default test + testSubject = createTestSubject(); + testSubject.setScripts(scripts); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/api/YamlSuffixEnumTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/api/YamlSuffixEnumTest.java new file mode 100644 index 0000000000..f731bb78fa --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/api/YamlSuffixEnumTest.java @@ -0,0 +1,46 @@ +package org.openecomp.sdc.common.api; + +import java.util.List; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class YamlSuffixEnumTest { + + private YamlSuffixEnum createTestSubject() { + return YamlSuffixEnum.YAML; + } + + + @Test + public void testGetSuffix() throws Exception { + YamlSuffixEnum testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getSuffix(); + } + + + @Test + public void testSetSuufix() throws Exception { + YamlSuffixEnum testSubject; + String suffix = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setSuufix(suffix); + } + + + @Test + public void testGetSuffixes() throws Exception { + List<String> result; + + // default test + result = YamlSuffixEnum.getSuffixes(); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/datastructure/AuditingFieldsKeysEnumTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/datastructure/AuditingFieldsKeysEnumTest.java new file mode 100644 index 0000000000..521f2e38d1 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/datastructure/AuditingFieldsKeysEnumTest.java @@ -0,0 +1,46 @@ +package org.openecomp.sdc.common.datastructure; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class AuditingFieldsKeysEnumTest { + + private AuditingFieldsKeysEnum createTestSubject() { + return AuditingFieldsKeysEnum.AUDIT_ACTION; + } + + + @Test + public void testGetValueClass() throws Exception { + AuditingFieldsKeysEnum testSubject; + Class<?> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getValueClass(); + } + + + @Test + public void testGetDisplayName() throws Exception { + AuditingFieldsKeysEnum testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDisplayName(); + } + + + @Test + public void testSetDisplayName() throws Exception { + AuditingFieldsKeysEnum testSubject; + String displayName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setDisplayName(displayName); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/datastructure/ESTimeBasedEventTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/datastructure/ESTimeBasedEventTest.java new file mode 100644 index 0000000000..2826b49c66 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/datastructure/ESTimeBasedEventTest.java @@ -0,0 +1,119 @@ +package org.openecomp.sdc.common.datastructure; + +import java.util.Map; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class ESTimeBasedEventTest { + + private ESTimeBasedEvent createTestSubject() { + return new ESTimeBasedEvent(); + } + + + + + @Test + public void testCalculateYearIndexSuffix() throws Exception { + ESTimeBasedEvent testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.calculateYearIndexSuffix(); + } + + + @Test + public void testCalculateMonthIndexSuffix() throws Exception { + ESTimeBasedEvent testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.calculateMonthIndexSuffix(); + } + + + @Test + public void testCalculateDayIndexSuffix() throws Exception { + ESTimeBasedEvent testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.calculateDayIndexSuffix(); + } + + + @Test + public void testCalculateHourIndexSuffix() throws Exception { + ESTimeBasedEvent testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.calculateHourIndexSuffix(); + } + + + @Test + public void testCalculateMinuteIndexSuffix() throws Exception { + ESTimeBasedEvent testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.calculateMinuteIndexSuffix(); + } + + + + + + @Test + public void testGetTimestamp() throws Exception { + ESTimeBasedEvent testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getTimestamp(); + } + + + @Test + public void testSetTimestamp() throws Exception { + ESTimeBasedEvent testSubject; + String timestamp = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setTimestamp(timestamp); + } + + + @Test + public void testGetFields() throws Exception { + ESTimeBasedEvent testSubject; + Map<String, Object> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getFields(); + } + + + @Test + public void testSetFields() throws Exception { + ESTimeBasedEvent testSubject; + Map<String, Object> fields = null; + + // default test + testSubject = createTestSubject(); + testSubject.setFields(fields); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/datastructure/MonitoringFieldsKeysEnumTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/datastructure/MonitoringFieldsKeysEnumTest.java new file mode 100644 index 0000000000..272c9d1796 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/datastructure/MonitoringFieldsKeysEnumTest.java @@ -0,0 +1,46 @@ +package org.openecomp.sdc.common.datastructure; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class MonitoringFieldsKeysEnumTest { + + private MonitoringFieldsKeysEnum createTestSubject() { + return MonitoringFieldsKeysEnum.MONITORING_APP_ID; + } + + + @Test + public void testGetValueClass() throws Exception { + MonitoringFieldsKeysEnum testSubject; + Class<?> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getValueClass(); + } + + + @Test + public void testGetDisplayName() throws Exception { + MonitoringFieldsKeysEnum testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getDisplayName(); + } + + + @Test + public void testSetDisplayName() throws Exception { + MonitoringFieldsKeysEnum testSubject; + String displayName = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setDisplayName(displayName); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/datastructure/WrapperTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/datastructure/WrapperTest.java new file mode 100644 index 0000000000..eac9196b75 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/datastructure/WrapperTest.java @@ -0,0 +1,26 @@ +package org.openecomp.sdc.common.datastructure; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class WrapperTest { + + private Wrapper createTestSubject() { + return new Wrapper(null); + } + + + + + @Test + public void testIsEmpty() throws Exception { + Wrapper testSubject; + boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.isEmpty(); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/kpi/api/ASDCKpiApiTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/kpi/api/ASDCKpiApiTest.java new file mode 100644 index 0000000000..fa86708eb2 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/kpi/api/ASDCKpiApiTest.java @@ -0,0 +1,53 @@ +package org.openecomp.sdc.common.kpi.api; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class ASDCKpiApiTest { + + private ASDCKpiApi createTestSubject() { + return new ASDCKpiApi(); + } + + + @Test + public void testCountImportResourcesKPI() throws Exception { + + // default test + ASDCKpiApi.countImportResourcesKPI(); + } + + + @Test + public void testCountCreatedResourcesKPI() throws Exception { + + // default test + ASDCKpiApi.countCreatedResourcesKPI(); + } + + + @Test + public void testCountCreatedServicesKPI() throws Exception { + + // default test + ASDCKpiApi.countCreatedServicesKPI(); + } + + + @Test + public void testCountUsersAuthorizations() throws Exception { + + // default test + ASDCKpiApi.countUsersAuthorizations(); + } + + + @Test + public void testCountActivatedDistribution() throws Exception { + + // default test + ASDCKpiApi.countActivatedDistribution(); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/listener/AppContextListenerTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/listener/AppContextListenerTest.java new file mode 100644 index 0000000000..a9936adae5 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/listener/AppContextListenerTest.java @@ -0,0 +1,43 @@ +package org.openecomp.sdc.common.listener; + +import java.util.Map; + +import javax.annotation.Generated; +import javax.servlet.ServletContext; +import javax.servlet.ServletContextEvent; + +import org.junit.Test; + + +public class AppContextListenerTest { + + private AppContextListener createTestSubject() { + return new AppContextListener(); + } + + + + + + @Test + public void testContextDestroyed() throws Exception { + AppContextListener testSubject; + ServletContextEvent context = null; + + // default test + testSubject = createTestSubject(); + testSubject.contextDestroyed(context); + } + + + + +// @Test + public void testGetManifestInfo() throws Exception { + ServletContext application = null; + Map<String, String> result; + + // default test + result = AppContextListener.getManifestInfo(application); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/monitoring/MonitoringEventTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/monitoring/MonitoringEventTest.java new file mode 100644 index 0000000000..2e64590ccc --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/monitoring/MonitoringEventTest.java @@ -0,0 +1,244 @@ +package org.openecomp.sdc.common.monitoring; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class MonitoringEventTest { + + private MonitoringEvent createTestSubject() { + return new MonitoringEvent(); + } + + + @Test + public void testGetHostid() throws Exception { + MonitoringEvent testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getHostid(); + } + + + @Test + public void testSetHostid() throws Exception { + MonitoringEvent testSubject; + String hostid = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setHostid(hostid); + } + + + @Test + public void testGetHostcpu() throws Exception { + MonitoringEvent testSubject; + Long result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getHostcpu(); + } + + + @Test + public void testSetHostcpu() throws Exception { + MonitoringEvent testSubject; + Long hostcpu = null; + + // default test + testSubject = createTestSubject(); + testSubject.setHostcpu(hostcpu); + } + + + @Test + public void testGetHostmem() throws Exception { + MonitoringEvent testSubject; + Double result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getHostmem(); + } + + + @Test + public void testSetHostmem() throws Exception { + MonitoringEvent testSubject; + Double hostmem = null; + + // default test + testSubject = createTestSubject(); + testSubject.setHostmem(hostmem); + } + + + @Test + public void testGetHostdisk() throws Exception { + MonitoringEvent testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getHostdisk(); + } + + + @Test + public void testSetHostdisk() throws Exception { + MonitoringEvent testSubject; + String hostdisk = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setHostdisk(hostdisk); + } + + + @Test + public void testGetJvmid() throws Exception { + MonitoringEvent testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getJvmid(); + } + + + @Test + public void testSetJvmid() throws Exception { + MonitoringEvent testSubject; + String jvmid = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setJvmid(jvmid); + } + + + @Test + public void testGetJvmcpu() throws Exception { + MonitoringEvent testSubject; + Long result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getJvmcpu(); + } + + + @Test + public void testSetJvmcpu() throws Exception { + MonitoringEvent testSubject; + Long jvmcpu = null; + + // default test + testSubject = createTestSubject(); + testSubject.setJvmcpu(jvmcpu); + } + + + @Test + public void testGetJvmmem() throws Exception { + MonitoringEvent testSubject; + Long result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getJvmmem(); + } + + + @Test + public void testSetJvmmem() throws Exception { + MonitoringEvent testSubject; + Long jvmmem = null; + + // default test + testSubject = createTestSubject(); + testSubject.setJvmmem(jvmmem); + } + + + @Test + public void testGetJvmtnum() throws Exception { + MonitoringEvent testSubject; + Integer result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getJvmtnum(); + } + + + @Test + public void testSetJvmtnum() throws Exception { + MonitoringEvent testSubject; + Integer jvmtnum = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setJvmtnum(jvmtnum); + } + + + @Test + public void testGetAppid() throws Exception { + MonitoringEvent testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getAppid(); + } + + + @Test + public void testSetAppid() throws Exception { + MonitoringEvent testSubject; + String appid = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setAppid(appid); + } + + + @Test + public void testGetAppstat() throws Exception { + MonitoringEvent testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getAppstat(); + } + + + @Test + public void testSetAppstat() throws Exception { + MonitoringEvent testSubject; + String appstat = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setAppstat(appstat); + } + + + @Test + public void testToString() throws Exception { + MonitoringEvent testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.toString(); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/rest/api/RestConfigurationInfoTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/rest/api/RestConfigurationInfoTest.java new file mode 100644 index 0000000000..89309e7c03 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/rest/api/RestConfigurationInfoTest.java @@ -0,0 +1,112 @@ +package org.openecomp.sdc.common.rest.api; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class RestConfigurationInfoTest { + + private RestConfigurationInfo createTestSubject() { + return new RestConfigurationInfo(); + } + + + @Test + public void testGetReadTimeoutInSec() throws Exception { + RestConfigurationInfo testSubject; + Integer result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getReadTimeoutInSec(); + } + + + @Test + public void testSetReadTimeoutInSec() throws Exception { + RestConfigurationInfo testSubject; + Integer readTimeoutInSec = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setReadTimeoutInSec(readTimeoutInSec); + } + + + @Test + public void testGetIgnoreCertificate() throws Exception { + RestConfigurationInfo testSubject; + Boolean result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getIgnoreCertificate(); + } + + + @Test + public void testSetIgnoreCertificate() throws Exception { + RestConfigurationInfo testSubject; + Boolean ignoreCertificate = null; + + // default test + testSubject = createTestSubject(); + testSubject.setIgnoreCertificate(ignoreCertificate); + } + + + @Test + public void testGetConnectionPoolSize() throws Exception { + RestConfigurationInfo testSubject; + Integer result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getConnectionPoolSize(); + } + + + @Test + public void testSetConnectionPoolSize() throws Exception { + RestConfigurationInfo testSubject; + Integer connectionPoolSize = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setConnectionPoolSize(connectionPoolSize); + } + + + @Test + public void testGetConnectTimeoutInSec() throws Exception { + RestConfigurationInfo testSubject; + Integer result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getConnectTimeoutInSec(); + } + + + @Test + public void testSetConnectTimeoutInSec() throws Exception { + RestConfigurationInfo testSubject; + Integer connectTimeoutInSec = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setConnectTimeoutInSec(connectTimeoutInSec); + } + + + @Test + public void testToString() throws Exception { + RestConfigurationInfo testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.toString(); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/rest/api/RestResponseAsByteArrayTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/rest/api/RestResponseAsByteArrayTest.java new file mode 100644 index 0000000000..a01c761072 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/rest/api/RestResponseAsByteArrayTest.java @@ -0,0 +1,101 @@ +package org.openecomp.sdc.common.rest.api; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class RestResponseAsByteArrayTest { + + private RestResponseAsByteArray createTestSubject() { + return new RestResponseAsByteArray(null, "", 0); + } + + + @Test + public void testGetResponse() throws Exception { + RestResponseAsByteArray testSubject; + byte[] result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getResponse(); + } + + + @Test + public void testSetResponse() throws Exception { + RestResponseAsByteArray testSubject; + byte[] response = new byte[] { ' ' }; + + // default test + testSubject = createTestSubject(); + testSubject.setResponse(response); + } + + + @Test + public void testGetHttpStatusCode() throws Exception { + RestResponseAsByteArray testSubject; + int result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getHttpStatusCode(); + } + + + @Test + public void testSetHttpStatusCode() throws Exception { + RestResponseAsByteArray testSubject; + int httpStatusCode = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setHttpStatusCode(httpStatusCode); + } + + + @Test + public void testGetStatusDescription() throws Exception { + RestResponseAsByteArray testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getStatusDescription(); + } + + + @Test + public void testSetStatusDescription() throws Exception { + RestResponseAsByteArray testSubject; + String statusDescription = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setStatusDescription(statusDescription); + } + + + @Test + public void testToString() throws Exception { + RestResponseAsByteArray testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.toString(); + } + + + @Test + public void testToPrettyString() throws Exception { + RestResponseAsByteArray testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.toPrettyString(); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/rest/api/RestResponseTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/rest/api/RestResponseTest.java new file mode 100644 index 0000000000..c7fe36581d --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/rest/api/RestResponseTest.java @@ -0,0 +1,90 @@ +package org.openecomp.sdc.common.rest.api; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class RestResponseTest { + + private RestResponse createTestSubject() { + return new RestResponse("", "", 0); + } + + + @Test + public void testGetResponse() throws Exception { + RestResponse testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getResponse(); + } + + + @Test + public void testSetResponse() throws Exception { + RestResponse testSubject; + String response = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setResponse(response); + } + + + @Test + public void testGetHttpStatusCode() throws Exception { + RestResponse testSubject; + int result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getHttpStatusCode(); + } + + + @Test + public void testSetHttpStatusCode() throws Exception { + RestResponse testSubject; + int httpStatusCode = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setHttpStatusCode(httpStatusCode); + } + + + @Test + public void testGetStatusDescription() throws Exception { + RestResponse testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getStatusDescription(); + } + + + @Test + public void testSetStatusDescription() throws Exception { + RestResponse testSubject; + String statusDescription = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setStatusDescription(statusDescription); + } + + + @Test + public void testToString() throws Exception { + RestResponse testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.toString(); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/util/CapabilityTypeNameEnumTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/util/CapabilityTypeNameEnumTest.java new file mode 100644 index 0000000000..405da1076c --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/util/CapabilityTypeNameEnumTest.java @@ -0,0 +1,24 @@ +package org.openecomp.sdc.common.util; + +import javax.annotation.Generated; + +import org.junit.Test; + + +public class CapabilityTypeNameEnumTest { + + private CapabilityTypeNameEnum createTestSubject() { + return CapabilityTypeNameEnum.ATTACHMENT; + } + + + @Test + public void testGetCapabilityName() throws Exception { + CapabilityTypeNameEnum testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getCapabilityName(); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/util/GeneralUtilityTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/util/GeneralUtilityTest.java new file mode 100644 index 0000000000..f574accd13 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/util/GeneralUtilityTest.java @@ -0,0 +1,126 @@ +package org.openecomp.sdc.common.util; + +import java.util.List; + +import javax.annotation.Generated; + +import org.junit.Assert; +import org.junit.Test; + + +public class GeneralUtilityTest { + + private GeneralUtility createTestSubject() { + return new GeneralUtility(); + } + + + @Test + public void testGenerateTextFile() throws Exception { + String fileName = ""; + String fileData = ""; + boolean result; + + // default test + result = GeneralUtility.generateTextFile(fileName, fileData); + } + + + @Test + public void testIsBase64Encoded() throws Exception { + byte[] data = new byte[] { ' ' }; + boolean result; + + // default test + result = GeneralUtility.isBase64Encoded(data); + } + + + @Test + public void testIsBase64Encoded_1() throws Exception { + String str = ""; + boolean result; + + // default test + result = GeneralUtility.isBase64Encoded(str); + } + + + @Test + public void testIsExceedingLimit() throws Exception { + String str = ""; + int limit = 0; + boolean result; + + // test 1 + str = null; + result = GeneralUtility.isExceedingLimit(str, limit); + Assert.assertEquals(false, result); + + // test 2 + str = ""; + result = GeneralUtility.isExceedingLimit(str, limit); + Assert.assertEquals(false, result); + } + + + @Test + public void testIsExceedingLimit_1() throws Exception { + List<String> strList = null; + int limit = 0; + int delimiterLength = 0; + boolean result; + + // test 1 + strList = null; + result = GeneralUtility.isExceedingLimit(strList, limit, delimiterLength); + Assert.assertEquals(false, result); + } + + + @Test + public void testGetFilenameExtension() throws Exception { + String fileName = ""; + String result; + + // test 1 + fileName = null; + result = GeneralUtility.getFilenameExtension(fileName); + Assert.assertEquals("", result); + + // test 2 + fileName = ""; + result = GeneralUtility.getFilenameExtension(fileName); + Assert.assertEquals("", result); + } + + + @Test + public void testCalculateMD5Base64EncodedByByteArray() throws Exception { + byte[] payload = new byte[] { ' ' }; + String result; + + // default test + result = GeneralUtility.calculateMD5Base64EncodedByByteArray(payload); + } + + + @Test + public void testCalculateMD5Base64EncodedByString() throws Exception { + String data = ""; + String result; + + // default test + result = GeneralUtility.calculateMD5Base64EncodedByString(data); + } + + + @Test + public void testIsEmptyString() throws Exception { + String str = ""; + boolean result; + + // default test + result = GeneralUtility.isEmptyString(str); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/util/GsonFactoryTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/util/GsonFactoryTest.java new file mode 100644 index 0000000000..c11ccb79ce --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/util/GsonFactoryTest.java @@ -0,0 +1,24 @@ +package org.openecomp.sdc.common.util; + +import javax.annotation.Generated; + +import org.junit.Test; + +import com.google.gson.Gson; + + +public class GsonFactoryTest { + + private GsonFactory createTestSubject() { + return new GsonFactory(); + } + + + @Test + public void testGetGson() throws Exception { + Gson result; + + // default test + result = GsonFactory.getGson(); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/common/util/ValidationUtilsTest.java b/common-app-api/src/test/java/org/openecomp/sdc/common/util/ValidationUtilsTest.java new file mode 100644 index 0000000000..2c4e0b7f00 --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/common/util/ValidationUtilsTest.java @@ -0,0 +1,605 @@ +package org.openecomp.sdc.common.util; + +import java.util.List; + +import javax.annotation.Generated; + +import org.junit.Assert; +import org.junit.Test; + + +public class ValidationUtilsTest { + + private ValidationUtils createTestSubject() { + return new ValidationUtils(); + } + + + @Test + public void testValidateArtifactLabel() throws Exception { + String label = ""; + boolean result; + + // default test + result = ValidationUtils.validateArtifactLabel(label); + } + + + @Test + public void testValidateArtifactDisplayName() throws Exception { + String displayName = ""; + boolean result; + + // default test + result = ValidationUtils.validateArtifactDisplayName(displayName); + } + + + + + @Test + public void testNormalizeCategoryName4Display() throws Exception { + String str = ""; + String result; + + // test 1 + str = "123"; + result = ValidationUtils.normalizeCategoryName4Display(str); + Assert.assertEquals("123", result); + + // test 2 + str = "123#123"; + result = ValidationUtils.normalizeCategoryName4Display(str); + Assert.assertEquals("123#123", result); + } + + + @Test + public void testNormalizeCategoryName4Uniqueness() throws Exception { + String str = ""; + String result; + + // default test + result = ValidationUtils.normalizeCategoryName4Uniqueness(str); + } + + + @Test + public void testValidateCategoryDisplayNameLength() throws Exception { + String label = ""; + boolean result; + + // default test + result = ValidationUtils.validateCategoryDisplayNameLength(label); + } + + + @Test + public void testValidateProductFullNameLength() throws Exception { + String fullName = ""; + boolean result; + + // default test + result = ValidationUtils.validateProductFullNameLength(fullName); + } + + + @Test + public void testValidateArtifactLabelLength() throws Exception { + String label = ""; + boolean result; + + // default test + result = ValidationUtils.validateArtifactLabelLength(label); + } + + + @Test + public void testValidateResourceInstanceNameLength() throws Exception { + String resourceInstanceName = ""; + boolean result; + + // default test + result = ValidationUtils.validateResourceInstanceNameLength(resourceInstanceName); + } + + + @Test + public void testValidateResourceInstanceName() throws Exception { + String resourceInstanceName = ""; + boolean result; + + // default test + result = ValidationUtils.validateResourceInstanceName(resourceInstanceName); + } + + + @Test + public void testValidateUrlLength() throws Exception { + String url = ""; + boolean result; + + // default test + result = ValidationUtils.validateUrlLength(url); + } + + + @Test + public void testValidateArtifactNameLength() throws Exception { + String artifactName = ""; + boolean result; + + // default test + result = ValidationUtils.validateArtifactNameLength(artifactName); + } + + + @Test + public void testValidateComponentNamePattern() throws Exception { + String componentName = ""; + boolean result; + + // default test + result = ValidationUtils.validateComponentNamePattern(componentName); + } + + + @Test + public void testValidateComponentNameLength() throws Exception { + String componentName = ""; + boolean result; + + // default test + result = ValidationUtils.validateComponentNameLength(componentName); + } + + + @Test + public void testValidateIcon() throws Exception { + String icon = ""; + boolean result; + + // default test + result = ValidationUtils.validateIcon(icon); + } + + + @Test + public void testValidateIconLength() throws Exception { + String icon = ""; + boolean result; + + // default test + result = ValidationUtils.validateIconLength(icon); + } + + + @Test + public void testValidateProjectCode() throws Exception { + String projectCode = ""; + boolean result; + + // default test + result = ValidationUtils.validateProjectCode(projectCode); + } + + + @Test + public void testValidateProjectCodeLegth() throws Exception { + String projectCode = ""; + boolean result; + + // default test + result = ValidationUtils.validateProjectCodeLegth(projectCode); + } + + + @Test + public void testValidateContactId() throws Exception { + String contactId = ""; + boolean result; + + // default test + result = ValidationUtils.validateContactId(contactId); + } + + + @Test + public void testValidateCost() throws Exception { + String cost = ""; + boolean result; + + // default test + result = ValidationUtils.validateCost(cost); + } + + + @Test + public void testRemoveHtmlTags() throws Exception { + String str = ""; + String result; + + // default test + result = ValidationUtils.removeHtmlTags(str); + } + + + @Test + public void testRemoveAllTags() throws Exception { + String htmlText = ""; + String result; + + // default test + result = ValidationUtils.removeAllTags(htmlText); + } + + + @Test + public void testNormaliseWhitespace() throws Exception { + String str = ""; + String result; + + // default test + result = ValidationUtils.normaliseWhitespace(str); + } + + + @Test + public void testStripOctets() throws Exception { + String str = ""; + String result; + + // default test + result = ValidationUtils.stripOctets(str); + } + + + @Test + public void testRemoveNoneUtf8Chars() throws Exception { + String input = ""; + String result; + + // default test + result = ValidationUtils.removeNoneUtf8Chars(input); + } + + + @Test + public void testValidateIsEnglish() throws Exception { + String input = ""; + boolean result; + + // default test + result = ValidationUtils.validateIsEnglish(input); + } + + + @Test + public void testValidateIsAscii() throws Exception { + String input = ""; + boolean result; + + // default test + result = ValidationUtils.validateIsAscii(input); + } + + + @Test + public void testConvertHtmlTagsToEntities() throws Exception { + String input = ""; + String result; + + // default test + result = ValidationUtils.convertHtmlTagsToEntities(input); + } + + + + + + + + + @Test + public void testValidateTagListLength() throws Exception { + int tagListLength = 0; + boolean result; + + // default test + result = ValidationUtils.validateTagListLength(tagListLength); + } + + + @Test + public void testValidateDescriptionLength() throws Exception { + String description = ""; + boolean result; + + // default test + result = ValidationUtils.validateDescriptionLength(description); + } + + + @Test + public void testValidateStringNotEmpty() throws Exception { + String value = ""; + boolean result; + + // test 1 + value = null; + result = ValidationUtils.validateStringNotEmpty(value); + Assert.assertEquals(false, result); + + // test 2 + value = ""; + result = ValidationUtils.validateStringNotEmpty(value); + Assert.assertEquals(false, result); + } + + + @Test + public void testValidateListNotEmpty() throws Exception { + List<?> list = null; + boolean result; + + // test 1 + list = null; + result = ValidationUtils.validateListNotEmpty(list); + Assert.assertEquals(false, result); + } + + + @Test + public void testValidateVendorName() throws Exception { + String vendorName = ""; + boolean result; + + // default test + result = ValidationUtils.validateVendorName(vendorName); + } + + + @Test + public void testValidateVendorNameLength() throws Exception { + String vendorName = ""; + boolean result; + + // default test + result = ValidationUtils.validateVendorNameLength(vendorName); + } + + + @Test + public void testValidateResourceVendorModelNumberLength() throws Exception { + String resourceVendorModelNumber = ""; + boolean result; + + // default test + result = ValidationUtils.validateResourceVendorModelNumberLength(resourceVendorModelNumber); + } + + + @Test + public void testValidateVendorRelease() throws Exception { + String vendorRelease = ""; + boolean result; + + // default test + result = ValidationUtils.validateVendorRelease(vendorRelease); + } + + + @Test + public void testValidateVendorReleaseLength() throws Exception { + String vendorRelease = ""; + boolean result; + + // default test + result = ValidationUtils.validateVendorReleaseLength(vendorRelease); + } + + + @Test + public void testValidateServiceTypeLength() throws Exception { + String serviceType = ""; + boolean result; + + // default test + result = ValidationUtils.validateServiceTypeLength(serviceType); + } + + + @Test + public void testValidateServiceRoleLength() throws Exception { + String serviceRole = ""; + boolean result; + + // default test + result = ValidationUtils.validateServiceRoleLength(serviceRole); + } + + + @Test + public void testHasBeenCertified() throws Exception { + String version = ""; + boolean result; + + // default test + result = ValidationUtils.hasBeenCertified(version); + } + + + @Test + public void testNormaliseComponentName() throws Exception { + String name = ""; + String result; + + // default test + result = ValidationUtils.normaliseComponentName(name); + } + + + @Test + public void testNormalizeComponentInstanceName() throws Exception { + String name = ""; + String result; + + // default test + result = ValidationUtils.normalizeComponentInstanceName(name); + } + + + + + + @Test + public void testConvertToSystemName() throws Exception { + String name = ""; + String result; + + // default test + result = ValidationUtils.convertToSystemName(name); + } + + + @Test + public void testNormalizeFileName() throws Exception { + String filename = ""; + String result; + + // default test + result = ValidationUtils.normalizeFileName(filename); + } + + + + + + @Test + public void testValidateUrl() throws Exception { + String url = ""; + boolean result; + + // default test + result = ValidationUtils.validateUrl(url); + } + + + @Test + public void testCleanArtifactDisplayName() throws Exception { + String strIn = ""; + String result; + + // default test + result = ValidationUtils.cleanArtifactDisplayName(strIn); + } + + + @Test + public void testNormalizeArtifactLabel() throws Exception { + String strIn = ""; + String result; + + // default test + result = ValidationUtils.normalizeArtifactLabel(strIn); + } + + + @Test + public void testValidateAdditionalInformationKeyName() throws Exception { + String str = ""; + boolean result; + + // default test + result = ValidationUtils.validateAdditionalInformationKeyName(str); + } + + + + + + + + + @Test + public void testValidateConsumerName() throws Exception { + String consumerName = ""; + boolean result; + + // default test + result = ValidationUtils.validateConsumerName(consumerName); + } + + + @Test + public void testIsUTF8Str() throws Exception { + String str = ""; + boolean result; + + // default test + result = ValidationUtils.isUTF8Str(str); + } + + + @Test + public void testValidateConsumerPassSalt() throws Exception { + String consumerSalt = ""; + boolean result; + + // default test + result = ValidationUtils.validateConsumerPassSalt(consumerSalt); + } + + + @Test + public void testIsFloatNumber() throws Exception { + String number = ""; + boolean result; + + // default test + result = ValidationUtils.isFloatNumber(number); + } + + + @Test + public void testValidateCertifiedVersion() throws Exception { + String version = ""; + boolean result; + + // default test + result = ValidationUtils.validateCertifiedVersion(version); + } + + + @Test + public void testValidateMinorVersion() throws Exception { + String version = ""; + boolean result; + + // default test + result = ValidationUtils.validateMinorVersion(version); + } + + + @Test + public void testNormaliseProductName() throws Exception { + String name = ""; + String result; + + // default test + result = ValidationUtils.normaliseProductName(name); + } + + + + + + @Test + public void testRemoveHtmlTagsOnly() throws Exception { + String htmlText = ""; + String result; + + // default test + result = ValidationUtils.removeHtmlTagsOnly(htmlText); + } +}
\ No newline at end of file diff --git a/common-app-api/src/test/java/org/openecomp/sdc/fe/config/ConfigurationTest.java b/common-app-api/src/test/java/org/openecomp/sdc/fe/config/ConfigurationTest.java new file mode 100644 index 0000000000..d034f2ddfa --- /dev/null +++ b/common-app-api/src/test/java/org/openecomp/sdc/fe/config/ConfigurationTest.java @@ -0,0 +1,543 @@ +package org.openecomp.sdc.fe.config; + +import java.util.Date; +import java.util.List; + +import javax.annotation.Generated; + +import org.junit.Test; +import org.openecomp.sdc.be.config.Configuration.OnboardingConfig; +import org.openecomp.sdc.fe.config.Configuration.FeMonitoringConfig; + + +public class ConfigurationTest { + + private Configuration createTestSubject() { + return new Configuration(); + } + + + @Test + public void testGetKibanaProtocol() throws Exception { + Configuration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getKibanaProtocol(); + } + + + @Test + public void testSetKibanaProtocol() throws Exception { + Configuration testSubject; + String kibanaProtocol = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setKibanaProtocol(kibanaProtocol); + } + + + @Test + public void testGetKibanaHost() throws Exception { + Configuration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getKibanaHost(); + } + + + @Test + public void testSetKibanaHost() throws Exception { + Configuration testSubject; + String kibanaHost = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setKibanaHost(kibanaHost); + } + + + @Test + public void testGetKibanaPort() throws Exception { + Configuration testSubject; + Integer result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getKibanaPort(); + } + + + @Test + public void testSetKibanaPort() throws Exception { + Configuration testSubject; + Integer kibanaPort = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setKibanaPort(kibanaPort); + } + + + @Test + public void testGetSystemMonitoring() throws Exception { + Configuration testSubject; + FeMonitoringConfig result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getSystemMonitoring(); + } + + + @Test + public void testSetSystemMonitoring() throws Exception { + Configuration testSubject; + FeMonitoringConfig systemMonitoring = null; + + // default test + testSubject = createTestSubject(); + testSubject.setSystemMonitoring(systemMonitoring); + } + + + @Test + public void testGetHealthCheckSocketTimeoutInMs() throws Exception { + Configuration testSubject; + Integer result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getHealthCheckSocketTimeoutInMs(); + } + + + @Test + public void testGetHealthCheckSocketTimeoutInMs_1() throws Exception { + Configuration testSubject; + int defaultVal = 0; + Integer result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getHealthCheckSocketTimeoutInMs(defaultVal); + } + + + @Test + public void testSetHealthCheckSocketTimeoutInMs() throws Exception { + Configuration testSubject; + Integer healthCheckSocketTimeout = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setHealthCheckSocketTimeoutInMs(healthCheckSocketTimeout); + } + + + @Test + public void testGetHealthCheckIntervalInSeconds() throws Exception { + Configuration testSubject; + Integer result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getHealthCheckIntervalInSeconds(); + } + + + @Test + public void testGetHealthCheckIntervalInSeconds_1() throws Exception { + Configuration testSubject; + int defaultVal = 0; + Integer result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getHealthCheckIntervalInSeconds(defaultVal); + } + + + @Test + public void testSetHealthCheckIntervalInSeconds() throws Exception { + Configuration testSubject; + Integer healthCheckInterval = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setHealthCheckIntervalInSeconds(healthCheckInterval); + } + + + @Test + public void testGetReleased() throws Exception { + Configuration testSubject; + Date result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getReleased(); + } + + + @Test + public void testGetVersion() throws Exception { + Configuration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getVersion(); + } + + + @Test + public void testSetReleased() throws Exception { + Configuration testSubject; + Date released = null; + + // default test + testSubject = createTestSubject(); + testSubject.setReleased(released); + } + + + @Test + public void testSetVersion() throws Exception { + Configuration testSubject; + String version = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setVersion(version); + } + + + @Test + public void testGetConnection() throws Exception { + Configuration testSubject; + Connection result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getConnection(); + } + + + @Test + public void testSetConnection() throws Exception { + Configuration testSubject; + Connection connection = null; + + // default test + testSubject = createTestSubject(); + testSubject.setConnection(connection); + } + + + @Test + public void testGetProtocols() throws Exception { + Configuration testSubject; + List<String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getProtocols(); + } + + + @Test + public void testSetProtocols() throws Exception { + Configuration testSubject; + List<String> protocols = null; + + // default test + testSubject = createTestSubject(); + testSubject.setProtocols(protocols); + } + + + @Test + public void testGetBeHost() throws Exception { + Configuration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getBeHost(); + } + + + @Test + public void testSetBeHost() throws Exception { + Configuration testSubject; + String beHost = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setBeHost(beHost); + } + + + @Test + public void testGetBeHttpPort() throws Exception { + Configuration testSubject; + Integer result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getBeHttpPort(); + } + + + @Test + public void testSetBeHttpPort() throws Exception { + Configuration testSubject; + Integer beHttpPort = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setBeHttpPort(beHttpPort); + } + + + @Test + public void testGetBeSslPort() throws Exception { + Configuration testSubject; + Integer result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getBeSslPort(); + } + + + @Test + public void testSetBeSslPort() throws Exception { + Configuration testSubject; + Integer beSslPort = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setBeSslPort(beSslPort); + } + + + @Test + public void testGetBeContext() throws Exception { + Configuration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getBeContext(); + } + + + @Test + public void testSetBeContext() throws Exception { + Configuration testSubject; + String beContext = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setBeContext(beContext); + } + + + @Test + public void testGetBeProtocol() throws Exception { + Configuration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getBeProtocol(); + } + + + @Test + public void testSetBeProtocol() throws Exception { + Configuration testSubject; + String beProtocol = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setBeProtocol(beProtocol); + } + + + @Test + public void testGetThreadpoolSize() throws Exception { + Configuration testSubject; + int result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getThreadpoolSize(); + } + + + @Test + public void testSetThreadpoolSize() throws Exception { + Configuration testSubject; + int threadpoolSize = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setThreadpoolSize(threadpoolSize); + } + + + @Test + public void testGetRequestTimeout() throws Exception { + Configuration testSubject; + int result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getRequestTimeout(); + } + + + @Test + public void testSetRequestTimeout() throws Exception { + Configuration testSubject; + int requestTimeout = 0; + + // default test + testSubject = createTestSubject(); + testSubject.setRequestTimeout(requestTimeout); + } + + + @Test + public void testGetIdentificationHeaderFields() throws Exception { + Configuration testSubject; + List<List<String>> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getIdentificationHeaderFields(); + } + + + @Test + public void testSetIdentificationHeaderFields() throws Exception { + Configuration testSubject; + List<List<String>> identificationHeaderFields = null; + + // default test + testSubject = createTestSubject(); + testSubject.setIdentificationHeaderFields(identificationHeaderFields); + } + + + @Test + public void testGetOptionalHeaderFields() throws Exception { + Configuration testSubject; + List<List<String>> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getOptionalHeaderFields(); + } + + + @Test + public void testSetOptionalHeaderFields() throws Exception { + Configuration testSubject; + List<List<String>> optionalHeaderFields = null; + + // default test + testSubject = createTestSubject(); + testSubject.setOptionalHeaderFields(optionalHeaderFields); + } + + + @Test + public void testGetForwardHeaderFields() throws Exception { + Configuration testSubject; + List<String> result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getForwardHeaderFields(); + } + + + @Test + public void testSetForwardHeaderFields() throws Exception { + Configuration testSubject; + List<String> forwardHeaderFields = null; + + // default test + testSubject = createTestSubject(); + testSubject.setForwardHeaderFields(forwardHeaderFields); + } + + + @Test + public void testGetFeFqdn() throws Exception { + Configuration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getFeFqdn(); + } + + + @Test + public void testSetFeFqdn() throws Exception { + Configuration testSubject; + String feFqdn = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setFeFqdn(feFqdn); + } + + + @Test + public void testGetOnboardingForwardContext() throws Exception { + Configuration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.getOnboardingForwardContext(); + } + + + @Test + public void testSetOnboardingForwardContext() throws Exception { + Configuration testSubject; + String onboardingForwardContext = ""; + + // default test + testSubject = createTestSubject(); + testSubject.setOnboardingForwardContext(onboardingForwardContext); + } + + + + + + + + + @Test + public void testToString() throws Exception { + Configuration testSubject; + String result; + + // default test + testSubject = createTestSubject(); + result = testSubject.toString(); + } +}
\ No newline at end of file diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ComponentQuestionnaireHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ComponentQuestionnaireHealer.java index d061556e4c..4dadb97f71 100644 --- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ComponentQuestionnaireHealer.java +++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ComponentQuestionnaireHealer.java @@ -19,6 +19,7 @@ import org.openecomp.sdc.versioning.dao.types.Version; import java.util.Collection; import java.util.Map; +import java.util.Objects; public class ComponentQuestionnaireHealer implements Healer { @@ -59,8 +60,10 @@ public class ComponentQuestionnaireHealer implements Healer { Collection<ComponentEntity> componentEntities = componentDao.list(new ComponentEntity(vspId, version, null)); componentEntities.forEach(componentEntity -> { - String questionnaire = componentDao.getQuestionnaireData(vspId, version, componentEntity - .getId()).getQuestionnaireData(); + ComponentEntity componentQuestionnaireData = + componentDao.getQuestionnaireData(vspId, version, componentEntity.getId()); + String questionnaire = Objects.isNull(componentQuestionnaireData) ? null + : componentQuestionnaireData.getQuestionnaireData(); if (questionnaire != null) { JsonParser jsonParser = new JsonParser(); @@ -97,7 +100,6 @@ public class ComponentQuestionnaireHealer implements Healer { * Move Disk Atributes from genral/image/ to genral/disk in component questionnaire itself * @param json * @param diskAttrName - * @param diskJsonObject * @return */ private void processDiskAttribute(JsonObject json, String diskAttrName) { diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/SubEntitiesQuestionnaireHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/SubEntitiesQuestionnaireHealer.java index 130405be1d..9355eb076f 100644 --- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/SubEntitiesQuestionnaireHealer.java +++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/SubEntitiesQuestionnaireHealer.java @@ -55,6 +55,9 @@ public class SubEntitiesQuestionnaireHealer implements Healer { private static NicDao nicDao = NicDaoFactory.getInstance().createInterface(); private static NetworkDao networkDao = NetworkDaoFactory.getInstance().createInterface(); + private static String emptyString = ""; + private static String emptyJson = "{}"; + @Override public Object heal(Map<String, Object> healingParams) throws Exception { @@ -90,8 +93,7 @@ public class SubEntitiesQuestionnaireHealer implements Healer { for (Object entity : compositionEntities) { CompositionEntity compositionEntity = (CompositionEntity) entity; - if (Objects.isNull(compositionEntity.getQuestionnaireData()) || - "".equals(compositionEntity.getQuestionnaireData())) { + if (isQuestionnaireNeedsToGetHealed(compositionEntity)) { compositionEntity.setVersion(newVersion); updateNullQuestionnaire(compositionEntity, type); } @@ -100,6 +102,12 @@ public class SubEntitiesQuestionnaireHealer implements Healer { mdcDataDebugMessage.debugExitMessage(null); } + private boolean isQuestionnaireNeedsToGetHealed(CompositionEntity compositionEntity) { + return Objects.isNull(compositionEntity.getQuestionnaireData()) + || emptyString.equals(compositionEntity.getQuestionnaireData()) + || emptyJson.equals(compositionEntity.getQuestionnaireData()); + } + private void updateNullQuestionnaire(CompositionEntity entity, CompositionEntityType type) { diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ValidationStructureHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ValidationStructureHealer.java index 58ba3b7c35..4bf7e18091 100644 --- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ValidationStructureHealer.java +++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ValidationStructureHealer.java @@ -48,6 +48,11 @@ public class ValidationStructureHealer implements Healer { UploadDataEntity orchestrationTemplate = orchestrationTemplateDao.getOrchestrationTemplate(vspId, version); + if(Objects.isNull(orchestrationTemplate.getValidationData()) + || !JsonUtil.isValidJson(orchestrationTemplate.getValidationData())){ + return Optional.empty(); + } + OldValidationStructureTree oldValidationStructureTree; try{ oldValidationStructureTree = diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/VlmVersionHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/VlmVersionHealer.java index 4accd790ab..085923b8a0 100644 --- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/VlmVersionHealer.java +++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/VlmVersionHealer.java @@ -1,5 +1,6 @@ package org.openecomp.sdc.healing.healers; +import org.apache.commons.collections4.CollectionUtils; import org.openecomp.sdc.common.utils.SdcCommon; import org.openecomp.sdc.healing.interfaces.Healer; import org.openecomp.sdc.logging.api.Logger; @@ -15,6 +16,7 @@ import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; import org.openecomp.sdc.versioning.dao.types.Version; +import org.openecomp.sdc.versioning.types.VersionInfo; import java.util.ArrayList; import java.util.List; @@ -60,7 +62,7 @@ public class VlmVersionHealer implements Healer { VendorLicenseModelEntity vlm = vendorLicenseModel.getVendorLicenseModel(); String vlmId = vlm.getId(); - Version vlmVersion = vlm.getVersion(); + Version vlmVersion = getLatestFinalVlmVersion(vendorLicenseModel.getVersionInfo()); List<LicenseAgreementEntity> laList = new ArrayList<>( @@ -68,12 +70,19 @@ public class VlmVersionHealer implements Healer { vspDetails.setVlmVersion(vlmVersion); - vspDetails.setLicenseAgreement(laList.get(0).getId()); - vspDetails.setFeatureGroups(new ArrayList<>(laList.get(0).getFeatureGroupIds())); - vspInfoDao.update(vspDetails); + if(CollectionUtils.isNotEmpty(laList)) { + vspDetails.setLicenseAgreement(laList.get(0).getId()); + vspDetails.setFeatureGroups(new ArrayList<>(laList.get(0).getFeatureGroupIds())); + } + vspInfoDao.update(vspDetails); return vspDetails; } + + private Version getLatestFinalVlmVersion(VersionInfo versionInfo){ + return versionInfo.getActiveVersion().isFinal() ? versionInfo.getActiveVersion() + : versionInfo.getLatestFinalVersion(); + } } diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/PortMirroringEnricher.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/PortMirroringEnricher.java index 2fe1416ffc..705773d1fc 100644 --- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/PortMirroringEnricher.java +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/PortMirroringEnricher.java @@ -9,27 +9,34 @@ import org.apache.commons.collections4.MapUtils; import org.openecomp.sdc.datatypes.error.ErrorMessage; import org.openecomp.sdc.enrichment.impl.tosca.model.PortMirroringConnectionPointDescription; import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; +import org.openecomp.sdc.tosca.datatypes.ToscaElementTypes; import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; import org.openecomp.sdc.tosca.datatypes.model.CapabilityAssignment; import org.openecomp.sdc.tosca.datatypes.model.Import; import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; +import org.openecomp.sdc.tosca.datatypes.model.NodeType; import org.openecomp.sdc.tosca.datatypes.model.PropertyDefinition; import org.openecomp.sdc.tosca.datatypes.model.RequirementAssignment; import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; import org.openecomp.sdc.tosca.services.DataModelUtil; +import org.openecomp.sdc.tosca.services.ToscaAnalyzerService; import org.openecomp.sdc.tosca.services.ToscaConstants; import org.openecomp.sdc.tosca.services.ToscaUtil; +import org.openecomp.sdc.tosca.services.impl.ToscaAnalyzerServiceImpl; import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; import org.openecomp.sdc.translator.services.heattotosca.globaltypes.GlobalTypesGenerator; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; +import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; public class PortMirroringEnricher { @@ -186,40 +193,40 @@ public class PortMirroringEnricher { addPortMirroringSubstitutionMappingCapability(serviceTemplate, externalPortNodeTemplateId); } - handleExternalPortProperties(externalNodeTemplate.getValue()); + handleExternalPortProperties(externalNodeTemplate.getValue(), serviceTemplate, toscaServiceModel); } addGlobalTypeImport(serviceTemplate); } } } - private void handleExternalPortProperties(NodeTemplate portNodeTemplate) { + private void handleExternalPortProperties(NodeTemplate portNodeTemplate, + ServiceTemplate serviceTemplate, + ToscaServiceModel toscaServiceModel){ - ServiceTemplate serviceTemplate = globalTypesServiceTemplate.get("openecomp/nodes.yml"); + ToscaAnalyzerService toscaAnalyzerService = new ToscaAnalyzerServiceImpl(); String externalPortType = portNodeTemplate.getType(); Map<String, PropertyDefinition> globalTypesportProperties = new HashMap<>(); - globalTypesportProperties.putAll( - serviceTemplate.getNode_types().get("org.openecomp.resource.cp.nodes.network.Port") - .getProperties()); - globalTypesportProperties - .putAll(serviceTemplate.getNode_types().get(externalPortType).getProperties()); + NodeType flatNodeType = + (NodeType) toscaAnalyzerService.getFlatEntity(ToscaElementTypes.NODE_TYPE, externalPortType, serviceTemplate, toscaServiceModel); + globalTypesportProperties.putAll(flatNodeType.getProperties()); Map<String, Object> properties = portNodeTemplate.getProperties(); Map<String, Object> filteredProperties = new HashMap<>(); - if (MapUtils.isEmpty(properties)) { + if(MapUtils.isEmpty(properties)){ return; } - for (Map.Entry<String, Object> propertyEntry : properties.entrySet()) { - if (globalTypesportProperties.containsKey(propertyEntry.getKey())) { + for(Map.Entry<String, Object> propertyEntry: properties.entrySet()){ + if(globalTypesportProperties.containsKey(propertyEntry.getKey())){ filteredProperties.put(propertyEntry.getKey(), propertyEntry.getValue()); } } - if (!MapUtils.isEmpty(filteredProperties)) { + if(!MapUtils.isEmpty(filteredProperties)) { portNodeTemplate.setProperties(filteredProperties); - } else { + }else{ portNodeTemplate.setProperties(null); } @@ -284,14 +291,15 @@ public class PortMirroringEnricher { private boolean isPortNodeTemplate(String nodeType) { //Check if node corresponds to a concrete port node - if (Objects.nonNull(nodeType)) { - if (nodeType.equals(ToscaNodeType.NEUTRON_PORT) - || nodeType.equals(ToscaNodeType.CONTRAILV2_VIRTUAL_MACHINE_INTERFACE) - || nodeType.equals(ToscaNodeType.CONTRAIL_PORT)) { - return true; - } - } - return false; + Set<String> portNodeTypes = getPortNodeTypes(); + return Objects.nonNull(nodeType) + && portNodeTypes.contains(nodeType); + } + + private Set<String> getPortNodeTypes(){ + return new HashSet<>(Arrays.asList(ToscaNodeType.NEUTRON_PORT, + ToscaNodeType.CONTRAILV2_VIRTUAL_MACHINE_INTERFACE, + ToscaNodeType.CONTRAIL_PORT)); } private boolean isSubstitutableNodeTemplate(NodeTemplate nodeTemplate) { diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/resources/mock/toscaGlobalServiceTemplates/openecomp/nodes.yml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/resources/mock/toscaGlobalServiceTemplates/openecomp/nodes.yml index 83516a22ba..810bf304c1 100644 --- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/resources/mock/toscaGlobalServiceTemplates/openecomp/nodes.yml +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/resources/mock/toscaGlobalServiceTemplates/openecomp/nodes.yml @@ -1,308 +1,316 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + tosca_definitions_version: tosca_simple_openecomp_1_0 + metadata: filename: openecomp/nodes.yml version: '1.0' + imports: - openecomp_index: file: _index.yml + node_types: - org.openecomp.resource.vl.nodes.network.VL: + + org.openecomp.resource.vl.nodes.network.Network: derived_from: tosca.nodes.network.Network properties: vendor: type: string required: false - status: SUPPORTED vl_name: type: string required: false - status: SUPPORTED capabilities: end_point: type: tosca.capabilities.Endpoint - occurrences: - - 1 - - UNBOUNDED + org.openecomp.resource.abstract.nodes.AbstractSubstitute: derived_from: tosca.nodes.Root properties: service_template_filter: - type: org.openecomp.datatypes.substitution.SubstitutionFiltering description: Substitution Filter - required: true + type: org.openecomp.datatypes.substitution.SubstitutionFiltering status: SUPPORTED + required: true + org.openecomp.resource.vl.extVL: - derived_from: org.openecomp.resource.vl.nodes.network.VL + derived_from: org.openecomp.resource.vl.nodes.network.Network description: VF Tenant oam protected network properties: network_type: - type: string description: OPENECOMP supported network types. + type: string required: true - status: SUPPORTED network_role: - type: string description: | Unique label that defines the role that this network performs. example: vce oam network, vnat sr-iov1 network + type: string required: true - status: SUPPORTED network_scope: - type: string description: | Uniquely identifies the network scope. Valid values for the network scope includes: VF - VF-level network. Intra-VF network which connects the VFCs (VMs) inside the VF. SERVICE - Service-level network. Intra-Service network which connects the VFs within the service GLOBAL - Global network which can be shared by multiple services - required: true - status: SUPPORTED + type: string constraints: - valid_values: - VF - SERVICE - GLOBAL network_technology: - type: string description: OPENECOMP supported network technology + type: string required: true - status: SUPPORTED network_ecomp_naming: type: org.openecomp.datatypes.EcompNaming required: true - status: SUPPORTED network_homing: type: org.openecomp.datatypes.EcompHoming required: true - status: SUPPORTED network_assignments: type: org.openecomp.datatypes.network.NetworkAssignments required: true - status: SUPPORTED provider_network: type: org.openecomp.datatypes.network.ProviderNetwork required: true - status: SUPPORTED network_flows: type: org.openecomp.datatypes.network.NetworkFlows required: false - status: SUPPORTED + + org.openecomp.resource.vfc.nodes.Compute: derived_from: tosca.nodes.Compute capabilities: disk.ephemeral.size: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED instance: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED memory: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.iops: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.device.read.requests: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED cpu.delta: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.capacity: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.device.read.bytes: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.write.bytes: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.latency: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.device.read.bytes.rate: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.usage: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED cpu_util: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.device.allocation: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.write.requests.rate: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.write.bytes.rate: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.device.latency: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED cpu: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.device.write.requests: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.device.write.bytes: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.read.requests: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.root.size: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.device.write.bytes.rate: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED vcpus: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.device.iops: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.device.usage: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.device.read.requests.rate: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.device.write.requests.rate: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.allocation: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.read.bytes.rate: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.read.bytes: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED memory.usage: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.device.capacity: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED memory.resident: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED disk.write.requests: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED + org.openecomp.resource.abstract.nodes.DFAbstractSubstitute: derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute properties: license_feature_group_ref: - type: string description: refrence to license feature group - required: true + type: string status: SUPPORTED + required: true requirements: - deployment_flavor: capability: org.openecomp.capabilities.attachment.DeploymentFlavor @@ -311,191 +319,222 @@ node_types: occurrences: - 1 - UNBOUNDED + + org.openecomp.resource.abstract.nodes.ComplexVFC: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + org.openecomp.resource.abstract.nodes.VFC: derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute properties: high_availablity: - type: string description: high_availablity - required: false + type: string status: SUPPORTED + required: false vm_image_name: - type: string description: Master image_name volume id - required: true + type: string status: SUPPORTED + required: true vm_flavor_name: - type: string description: Master image_name volume id - required: true + type: string status: SUPPORTED + required: true nfc_naming_code: - type: string description: nfc code for instance naming + type: string + status: SUPPORTED required: false + nfc_code: + type: string + description: nfc code status: SUPPORTED - vm_type_tag: + required: false + nfc_function: type: string - description: vm type based on naming Convention + description: nfc function + status: SUPPORTED required: false + vm_type_tag: + description: vm type based on naming Convention + type: string status: SUPPORTED + required: false vfc_naming: - type: org.openecomp.datatypes.Naming description: vfc naming - required: false - default: false + type: org.openecomp.datatypes.Naming status: SUPPORTED + default: false + required: false min_instances: - type: integer description: Minimum number of VFC Instances - required: false - default: 0 + type: integer status: SUPPORTED + default: 0 + required: false constraints: - greater_or_equal: 0 max_instances: - type: integer description: Maximum number of VFC Instances - required: false + type: integer status: SUPPORTED + required: false constraints: - greater_or_equal: 1 + org.openecomp.resource.vl.ELine: - derived_from: org.openecomp.resource.vl.nodes.network.VL + derived_from: org.openecomp.resource.vl.nodes.network.Network capabilities: linkable: type: tosca.capabilities.network.Linkable occurrences: - 0 - 2 + org.openecomp.resource.cp.nodes.network.SubInterface: derived_from: tosca.nodes.network.Port + org.openecomp.resource.vl.internalVL: - derived_from: org.openecomp.resource.vl.nodes.network.VL + derived_from: org.openecomp.resource.vl.nodes.network.Network description: The AT&T internal (VF-level) Virtual Link - org.openecomp.resource.cp.nodes.network.CP: - derived_from: tosca.nodes.network.Port + + org.openecomp.resource.cp.nodes.network.Port: + derived_from: tosca.nodes.network.Port properties: network_role_tag: - type: string description: Must correlate to the set of defined “network-role�? tag identifiers from the associated HEAT template + type: string required: true - status: SUPPORTED mac_requirements: - type: org.openecomp.datatypes.network.MacRequirements description: identifies MAC address assignments to the CP + type: org.openecomp.datatypes.network.MacRequirements required: false - status: SUPPORTED vlan_requirements: - type: list description: identifies vlan address assignments to the CP - required: false - status: SUPPORTED + type: list entry_schema: type: org.openecomp.datatypes.network.VlanRequirements + required: false ip_requirements: - type: list description: identifies IP requirements to the CP - required: true - status: SUPPORTED + type: list entry_schema: type: org.openecomp.datatypes.network.IpRequirements + required: true + network_role: + description: identical to VL network_role + type: string + required: false + order: + description: The order of the CP on the compute instance (e.g. eth2). + type: integer + required: false + exCP_naming: + description: CP Name + type: org.openecomp.datatypes.Naming + required: false + subnetpoolid: + description: subnet pool id + type: string + required: false capabilities: network.incoming.packets.rate: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED network.outgoing.bytes: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED network.outgoing.packets.rate: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED network.outpoing.packets: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED network.incoming.bytes.rate: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED network.incoming.bytes: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED network.outgoing.bytes.rate: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED network.incoming.packets: - type: org.openecomp.capabilities.metric.Ceilometer description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + type: org.openecomp.capabilities.metric.Ceilometer occurrences: - 1 - UNBOUNDED + org.openecomp.resource.nodes.DeploymentFlavor: derived_from: tosca.nodes.Root capabilities: deployment_flavor: - type: org.openecomp.capabilities.attachment.DeploymentFlavor description: Allowed deployment flavors of an abstract node + type: org.openecomp.capabilities.attachment.DeploymentFlavor occurrences: - 1 - UNBOUNDED + org.openecomp.resource.cp.extCP: derived_from: tosca.nodes.Root description: The AT&T Connection Point base type all other CP derive from properties: network_role: - type: string description: identical to VL network_role + type: string required: true - status: SUPPORTED order: - type: integer description: The order of the CP on the compute instance (e.g. eth2). + type: integer required: true - status: SUPPORTED network_role_tag: - type: string description: Must correlate to the set of defined “network-role�? tag identifiers from the associated HEAT template + type: string required: true - status: SUPPORTED mac_requirements: - type: org.openecomp.datatypes.network.MacRequirements description: identifies MAC address assignments to the CP + type: org.openecomp.datatypes.network.MacRequirements required: false - status: SUPPORTED vlan_requirements: - type: list description: identifies vlan address assignments to the CP - required: false - status: SUPPORTED + type: list entry_schema: type: org.openecomp.datatypes.network.VlanRequirements + required: false ip_requirements: - type: list description: identifies IP requirements to the CP - required: true - status: SUPPORTED + type: list entry_schema: type: org.openecomp.datatypes.network.IpRequirements + required: true + capabilities: + internal_connectionPoint: + type: tosca.capabilities.Node + valid_source_types: + - tosca.nodes.network.Port requirements: - virtualLink: capability: tosca.capabilities.network.Linkable @@ -505,15 +544,802 @@ node_types: relationship: tosca.relationships.network.BindsTo - external_virtualLink: capability: tosca.capabilities.network.Linkable - node: org.openecomp.resource.vl.nodes.network.VL + node: org.openecomp.resource.vl.nodes.network.Network relationship: tosca.relationships.network.LinksTo + + org.openecomp.resource.vfc.nodes.volume: + derived_from: tosca.nodes.BlockStorage + + ### Node types related to Deployment Flavors + org.openecomp.resource.abstract.nodes.VnfConfiguration: + derived_from: tosca.nodes.Root + description: a container for the available flavors + properties: + allowed_flavors: + description: a collection of all available flavor valuesets + type: map + entry_schema: + type: org.openecomp.datatypes.flavors.DeploymentFlavor + + org.openecomp.resource.abstract.nodes.MultiFlavorVFC: + derived_from: org.openecomp.resource.abstract.nodes.VFC + description: Multi flavored VFC node + properties: + images: + type: map + entry_schema: + type: org.openecomp.datatypes.ImageInfo + required: false + + ## New node types for Port Mirroring + org.openecomp.nodes.ServiceProxy: + derived_from: tosca.nodes.Root + + org.openecomp.nodes.PortMirroringConfiguration: + derived_from: tosca.nodes.Root + requirements: + - source: + capability: org.openecomp.capabilities.PortMirroring + occurrences: + - 1 + - UNBOUNDED + - collector: + capability: org.openecomp.capabilities.PortMirroring + occurrences: + - 1 + - 1 + + org.openecomp.resource.cp.v2.extCP: + derived_from: org.openecomp.resource.cp.nodes.network.Port + description: The SDC External Connection Point base type capabilities: - internal_connectionPoint: - type: tosca.capabilities.Node - valid_source_types: - - tosca.nodes.network.Port + port_mirroring: + type: org.openecomp.capabilities.PortMirroring + + org.openecomp.resource.cp.v2.extNeutronCP: + derived_from: org.openecomp.resource.cp.v2.extCP + properties: + port_security_enabled: + type: boolean + description: Flag to enable/disable port security on the network + required: false + status: SUPPORTED + device_id: + type: string + description: Device ID of this port + required: false + status: SUPPORTED + qos_policy: + type: string + description: The name or ID of QoS policy to attach to this network + required: false + status: SUPPORTED + allowed_address_pairs: + type: list + description: Additional MAC/IP address pairs allowed to pass through the port + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.AddressPair + binding:vnic_type: + type: string + description: The vnic type to be bound on the neutron port + required: false + status: SUPPORTED + constraints: + - valid_values: + - macvtap + - direct + - normal + value_specs: + type: map + description: Extra parameters to include in the request + required: false + default: { + } + status: SUPPORTED + entry_schema: + type: string + device_owner: + type: string + description: Name of the network owning the port + required: false + status: SUPPORTED + network: + type: string + description: Network this port belongs to + required: false + status: SUPPORTED + replacement_policy: + type: string + description: Policy on how to respond to a stack-update for this resource + required: false + default: AUTO + status: SUPPORTED + constraints: + - valid_values: + - REPLACE_ALWAYS + - AUTO + security_groups: + type: list + description: List of security group names or IDs + required: false + status: SUPPORTED + entry_schema: + type: string + fixed_ips: + type: list + description: Desired IPs for this port + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.neutron.port.FixedIps + mac_address: + type: string + description: MAC address to give to this port + required: false + status: SUPPORTED + admin_state_up: + type: boolean + description: A boolean value specifying the administrative status of the network + required: false + default: true + status: SUPPORTED + name: + type: string + description: A symbolic name for this port + required: false + status: SUPPORTED + attributes: + tenant_id: + type: string + description: Tenant owning the port + status: SUPPORTED + network_id: + type: string + description: Unique identifier for the network owning the port + status: SUPPORTED + qos_policy_id: + type: string + description: The QoS policy ID attached to this network + status: SUPPORTED + show: + type: string + description: Detailed information about resource + status: SUPPORTED + subnets: + type: list + description: Subnets of this network + status: SUPPORTED + entry_schema: + type: string + status: + type: string + description: The status of the network + status: SUPPORTED + capabilities: + attachment: + type: tosca.capabilities.Attachment occurrences: - 1 - UNBOUNDED - org.openecomp.resource.vfc.nodes.volume: - derived_from: tosca.nodes.BlockStorage + binding: + type: tosca.capabilities.network.Bindable + valid_source_types: + - org.openecomp.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface + occurrences: + - 0 + - UNBOUNDED + + org.openecomp.resource.cp.v2.extContrailCP: + derived_from: org.openecomp.resource.cp.v2.extCP + properties: + static_routes: + type: list + description: An ordered list of static routes to be added to this interface + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.contrail.port.StaticRoute + virtual_network: + type: string + description: Virtual Network for this interface + required: true + status: SUPPORTED + static_route: + type: boolean + description: Static route enabled + required: false + default: false + status: SUPPORTED + allowed_address_pairs: + type: list + description: List of allowed address pair for this interface + required: false + status: SUPPORTED + entry_schema: + type: org.openecomp.datatypes.heat.network.contrail.AddressPair + shared_ip: + type: boolean + description: Shared ip enabled + required: false + default: false + status: SUPPORTED + ip_address: + type: string + description: IP for this interface + required: false + status: SUPPORTED + interface_type: + type: string + description: Interface type + required: true + status: SUPPORTED + constraints: + - valid_values: + - management + - left + - right + - other + attributes: + fq_name: + type: string + description: fq_name + status: SUPPORTED + tosca.nodes.nfv.NS.vEPC_NS: + derived_from: tosca.nodes.nfv.NS + properties: + vendor: + default: ChinaMobile + required: false + type: string + csarVersion: + default: v1.0 + required: false + type: string + name: + default: vEPC_NS + required: false + type: string + csarProvider: + default: ChinaMobile + required: false + type: string + id: + default: vEPC_NS + required: false + type: string + version: + default: v1.0 + required: false + type: string + csarType: + default: NSAR + required: false + type: string + requirements: + - virtualLink: + capability: tosca.capabilities.nfv.VirtualLinkable + occurrences: + - 0 + - UNBOUNDED + + tosca.nodes.nfv.NS.vIMS_NS: + derived_from: tosca.nodes.nfv.NS + properties: + vendor: + default: ChinaMobile + required: false + type: string + csarVersion: + default: v1.0 + required: false + type: string + name: + default: vIMS_NS + required: false + type: string + csarProvider: + default: ChinaMobile + required: false + type: string + id: + default: vIMS_NS + required: false + type: string + version: + default: v1.0 + required: false + type: string + csarType: + default: NSAR + required: false + type: string + requirements: + - virtualLink: + capability: tosca.capabilities.nfv.VirtualLinkable + occurrences: + - 0 + - UNBOUNDED + + tosca.nodes.nfv.NS: + derived_from: tosca.nodes.Root + properties: + vendor: + required: false + type: string + name: + required: false + type: string + id: + required: false + type: string + version: + required: false + type: string + requirements: + - virtualLink: + capability: tosca.capabilities.nfv.VirtualLinkable + occurrences: + - 0 + - UNBOUNDED + + tosca.nodes.nfv.VDU.Compute: + attributes: + private_address: + type: string + public_address: + type: string + networks: + type: string + ports: + type: string + capabilities: + scalable: + type: tosca.capabilities.Scalable + virtual_compute: + type: tosca.capabilities.nfv.VirtualCompute + endpoint: + type: tosca.capabilities.Endpoint.Admin + os: + type: tosca.capabilities.OperatingSystem + virtual_binding: + type: tosca.capabilities.nfv.VirtualBindable + host: + type: tosca.capabilities.Container + binding: + type: tosca.capabilities.network.Bindable + monitoring_parameter: + type: tosca.capabilities.nfv.Metric + derived_from: tosca.nodes.Root + properties: + configurable_properties: + entry_schema: + type: tosca.datatypes.nfv.VnfcConfigurableProperties + type: map + name: + type: string + nfvi_constraints: + entry_schema: + type: string + required: false + type: list + descrption: + type: string + boot_order: + entry_schema: + type: string + required: false + type: list + requirements: + - local_storage: + capability: tosca.capabilities.Attachment + occurrences: + - 0 + - UNBOUNDED + - virtual_storage: + capability: tosca.capabilities.nfv.VirtualStorage + occurrences: + - 0 + - UNBOUNDED + + tosca.nodes.nfv.VDU.VirtualStorage: + capabilities: + virtual_storage: + type: tosca.capabilities.nfv.VirtualStorage + derived_from: tosca.nodes.Root + properties: + id: + type: string + size_of_storage: + type: string + rdma_enabled: + required: false + type: boolean + type_of_storage: + type: string + + tosca.nodes.nfv.VduCpd: + derived_from: tosca.nodes.Root + properties: + virtual_network_interface_requirements: + entry_schema: + type: tosca.datatypes.nfv.VirtualNetworkInterfaceRequirements + required: false + type: list + role: + constraints: + - valid_values: + - root + - leaf + required: false + type: string + bitrate_requirement: + required: false + type: integer + description: + required: false + type: string + layer_protocol: + constraints: + - valid_values: + - ethernet + - mpls + - odu2 + - ipv4 + - ipv6 + - pseudo_wire + type: string + address_data: + entry_schema: + type: tosca.datatype.nfv.AddressData + required: false + type: list + requirements: + - virtual_binding: + capability: tosca.capabilities.nfv.VirtualBindable + occurrences: + - 0 + - UNBOUNDED + - virtual_link: + capability: tosca.capabilities.nfv.VirtualBindable + occurrences: + - 0 + - UNBOUNDED + tosca.nodes.nfv.ext.ImageFile: + capabilities: + guest_os: + type: tosca.capabilities.nfv.ext.GuestOs + image_fle: + type: tosca.capabilities.nfv.ext.ImageFile + derived_from: tosca.nodes.Root + properties: + file_url: + required: false + type: string + container_type: + required: false + type: string + name: + required: false + type: string + disk_format: + required: false + type: string + version: + required: false + type: string + tosca.nodes.nfv.ext.LocalStorage: + capabilities: + local_attachment: + type: tosca.capabilities.nfv.ext.LocalAttachment + derived_from: tosca.nodes.Root + properties: + size: + required: false + type: string + disk_type: + required: false + type: string + tosca.nodes.nfv.ext.zte.CP: + capabilities: + forwarder: + type: tosca.capabilities.nfv.Forwarder + derived_from: tosca.nodes.Root + properties: + guest_os_mtu: + required: false + type: integer + bandwidth: + required: false + type: integer + interface_name: + required: false + type: string + allowed_address_pairs: + entry_schema: + type: tosca.datatypes.nfv.ext.AddressPairs + required: false + type: list + ip_address: + required: false + type: string + bond: + required: false + type: string + proxiedVNFs: + entry_schema: + type: string + required: false + type: list + sfc_encapsulation: + required: false + type: string + floating_ip_address: + required: false + type: tosca.datatypes.nfv.ext.FloatingIP + service_ip_address: + required: false + type: string + mac_address: + required: false + type: string + proxiedVNFtype: + required: false + type: string + macbond: + required: false + type: string + vnic_type: + required: false + type: string + direction: + required: false + type: string + order: + required: false + type: integer + requirements: + - forwarder: + capability: tosca.capabilities.nfv.Forwarder + occurrences: + - 0 + - UNBOUNDED + - virtualbinding: + capability: tosca.capabilities.nfv.VirtualBindable + occurrences: + - 0 + - UNBOUNDED + - virtualLink: + capability: tosca.capabilities.nfv.VirtualBindable + occurrences: + - 0 + - UNBOUNDED + tosca.nodes.nfv.ext.zte.VDU: + capabilities: + scalable: + type: tosca.capabilities.Scalable + monitoring_parameter: + type: tosca.capabilities.nfv.Metric + nfv_compute: + type: tosca.capabilities.nfv.ext.Compute.Container.Architecture + virtualbinding: + type: tosca.capabilities.nfv.VirtualBindable + derived_from: tosca.nodes.Root + properties: + manual_scale_select_vim: + required: false + type: boolean + vdu_type: + required: false + type: string + watchdog: + required: false + type: tosca.datatypes.nfv.ext.zte.WatchDog + name: + required: false + type: string + local_affinity_antiaffinity_rule: + required: false + type: tosca.datatypes.nfv.ext.LocalAffinityOrAntiAffinityRule + support_scaling: + required: false + type: boolean + storage_policy: + required: false + type: string + key_vdu: + required: false + type: boolean + location_info: + required: false + type: tosca.datatypes.nfv.ext.LocationInfo + inject_data_list: + entry_schema: + type: tosca.datatypes.nfv.ext.InjectData + required: false + type: list + requirements: + - guest_os: + capability: tosca.capabilities.nfv.ext.GuestOs + occurrences: + - 0 + - UNBOUNDED + - local_storage: + capability: tosca.capabilities.nfv.ext.LocalAttachment + occurrences: + - 0 + - UNBOUNDED + - volume_storage: + capability: tosca.capabilities.Attachment + occurrences: + - 0 + - UNBOUNDED + - dependency: + capability: tosca.capabilities.Node + occurrences: + - 0 + - UNBOUNDED + tosca.nodes.nfv.ext.zte.VL: + capabilities: + virtual_linkable: + type: tosca.capabilities.nfv.VirtualLinkable + derived_from: tosca.nodes.Root + properties: + segmentation_id: + required: false + type: string + network_name: + required: false + type: string + is_predefined: + required: false + type: boolean + mtu: + required: false + type: integer + dns_nameservers: + entry_schema: + type: string + required: false + type: list + physical_network: + required: false + type: string + dhcp_enabled: + required: false + type: boolean + network_id: + required: false + type: string + host_routes: + entry_schema: + type: tosca.datatypes.nfv.ext.HostRouteInfo + required: false + type: list + ip_version: + required: false + type: integer + vendor: + required: false + type: string + name: + required: false + type: string + start_ip: + required: false + type: string + vlan_transparent: + required: false + type: boolean + cidr: + required: false + type: string + gateway_ip: + required: false + type: string + network_type: + required: false + type: string + end_ip: + required: false + type: string + location_info: + required: false + type: tosca.datatypes.nfv.ext.LocationInfo + tosca.nodes.nfv.ext.zte.VNF: + capabilities: + forwarder: + type: tosca.capabilities.nfv.Forwarder + derived_from: tosca.nodes.Root + properties: + request_reclassification: + required: false + type: boolean + domain_type: + required: false + type: string + nsh_aware: + required: false + type: boolean + plugin_info: + required: false + type: string + adjust_vnf_capacity: + required: false + type: boolean + vnfd_version: + required: false + type: string + vmnumber_overquota_alarm: + required: false + type: boolean + custom_properties: + entry_schema: + type: string + required: false + type: map + version: + required: false + type: string + cross_dc: + required: false + type: boolean + script_info: + required: false + type: string + vendor: + required: false + type: string + is_shared: + required: false + type: boolean + name: + required: false + type: string + vnf_extend_type: + required: false + type: string + id: + required: false + type: string + vnf_type: + required: false + type: string + is_sfc_proxy: + required: false + type: boolean + requirements: + - forwarder: + capability: tosca.capabilities.nfv.Forwarder + occurrences: + - 0 + - UNBOUNDED + - virtualLink: + capability: tosca.capabilities.nfv.VirtualLinkable + occurrences: + - 0 + - UNBOUNDED + + tosca.nodes.nfv.VnfVirtualLinkDesc: + capabilities: + monitoring_parameters: + type: tosca.capabilities.nfv.Metric + virtual_linkable: + type: tosca.capabilities.nfv.VirtualLinkable + derived_from: tosca.nodes.Root + properties: + vl_flavours: + entry_schema: + type: string + type: map + description: + required: false + type: string + test_access: + entry_schema: + type: string + required: false + type: list + connectivity_type: + type: tosca.datatypes.nfv.ConnectivityType
\ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/CandidateServiceImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/CandidateServiceImpl.java index 4c38bd94a7..640777e993 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/CandidateServiceImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/CandidateServiceImpl.java @@ -340,7 +340,8 @@ public class CandidateServiceImpl implements CandidateService { Optional<String> jsonFileDataStructure = orchestrationTemplateCandidateDataDao.getStructure(vspId, version); - if (jsonFileDataStructure.isPresent()) { + if (jsonFileDataStructure.isPresent() + && JsonUtil.isValidJson(jsonFileDataStructure.get())) { mdcDataDebugMessage.debugExitMessage("VSP Id", vspId); return Optional .of(JsonUtil.json2Object(jsonFileDataStructure.get(), FilesDataStructure.class)); diff --git a/openecomp-ui/resources/scss/modules/_licenseModelLimits.scss b/openecomp-ui/resources/scss/modules/_licenseModelLimits.scss index 32fd128f2e..16b6af7cf9 100644 --- a/openecomp-ui/resources/scss/modules/_licenseModelLimits.scss +++ b/openecomp-ui/resources/scss/modules/_licenseModelLimits.scss @@ -38,23 +38,30 @@ .list-editor-item-view-content { padding-left: 0; } - .svg-icon-wrapper.trashO { - margin-bottom: 0; + + .svg-icon { + margin-top: 10px; margin-right: 50px; - .svg-icon { - fill: $gray; - height: 16px; - width: 16px; - &:hover { - fill: $dark-gray; - } - } + fill: $gray; + &:hover { + fill: $dark-gray; + } } + &.selectable { &:hover { + .list-editor-item-view-field { + .text.description, .text-name { + &:after { + background-color: darken($tlv-light-gray, 4%); + } + } + + } background-color: darken($tlv-light-gray, 4%); cursor: pointer; } + } &:hover { border-color: transparent; @@ -65,20 +72,20 @@ display: flex; align-items: center; white-space: nowrap; - + &.limit-name { .text.name { @extend .body-1-semibold; color: $blue; text-transform: uppercase; - padding: 0px 10px; + margin-left : 45px; } border-right: 1px solid $light-gray; margin-right: 22px; flex: 0.4; display: flex; - justify-content: center; + justify-content: left; } &.limit-description { @@ -90,10 +97,15 @@ max-width: 300px; } + .text.description, .text.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; + &:after { + background: $tlv-light-gray; + } + } } diff --git a/openecomp-ui/src/nfvo-components/modal/GlobalModal.js b/openecomp-ui/src/nfvo-components/modal/GlobalModal.js index e05c2ac616..f282046125 100644 --- a/openecomp-ui/src/nfvo-components/modal/GlobalModal.js +++ b/openecomp-ui/src/nfvo-components/modal/GlobalModal.js @@ -112,7 +112,10 @@ export class GlobalModalView extends React.Component { <Modal.Title>{title}</Modal.Title> </Modal.Header> <Modal.Body> - {ComponentToRender ? <ComponentToRender {...modalComponentProps}/> : msg} + {ComponentToRender ? + <ComponentToRender {...modalComponentProps}/> : + <div> {msg && msg.split('\n').map(txt => <span> {txt} <br/> </span>)} </div> + } </Modal.Body> {(onConfirmed || onDeclined || type !== typeEnum.DEFAULT) && <ModalFooter diff --git a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js index 41306a1c1a..db7afd27d9 100644 --- a/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js +++ b/openecomp-ui/src/sdc-app/onboarding/softwareProduct/SoftwareProductActionHelper.js @@ -114,7 +114,7 @@ function objToString(obj) { } } } - return str; + return str.replace(/\n$/, ''); } function parseUploadErrorMsg(error) { @@ -124,7 +124,7 @@ function parseUploadErrorMsg(error) { message += objToString(error[key]) + '\n'; } } - return message; + return message.replace(/\n$/, ''); } function fetchSoftwareProductCategories(dispatch) { |