From 10a832ed3dea1924bfa555ab3b85b1cf1b228b2f Mon Sep 17 00:00:00 2001 From: aribeiro Date: Thu, 9 Sep 2021 08:54:17 +0100 Subject: Fix model init When upgrading, the model type for "ETSI SOL001 v2.5.1" is being updated and then the request for retrieving all model types with "NORMATIVE" type returns empty Issue-ID: SDC-3720 Signed-off-by: aribeiro Change-Id: Ibc71bd05426532416eb2ac09f598e7456777403b --- .../src/test/java/org/openecomp/sdc/be/servlets/ModelServletTest.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'catalog-be/src/test') diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ModelServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ModelServletTest.java index 4e1c0e7945..f96386ded3 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ModelServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ModelServletTest.java @@ -59,6 +59,7 @@ import org.openecomp.sdc.be.components.validation.UserValidations; import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.config.SpringConfig; import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.datatypes.enums.ModelTypeEnum; import org.openecomp.sdc.be.exception.BusinessException; import org.openecomp.sdc.be.impl.ComponentsUtils; import org.openecomp.sdc.be.impl.ServletUtils; @@ -157,6 +158,7 @@ class ModelServletTest extends JerseyTest { model = new Model(modelName); modelCreateRequest = new ModelCreateRequest(); modelCreateRequest.setName(modelName); + modelCreateRequest.setModelType(ModelTypeEnum.NORMATIVE); } @Override @@ -207,6 +209,7 @@ class ModelServletTest extends JerseyTest { when(modelBusinessLogic.createModel(any(Model.class))).thenReturn(model); ModelCreateRequest derviedModelCreateRequest = new ModelCreateRequest(); derviedModelCreateRequest.setName("derivedModel"); + derviedModelCreateRequest.setModelType(ModelTypeEnum.NORMATIVE_EXTENSION); derviedModelCreateRequest.setDerivedFrom(model.getName()); final FormDataMultiPart formDataMultiPart = buildCreateFormDataMultiPart(new byte[0], parseToJsonString(derviedModelCreateRequest)); final var response = target(rootPath.toString()).request(MediaType.APPLICATION_JSON) -- cgit 1.2.3-korg