diff options
author | MichaelMorris <michael.morris@est.tech> | 2021-08-20 15:40:35 +0100 |
---|---|---|
committer | Andr� Schmid <andre.schmid@est.tech> | 2021-08-27 10:33:32 +0000 |
commit | a5e32b3d20bc078482cb08645c38ffb685c0f145 (patch) | |
tree | 133fe88578f3a3c3db3ec73315b65f45caba625a /catalog-dao/src/test | |
parent | 4701612ba26c4b8c7c7e9fbfa38f582a4b74669f (diff) |
Support querying of model by type
Signed-off-by: MichaelMorris <michael.morris@est.tech>
Issue-ID: SDC-3678
Change-Id: I5fd19eefe475113df501901628b2ee8669004399
Diffstat (limited to 'catalog-dao/src/test')
-rw-r--r-- | catalog-dao/src/test/java/org/openecomp/sdc/be/resources/data/ModelDataTest.java | 10 |
1 files changed, 8 insertions, 2 deletions
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<String, Object> properties = new HashMap(); + final Map<String, Object> 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()); } } |