diff options
Diffstat (limited to 'openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src')
6 files changed, 26 insertions, 86 deletions
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/GlobalSubstitutionServiceTemplate.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/GlobalSubstitutionServiceTemplate.java index cad026d7a6..f6955bbdad 100644 --- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/GlobalSubstitutionServiceTemplate.java +++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/GlobalSubstitutionServiceTemplate.java @@ -16,23 +16,18 @@ package org.openecomp.core.impl; -import static org.openecomp.core.converter.datatypes.Constants.ONAP_INDEX; - import org.apache.commons.collections4.MapUtils; -import org.openecomp.core.utilities.orchestration.OnboardingTypesEnum; -import org.openecomp.sdc.logging.api.Logger; -import org.openecomp.sdc.logging.api.LoggerFactory; import org.onap.sdc.tosca.datatypes.model.Import; import org.onap.sdc.tosca.datatypes.model.NodeType; import org.onap.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.core.utilities.orchestration.OnboardingTypesEnum; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.translator.services.heattotosca.globaltypes.GlobalTypesGenerator; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; +import java.util.*; + +import static org.openecomp.core.converter.datatypes.Constants.ONAP_INDEX; public class GlobalSubstitutionServiceTemplate extends ServiceTemplate { private static final Logger logger = LoggerFactory.getLogger(ServiceTemplate.class); diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterImpl.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterImpl.java index e896094df8..7e5e2031f9 100644 --- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterImpl.java +++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterImpl.java @@ -16,23 +16,8 @@ package org.openecomp.core.impl; -import static org.openecomp.core.converter.datatypes.Constants.ONAP_INDEX; -import static org.openecomp.core.converter.datatypes.Constants.capabilities; -import static org.openecomp.core.converter.datatypes.Constants.definitionsDir; -import static org.openecomp.core.converter.datatypes.Constants.globalStName; -import static org.openecomp.core.converter.datatypes.Constants.globalSubstitution; -import static org.openecomp.core.converter.datatypes.Constants.inputs; -import static org.openecomp.core.converter.datatypes.Constants.mainStName; -import static org.openecomp.core.converter.datatypes.Constants.metadataFile; -import static org.openecomp.core.converter.datatypes.Constants.nodeType; -import static org.openecomp.core.converter.datatypes.Constants.openecompHeatIndex; -import static org.openecomp.core.converter.datatypes.Constants.outputs; -import static org.openecomp.core.converter.datatypes.Constants.requirements; -import static org.openecomp.core.impl.GlobalSubstitutionServiceTemplate.GLOBAL_SUBSTITUTION_SERVICE_FILE_NAME; -import static org.openecomp.core.impl.GlobalSubstitutionServiceTemplate.HEAT_INDEX_IMPORT_FILE; -import static org.openecomp.core.impl.GlobalSubstitutionServiceTemplate.ONAP_INDEX_IMPORT_FILE; - import org.apache.commons.collections.MapUtils; +import org.onap.sdc.tosca.datatypes.model.*; import org.openecomp.core.converter.ServiceTemplateReaderService; import org.openecomp.core.converter.ToscaConverter; import org.openecomp.core.converter.datatypes.Constants; @@ -45,31 +30,18 @@ import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.common.errors.ErrorCategory; import org.openecomp.sdc.common.errors.ErrorCode; import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; -import org.onap.sdc.tosca.datatypes.model.ArtifactDefinition; -import org.onap.sdc.tosca.datatypes.model.CapabilityAssignment; -import org.onap.sdc.tosca.datatypes.model.Import; -import org.onap.sdc.tosca.datatypes.model.NodeFilter; -import org.onap.sdc.tosca.datatypes.model.NodeTemplate; -import org.onap.sdc.tosca.datatypes.model.NodeType; -import org.onap.sdc.tosca.datatypes.model.ParameterDefinition; -import org.onap.sdc.tosca.datatypes.model.RequirementAssignment; -import org.onap.sdc.tosca.datatypes.model.ServiceTemplate; -import org.onap.sdc.tosca.datatypes.model.SubstitutionMapping; import org.openecomp.sdc.tosca.services.DataModelUtil; import org.openecomp.sdc.tosca.services.ToscaUtil; import org.openecomp.sdc.translator.services.heattotosca.globaltypes.GlobalTypesGenerator; import org.yaml.snakeyaml.error.YAMLException; import java.io.File; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; +import java.util.*; import java.util.regex.Pattern; +import static org.openecomp.core.converter.datatypes.Constants.*; +import static org.openecomp.core.impl.GlobalSubstitutionServiceTemplate.*; + public class ToscaConverterImpl implements ToscaConverter { private static final String ORIGINAL = ".original"; diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterUtil.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterUtil.java index 32cfb89418..a77c150a91 100644 --- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterUtil.java +++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterUtil.java @@ -21,11 +21,7 @@ import org.openecomp.core.converter.errors.CreateToscaObjectErrorBuilder; import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.common.utils.CommonUtil; -import java.util.HashSet; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; +import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -45,8 +41,8 @@ public class ToscaConverterUtil { } static <T> Optional<T> createObjectFromClass(String objectId, - Object objectCandidate, - Class<T> classToCreate) { + Object objectCandidate, + Class<T> classToCreate) { try { return CommonUtil.createObjectUsingSetters(objectCandidate, classToCreate); } catch (Exception ex) { diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/services/ServiceTemplateReaderServiceImpl.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/services/ServiceTemplateReaderServiceImpl.java index 030d742d69..8621e73f26 100644 --- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/services/ServiceTemplateReaderServiceImpl.java +++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/services/ServiceTemplateReaderServiceImpl.java @@ -1,20 +1,13 @@ package org.openecomp.core.impl.services; -import org.openecomp.core.converter.ServiceTemplateReaderService; import org.onap.sdc.tosca.services.YamlUtil; +import org.openecomp.core.converter.ServiceTemplateReaderService; import java.util.HashMap; import java.util.Map; import java.util.Objects; -import static org.openecomp.core.converter.datatypes.Constants.definitionVersion; -import static org.openecomp.core.converter.datatypes.Constants.inputs; -import static org.openecomp.core.converter.datatypes.Constants.metadata; -import static org.openecomp.core.converter.datatypes.Constants.nodeTemplates; -import static org.openecomp.core.converter.datatypes.Constants.nodeTypes; -import static org.openecomp.core.converter.datatypes.Constants.outputs; -import static org.openecomp.core.converter.datatypes.Constants.substitutionMappings; -import static org.openecomp.core.converter.datatypes.Constants.topologyTemplate; +import static org.openecomp.core.converter.datatypes.Constants.*; public class ServiceTemplateReaderServiceImpl implements ServiceTemplateReaderService { diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/converter/impl/ToscaConverterImplTest.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/converter/impl/ToscaConverterImplTest.java index 1907c04c53..4926ee5789 100644 --- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/converter/impl/ToscaConverterImplTest.java +++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/converter/impl/ToscaConverterImplTest.java @@ -3,19 +3,15 @@ package org.openecomp.core.converter.impl; import org.apache.commons.collections.CollectionUtils; import org.junit.Assert; import org.junit.Test; +import org.onap.sdc.tosca.datatypes.model.*; +import org.onap.sdc.tosca.services.ToscaExtensionYamlUtil; +import org.onap.sdc.tosca.services.YamlUtil; import org.openecomp.core.converter.ToscaConverter; import org.openecomp.core.impl.ToscaConverterImpl; import org.openecomp.core.utilities.file.FileContentHandler; import org.openecomp.core.utilities.file.FileUtils; import org.openecomp.core.utilities.json.JsonUtil; import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; -import org.onap.sdc.tosca.datatypes.model.NodeTemplate; -import org.onap.sdc.tosca.datatypes.model.NodeType; -import org.onap.sdc.tosca.datatypes.model.RequirementAssignment; -import org.onap.sdc.tosca.datatypes.model.RequirementDefinition; -import org.onap.sdc.tosca.datatypes.model.ServiceTemplate; -import org.onap.sdc.tosca.services.ToscaExtensionYamlUtil; -import org.onap.sdc.tosca.services.YamlUtil; import java.io.File; import java.io.FileInputStream; @@ -23,13 +19,7 @@ import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.nio.file.NotDirectoryException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.ListIterator; -import java.util.Map; -import java.util.Objects; +import java.util.*; import static org.junit.Assert.assertEquals; import static org.openecomp.core.converter.datatypes.Constants.globalStName; diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/converter/impl/ToscaConvertorDefinitionsTest.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/converter/impl/ToscaConvertorDefinitionsTest.java index f9b982e658..d5a99106bc 100644 --- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/converter/impl/ToscaConvertorDefinitionsTest.java +++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/converter/impl/ToscaConvertorDefinitionsTest.java @@ -1,29 +1,23 @@ package org.openecomp.core.converter.impl; -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.openecomp.core.converter.datatypes.Constants.ONAP_INDEX; -import static org.openecomp.core.impl.GlobalSubstitutionServiceTemplate.DEFININTION_VERSION; -import static org.openecomp.core.impl.GlobalSubstitutionServiceTemplate.GLOBAL_SUBSTITUTION_SERVICE_FILE_NAME; -import static org.openecomp.core.impl.GlobalSubstitutionServiceTemplate.HEAT_INDEX; -import static org.openecomp.core.impl.GlobalSubstitutionServiceTemplate.TEMPLATE_NAME_PROPERTY; -import static org.openecomp.sdc.common.utils.CommonUtil.validateAndUploadFileContent; - import org.apache.commons.io.IOUtils; import org.junit.Ignore; import org.junit.Test; +import org.onap.sdc.tosca.datatypes.model.ServiceTemplate; import org.openecomp.core.impl.GlobalSubstitutionServiceTemplate; import org.openecomp.core.impl.ToscaConverterImpl; import org.openecomp.core.utilities.file.FileContentHandler; import org.openecomp.core.utilities.orchestration.OnboardingTypesEnum; import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; -import org.onap.sdc.tosca.datatypes.model.ServiceTemplate; import java.net.URL; import java.util.Map; import java.util.Set; + +import static org.junit.Assert.*; +import static org.openecomp.core.converter.datatypes.Constants.ONAP_INDEX; +import static org.openecomp.core.impl.GlobalSubstitutionServiceTemplate.*; +import static org.openecomp.sdc.common.utils.CommonUtil.validateAndUploadFileContent; public class ToscaConvertorDefinitionsTest { |