aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-model
diff options
context:
space:
mode:
authorJvD_Ericsson <jeff.van.dam@est.tech>2022-06-02 10:46:40 +0100
committerMichael Morris <michael.morris@est.tech>2022-06-24 13:17:23 +0000
commit363d9a6fea48bf6f34e4f1d4ecb37d33812c7626 (patch)
tree6d5023023b0f93346ed40e62f6cf3f4bc23792b9 /catalog-model
parent2dcfb0996a8345de5c8be73a5600ee995309664a (diff)
Service Import - Read metadata from csar
Also exports metadata to the tosca template and fixes service metadata not being set when the create button is clicked Issue-ID: SDC-4044 Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech> Change-Id: I6f8428d9ed385335c05e7b994e622229ea00342b
Diffstat (limited to 'catalog-model')
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/UploadServiceInfo.java60
-rw-r--r--catalog-model/src/test/java/org/openecomp/sdc/be/model/UploadServiceInfoTest.java7
2 files changed, 10 insertions, 57 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/UploadServiceInfo.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/UploadServiceInfo.java
index 837791af22..1c12a3e463 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/UploadServiceInfo.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/UploadServiceInfo.java
@@ -48,64 +48,24 @@ public class UploadServiceInfo {
private String serviceEcompNaming;
private String ecompGeneratedNaming;
private String namingPolicy;
+ private String serviceFunction;
+ private String environmentContext;
+ private String instantiationType;
private String projectCode;
private List<UploadArtifactInfo> artifactList;
- private String contactId, name, serviceIconPath, icon, vendorName, vendorRelease, serviceVendorModelNumber;
+ private String contactId;
+ private String name;
+ private String serviceIconPath;
+ private String icon;
+ private String vendorName;
+ private String vendorRelease;
+ private String serviceVendorModelNumber;
private String serviceType = "";
private String model;
private Map<String, String> categorySpecificMetadata;
private String derivedFromGenericType;
private String derivedFromGenericVersion;
- public UploadServiceInfo(String payloadData, String payloadName, String description, List<String> tags, String invariantUUID, String UUID,
- String type, String category, String subcategory, String resourceVendor, String resourceVendorRelease,
- String serviceRole, String serviceEcompNaming, String ecompGeneratedNaming, String namingPolicy,
- List<UploadArtifactInfo> artifactList, String contactId, String name, String resourceIconPath, String icon,
- String vendorName, String vendorRelease, String serviceVendorModelNumber, String serviceType, String projectCode, String model, Map<String, String> categorySpecificMetadata,
- String derivedFromGenericType, String derivedFromGenericVersion) {
- this.payloadData = payloadData;
- this.payloadName = payloadName;
- this.description = description;
- this.tags = tags;
- this.invariantUUID = invariantUUID;
- this.UUID = UUID;
- this.type = type;
- this.category = category;
- this.subcategory = subcategory;
- this.resourceVendor = resourceVendor;
- this.resourceVendorRelease = resourceVendorRelease;
- this.serviceRole = serviceRole;
- this.serviceEcompNaming = serviceEcompNaming;
- this.ecompGeneratedNaming = ecompGeneratedNaming;
- this.namingPolicy = namingPolicy;
- this.artifactList = artifactList;
- this.contactId = contactId;
- this.name = name;
- this.serviceIconPath = serviceIconPath;
- this.icon = icon;
- this.vendorName = vendorName;
- this.vendorRelease = vendorRelease;
- this.serviceVendorModelNumber = serviceVendorModelNumber;
- this.serviceType = serviceType;
- this.projectCode = projectCode;
- this.model = model;
- if (category != null) {
- String[] arr = category.split("/");
- if (arr.length >= 2) {
- categories = new ArrayList<>();
- CategoryDefinition catDef = new CategoryDefinition();
- catDef.setName(arr[0]);
- SubCategoryDefinition subCat = new SubCategoryDefinition();
- subCat.setName(arr[1]);
- catDef.addSubCategory(subCat);
- categories.add(catDef);
- }
- }
- this.categorySpecificMetadata = categorySpecificMetadata;
- this.derivedFromGenericType = derivedFromGenericType;
- this.derivedFromGenericVersion = derivedFromGenericVersion;
- }
-
public UploadServiceInfo() {
}
diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/UploadServiceInfoTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/UploadServiceInfoTest.java
index d8ddb75be4..8d0d0b9edc 100644
--- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/UploadServiceInfoTest.java
+++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/UploadServiceInfoTest.java
@@ -37,13 +37,6 @@ public class UploadServiceInfoTest {
}
@Test
- public void testCtor() {
- new UploadServiceInfo("mock", "mock", "mock", new LinkedList<>(), "mock", "mock", "mock", "mock/mock/mock",
- "mock", "mock", "mock", "mock", "mock", "mock", "mock", new LinkedList<>(), "mock", "mock", "mock",
- "mock", "mock", "mock", "mock", "mock", "mock", "mock", new HashMap<>(), "mock", "mock");
- }
-
- @Test
public void testAddSubCategory() {
UploadServiceInfo testSubject;
String category = "";