summaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-heat-lib/src
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/lib/openecomp-heat-lib/src')
-rw-r--r--openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/HeatResourcesTypesTest.java64
1 files changed, 64 insertions, 0 deletions
diff --git a/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/HeatResourcesTypesTest.java b/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/HeatResourcesTypesTest.java
new file mode 100644
index 0000000000..1298681b70
--- /dev/null
+++ b/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/HeatResourcesTypesTest.java
@@ -0,0 +1,64 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.heat.datatypes.model;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+import org.junit.jupiter.api.Test;
+import java.util.List;
+import java.util.Map;
+
+public class HeatResourcesTypesTest {
+
+ @Test
+ public void findByHeatResourceTest() {
+ assertEquals(HeatResourcesTypes.NOVA_SERVER_GROUP_RESOURCE_TYPE,
+ HeatResourcesTypes.findByHeatResource("OS::Nova::ServerGroup"));
+ }
+
+ @Test
+ public void isResourceExpectedToBeExposedTest() {
+ assertEquals(true, HeatResourcesTypes.isResourceExpectedToBeExposed("OS::Nova::ServerGroup"));
+ assertEquals(true, HeatResourcesTypes.isResourceExpectedToBeExposed("OS::Contrail::VirtualNetwork"));
+ assertEquals(true, HeatResourcesTypes.isResourceExpectedToBeExposed("OS::Neutron::Net"));
+ assertEquals(true, HeatResourcesTypes.isResourceExpectedToBeExposed("OS::Cinder::Volume"));
+ assertEquals(true, HeatResourcesTypes.isResourceExpectedToBeExposed("OS::Neutron::SecurityGroup"));
+ assertEquals(false, HeatResourcesTypes.isResourceExpectedToBeExposed("OS::Nova::Server"));
+ }
+
+ @Test
+ public void isResourceTypeValidTest() {
+ assertEquals(true, HeatResourcesTypes.isResourceTypeValid("OS::Neutron::SecurityGroup"));
+ assertEquals(false, HeatResourcesTypes.isResourceTypeValid("OS::Neutron::test"));
+ }
+
+ @Test
+ public void getListForResourceTypeTest() {
+ Map<HeatResourcesTypes, List<String>> res = HeatResourcesTypes.getListForResourceType(
+ HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE, HeatResourcesTypes.HEAT_CLOUD_CONFIG_TYPE);
+
+ assertNotNull(res.get(HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE));
+ assertNotNull(res.get(HeatResourcesTypes.HEAT_CLOUD_CONFIG_TYPE));
+ assertNull(res.get(HeatResourcesTypes.CONTRAIL_SERVICE_TEMPLATE));
+ }
+
+}