Fix the tosca converter
[clamp.git] / src / test / java / org / onap / clamp / loop / CsarInstallerItCase.java
index a1499f7..a57a35e 100644 (file)
 package org.onap.clamp.loop;
 
 import static org.assertj.core.api.Assertions.assertThat;
-
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
-
 import javax.transaction.Transactional;
-
 import org.apache.commons.lang3.RandomStringUtils;
 import org.json.JSONException;
 import org.junit.Assert;
@@ -44,6 +41,7 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mockito;
 import org.onap.clamp.clds.Application;
+import org.onap.clamp.clds.config.LegacyOperationalPolicy;
 import org.onap.clamp.clds.exception.sdc.controller.BlueprintParserException;
 import org.onap.clamp.clds.exception.sdc.controller.CsarHandlerException;
 import org.onap.clamp.clds.exception.sdc.controller.SdcArtifactInstallerException;
@@ -51,7 +49,7 @@ import org.onap.clamp.clds.sdc.controller.installer.BlueprintArtifact;
 import org.onap.clamp.clds.sdc.controller.installer.CsarHandler;
 import org.onap.clamp.clds.util.JsonUtils;
 import org.onap.clamp.clds.util.ResourceFileUtil;
-import org.onap.clamp.loop.service.ServiceRepository;
+import org.onap.clamp.loop.service.ServicesRepository;
 import org.onap.clamp.loop.template.LoopTemplate;
 import org.onap.clamp.loop.template.LoopTemplateLoopElementModel;
 import org.onap.clamp.loop.template.LoopTemplatesRepository;
@@ -74,7 +72,7 @@ import org.springframework.test.context.junit4.SpringRunner;
 
 @RunWith(SpringRunner.class)
 @SpringBootTest(classes = Application.class)
-@ActiveProfiles(profiles = "clamp-default,clamp-default-user,clamp-sdc-controller")
+@ActiveProfiles(profiles = "clamp-default,clamp-default-user,clamp-sdc-controller,legacy-operational-policy")
 public class CsarInstallerItCase {
 
     private static final String CSAR_ARTIFACT_NAME = "example/sdc/service_Vloadbalancerms_csar.csar";
@@ -88,7 +86,7 @@ public class CsarInstallerItCase {
     private LoopTemplatesRepository loopTemplatesRepo;
 
     @Autowired
-    ServiceRepository serviceRepository;
+    ServicesRepository serviceRepository;
 
     @Autowired
     PolicyModelsRepository policyModelsRepository;
@@ -160,6 +158,13 @@ public class CsarInstallerItCase {
         return csarHandler;
     }
 
+    @Test
+    @Transactional
+    public void testPolicyModelAddedAtStartup() {
+        assertThat(policyModelsRepository.findByPolicyModelType(
+                LegacyOperationalPolicy.OPERATIONAL_POLICY_LEGACY).get(0)).isNotNull();
+    }
+
     @Test
     @Transactional
     public void testGetPolicyModelYaml() throws IOException, SdcToscaParserException, CsarHandlerException {