summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/test
diff options
context:
space:
mode:
authorfranciscovila <javier.paradela.vila@est.tech>2023-04-18 15:08:07 +0100
committerMichael Morris <michael.morris@est.tech>2023-04-26 07:59:43 +0000
commit6c9da5ab227fa535249e8bb56c7cef01a74c6fb1 (patch)
tree7e12a48558122980ce877452d1055ce77d4e8bff /catalog-be/src/test
parent3405456c46937352863ce19c39266a51dd7760db (diff)
VFC Property default value enforced forced to comply with restraints
Issue-ID: SDC-4477 Signed-off-by: franciscovila <javier.paradela.vila@est.tech> Change-Id: Ib9115aae9019e2d36990147dc0ec9f4058352d88
Diffstat (limited to 'catalog-be/src/test')
-rw-r--r--catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentPropertyServletTest.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentPropertyServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentPropertyServletTest.java
index 05e5eedb1f..00688aaf7a 100644
--- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentPropertyServletTest.java
+++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ComponentPropertyServletTest.java
@@ -25,6 +25,8 @@ import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.when;
import fj.data.Either;
+import java.util.HashMap;
+import java.util.Map;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
import javax.ws.rs.core.Response;
@@ -36,13 +38,18 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
+import org.mockito.Mockito;
import org.mockito.Spy;
import org.mockito.junit.jupiter.MockitoExtension;
+import org.openecomp.sdc.be.components.impl.DataTypesService;
import org.openecomp.sdc.be.components.impl.PropertyBusinessLogic;
import org.openecomp.sdc.be.dao.api.ActionStatus;
+import org.openecomp.sdc.be.dao.janusgraph.JanusGraphOperationStatus;
import org.openecomp.sdc.be.impl.ComponentsUtils;
import org.openecomp.sdc.be.impl.WebAppContextWrapper;
+import org.openecomp.sdc.be.model.DataTypeDefinition;
import org.openecomp.sdc.be.model.PropertyDefinition;
+import org.openecomp.sdc.be.model.cache.ApplicationDataTypeCache;
import org.openecomp.sdc.be.resources.data.EntryData;
import org.openecomp.sdc.common.api.Constants;
import org.openecomp.sdc.exception.ResponseFormat;
@@ -73,10 +80,17 @@ class ComponentPropertyServletTest extends JerseySpringBaseTest {
private static final String INVALID_PROPERTY_NAME = "invalid_name_$.&";
private static final String STRING_TYPE = "string";
+ ApplicationDataTypeCache applicationDataTypeCache = Mockito.mock(ApplicationDataTypeCache.class);
+ Map<String, DataTypeDefinition> mapreturn = new HashMap<>();
+ Either<Map<String, DataTypeDefinition>, JanusGraphOperationStatus> allDataTypes;
+
@BeforeEach
public void before() throws Exception {
super.setUp();
when(request.getSession()).thenReturn(session);
+ mapreturn.put("Demo",new DataTypeDefinition());
+ allDataTypes = Either.left(mapreturn);
+ when(applicationDataTypeCache.getAll(null)).thenReturn(allDataTypes);
}
@AfterEach