diff options
Diffstat (limited to 'catalog-be')
3 files changed, 6 insertions, 3 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceImportManager.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceImportManager.java index 8c6e9cb2a2..0681dd495e 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceImportManager.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceImportManager.java @@ -148,7 +148,7 @@ public class ResourceImportManager { lifecycleChangeInfo.setUserRemarks("certification on import"); Function<Resource, Boolean> validator = resource -> resourceBusinessLogic.validatePropertiesDefaultValues(resource); return importCertifiedResource(resourceYml, resourceMetaData, creator, validator, lifecycleChangeInfo, isInTransaction, createNewVersion, - needLock, null, null, false, null, null, false); + needLock, null, null, false, null, null, false); } public void importAllNormativeResource(final String resourcesYaml, final NodeTypesMetadataList nodeTypesMetadataList, final User user, @@ -215,6 +215,7 @@ public class ResourceImportManager { setMetaDataFromJson(resourceMetaData, resource); populateResourceFromYaml(resourceYml, resource); validationFunction.apply(resource); + resource.getComponentMetadataDefinition().getMetadataDataDefinition().setNormative(resourceMetaData.isNormative()); checkResourceExists(createNewVersion, csarInfo, resource); resource = resourceBusinessLogic .createOrUpdateResourceByImport(resource, creator, true, isInTransaction, needLock, csarInfo, nodeName, isNested).left; diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AbstractValidationsServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AbstractValidationsServlet.java index 02f96ad09e..7c300b310d 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AbstractValidationsServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AbstractValidationsServlet.java @@ -292,6 +292,7 @@ public abstract class AbstractValidationsServlet extends BeGenericServlet { if (resourceInfoObject == null) { isValid = false; } else { + resourceInfoObject.setNormative(!resourceAuthorityEnum.isUserTypeResource()); if (!resourceAuthorityEnum.isBackEndImport()) { isValid = resourceInfoObject.getPayloadName() != null && !resourceInfoObject.getPayloadName().isEmpty(); //only resource name is checked diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/ResourceImportManagerTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/ResourceImportManagerTest.java index 6f20e2d469..80b5cf09bc 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/ResourceImportManagerTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/ResourceImportManagerTest.java @@ -155,7 +155,7 @@ public class ResourceImportManagerTest { testSetConstantMetaData(resource); testSetMetaDataFromJson(resource, resourceMD); - + testSetDerivedFrom(resource); testSetProperties(resource); @@ -432,6 +432,7 @@ public class ResourceImportManagerTest { resourceMD.setTags(Collections.singletonList("BlockStorage")); resourceMD.setDescription("Represents a server-local block storage device (i.e., not shared) offering evenly sized blocks of data from which raw storage volumes can be created."); resourceMD.setResourceVendorModelNumber("vendorReleaseNumber"); + resourceMD.setNormative(true); return resourceMD; } @@ -538,7 +539,7 @@ public class ResourceImportManagerTest { for (String tag : resource.getTags()) { assertTrue(resourceMD.getTags().contains(tag)); } - + assertEquals(resourceMD.isNormative(), resource.getComponentMetadataDefinition().getMetadataDataDefinition().isNormative()); } private void testSetConstantMetaData(Resource resource) { |