From a5e32b3d20bc078482cb08645c38ffb685c0f145 Mon Sep 17 00:00:00 2001 From: MichaelMorris Date: Fri, 20 Aug 2021 15:40:35 +0100 Subject: Support querying of model by type Signed-off-by: MichaelMorris Issue-ID: SDC-3678 Change-Id: I5fd19eefe475113df501901628b2ee8669004399 --- .../org/openecomp/sdc/be/resources/data/ModelDataTest.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'catalog-dao/src/test/java') diff --git a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ModelDataTest.java b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ModelDataTest.java index 1fb34dd5e6..f011e36509 100644 --- a/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ModelDataTest.java +++ b/catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ModelDataTest.java @@ -27,17 +27,19 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; import org.junit.jupiter.api.TestInstance.Lifecycle; +import org.openecomp.sdc.be.datatypes.enums.ModelTypeEnum; @TestInstance(Lifecycle.PER_CLASS) class ModelDataTest { private final String modelName = "ETSI-SDC-MODEL-TEST"; private final String modelId = UUID.randomUUID().toString(); + private final ModelTypeEnum modelType = ModelTypeEnum.NORMATIVE; ModelData modelData; @BeforeAll void initTestData() { - modelData = new ModelData(modelName, modelId); + modelData = new ModelData(modelName, modelId, modelType); } @Test @@ -45,17 +47,20 @@ class ModelDataTest { assertThat(modelData).isNotNull(); assertThat(modelData.getUniqueId()).isEqualTo(modelId); assertThat(modelData.getName()).isEqualTo(modelName); + assertThat(modelData.getModelType()).isEqualTo(modelType.getValue()); } @Test void modelDataFromPropertiesMapTest() { - final Map properties = new HashMap(); + final Map properties = new HashMap<>(); properties.put("name", modelData.getName()); properties.put("uid", modelData.getUniqueId()); + properties.put("modelType", modelData.getModelType()); final ModelData modelDataFromPropertiesMap = new ModelData(properties); assertThat(modelDataFromPropertiesMap).isNotNull(); assertThat(modelDataFromPropertiesMap.getUniqueId()).isEqualTo(modelId); assertThat(modelDataFromPropertiesMap.getName()).isEqualTo(modelName); + assertThat(modelDataFromPropertiesMap.getModelType()).isEqualTo(modelType.getValue()); } @Test @@ -65,6 +70,7 @@ class ModelDataTest { assertThat(result).isNotEmpty(); assertThat(result.values()).contains(modelId); assertThat(result.values()).contains(modelName); + assertThat(result.values()).contains(modelType.getValue()); } } -- cgit 1.2.3-korg