Merge "Set localhost in config"
[clamp.git] / src / test / java / org / onap / clamp / clds / it / PropJsonBuilderIT.java
index c3b35ee..cd626dd 100644 (file)
@@ -39,6 +39,7 @@ import org.onap.clamp.clds.client.req.SdcReq;
 import org.onap.clamp.clds.model.CldsSdcServiceDetail;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
+import org.springframework.test.context.TestPropertySource;
 import org.springframework.test.context.junit4.SpringRunner;
 
 /**
@@ -49,9 +50,10 @@ import org.springframework.test.context.junit4.SpringRunner;
  */
 @RunWith(SpringRunner.class)
 @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
+@TestPropertySource(locations = "classpath:application-no-camunda.properties")
 public class PropJsonBuilderIT extends AbstractIT {
 
-    private String globalPropsPartial;
+    private String       globalPropsPartial;
     private ObjectMapper mapper;
 
     /**
@@ -60,12 +62,9 @@ public class PropJsonBuilderIT extends AbstractIT {
     @Before
     public void setUp() throws IOException {
         String url = refProp.getStringValue("sdc.serviceUrl");
-        String catalogUrl = refProp.getStringValue("sdc.catalog.url");
         String basicAuth = SdcReq.getSdcBasicAuth(refProp);
         System.out.println("value of string and basicAuth:" + url + basicAuth);
-        CldsSdcServiceDetail cldsservicedetail = new CldsSdcServiceDetail();
         // cldsservicedetail.set
-        String globalProps = refProp.getStringValue("globalPropsTest");
         globalPropsPartial = refProp.getStringValue("globalPropsPartialTest");
         mapper = new ObjectMapper();
     }
@@ -86,8 +85,8 @@ public class PropJsonBuilderIT extends AbstractIT {
     private void sampleJsonObject() throws JsonProcessingException {
 
         /**
-         * Create three JSON Objects objectNode1, objectNode2, objectNode3.
-         * Add all these three objects in the array
+         * Create three JSON Objects objectNode1, objectNode2, objectNode3. Add
+         * all these three objects in the array
          */
         ObjectNode objectNode1 = mapper.createObjectNode();
         objectNode1.put("bookName", "Java");
@@ -124,9 +123,8 @@ public class PropJsonBuilderIT extends AbstractIT {
     private String createEmptySharedObject() throws JsonProcessingException {
 
         /**
-         * Empty Object initialization.
-         * "": { "vf": { "": "" }, "location": { "": "" }, "alarmCondition": {
-         * "": "" } }
+         * Empty Object initialization. "": { "vf": { "": "" }, "location": {
+         * "": "" }, "alarmCondition": { "": "" } }
          */
         ObjectNode emptyObjectNode = mapper.createObjectNode();
         emptyObjectNode.put("", "");
@@ -144,8 +142,8 @@ public class PropJsonBuilderIT extends AbstractIT {
         emptyServiceObjectNode.putPOJO("", samArrayNode);
 
         /**
-         * Object initialization.
-         * "vf": { " ": " ", "DCAE_CLAMP_DEMO3 1": "DCAE_CLAMP_DEMO3" }
+         * Object initialization. "vf": { " ": " ", "DCAE_CLAMP_DEMO3 1":
+         * "DCAE_CLAMP_DEMO3" }
          *
          */
         ObjectNode dcaeClampDemo3Node = mapper.createObjectNode();
@@ -157,9 +155,8 @@ public class PropJsonBuilderIT extends AbstractIT {
         vfObjectNode2.putPOJO("vf", vfArrayNode);
 
         /**
-         * Object initialization.
-         * "location": { "SNDGCA64": "San Diego SAN3", "ALPRGAED":
-         * "Alpharetta PDK1", "LSLEILAA": "Lisle DPA3" },
+         * Object initialization. "location": { "SNDGCA64": "San Diego SAN3",
+         * "ALPRGAED": "Alpharetta PDK1", "LSLEILAA": "Lisle DPA3" },
          */
         ObjectNode sandiegoLocationNode = mapper.createObjectNode();
         sandiegoLocationNode.put("SNDGCA64", "San Diego SAN3");
@@ -173,10 +170,10 @@ public class PropJsonBuilderIT extends AbstractIT {
         locationObjectNode2.putPOJO("location", locationArrayNode);
 
         /**
-         * Object initialization.
-         * "alarmCondition": { "A+Fallback+Operation+will+soon+be+started":
-         * "A Fallback Operation will soon be started",
-         * "BRM%2C+Auto+Export+Backup+Failed": "BRM, Auto Export Backup Failed",
+         * Object initialization. "alarmCondition": {
+         * "A+Fallback+Operation+will+soon+be+started": "A Fallback Operation
+         * will soon be started", "BRM%2C+Auto+Export+Backup+Failed": "BRM, Auto
+         * Export Backup Failed",
          */
         ObjectNode alamrCondition1 = mapper.createObjectNode();
         alamrCondition1.put("A+Fallback+Operation+will+soon+be+started", "A Fallback Operation will soon be started");
@@ -206,8 +203,7 @@ public class PropJsonBuilderIT extends AbstractIT {
         byServiceBasicObjetNode.putPOJO("byService", byServiceBasicArrayNode);
 
         /**
-         * Object initialization.
-         * "byVf": { "": { "vfc": { "": "" },
+         * Object initialization. "byVf": { "": { "vfc": { "": "" },
          * "03596c12-c7e3-44b7-8994-5cdfeda8afdd": { "vfc": { " ": " " } } } }
          */
         ObjectNode vfCObjectNode = mapper.createObjectNode();
@@ -240,9 +236,8 @@ public class PropJsonBuilderIT extends AbstractIT {
     private String createTestEmptySharedObject() throws IOException {
 
         /**
-         * Object initialization.
-         * "": { "vf": { "": "" }, "location": { "": "" }, "alarmCondition": {
-         * "": "" } }
+         * Object initialization. "": { "vf": { "": "" }, "location": { "": ""
+         * }, "alarmCondition": { "": "" } }
          */
         ObjectNode emptyObjectNode = mapper.createObjectNode();
         emptyObjectNode.put("", "");
@@ -254,8 +249,8 @@ public class PropJsonBuilderIT extends AbstractIT {
         emptyServiceObjectNode.putPOJO("", vfObjectNode);
 
         /**
-         * Object initialization.
-         * "vf": { " ": " ", "DCAE_CLAMP_DEMO3 1": "DCAE_CLAMP_DEMO3" }
+         * Object initialization. "vf": { " ": " ", "DCAE_CLAMP_DEMO3 1":
+         * "DCAE_CLAMP_DEMO3" }
          *
          */
         ObjectNode vfObjectNode2 = mapper.createObjectNode();
@@ -265,9 +260,8 @@ public class PropJsonBuilderIT extends AbstractIT {
         vfObjectNode2.putPOJO("vf", dcaeClampDemo3Node);
 
         /**
-         * Object initialization.
-         * "location": { "SNDGCA64": "San Diego SAN3", "ALPRGAED":
-         * "Alpharetta PDK1", "LSLEILAA": "Lisle DPA3" },
+         * Object initialization. "location": { "SNDGCA64": "San Diego SAN3",
+         * "ALPRGAED": "Alpharetta PDK1", "LSLEILAA": "Lisle DPA3" },
          */
         // ObjectNode sandiegoLocationNode = mapper.createObjectNode();
         // sandiegoLocationNode.put("SNDGCA64","San Diego SAN3");
@@ -277,10 +271,10 @@ public class PropJsonBuilderIT extends AbstractIT {
         vfObjectNode2.putPOJO("location", locationJsonNode);
 
         /**
-         * Object initialization.
-         * "alarmCondition": { "A+Fallback+Operation+will+soon+be+started":
-         * "A Fallback Operation will soon be started",
-         * "BRM%2C+Auto+Export+Backup+Failed": "BRM, Auto Export Backup Failed",
+         * Object initialization. "alarmCondition": {
+         * "A+Fallback+Operation+will+soon+be+started": "A Fallback Operation
+         * will soon be started", "BRM%2C+Auto+Export+Backup+Failed": "BRM, Auto
+         * Export Backup Failed",
          */
         // ObjectNode alamrCondition1 = mapper.createObjectNode();
         // alamrCondition1.put("A+Fallback+Operation+will+soon+be+started","A
@@ -295,8 +289,7 @@ public class PropJsonBuilderIT extends AbstractIT {
         byServiceBasicObjetNode.putPOJO("byService", emptyServiceObjectNode);
 
         /**
-         * Object initialization.
-         * "byVf": { "": { "vfc": { "": "" },
+         * Object initialization. "byVf": { "": { "vfc": { "": "" },
          * "03596c12-c7e3-44b7-8994-5cdfeda8afdd": { "vfc": { " ": " " } } } }
          */
         ObjectNode vfCObjectNode = mapper.createObjectNode();
@@ -316,9 +309,8 @@ public class PropJsonBuilderIT extends AbstractIT {
 
     private String createCldsSharedObject(CldsSdcServiceDetail CldsSdcServiceDetail) throws IOException {
         /**
-         * Object initialization.
-         * "": { "vf": { "": "" }, "location": { "": "" }, "alarmCondition": {
-         * "": "" } }
+         * Object initialization. "": { "vf": { "": "" }, "location": { "": ""
+         * }, "alarmCondition": { "": "" } }
          */
         ObjectNode emptyObjectNode = mapper.createObjectNode();
         emptyObjectNode.put("", "");
@@ -330,8 +322,8 @@ public class PropJsonBuilderIT extends AbstractIT {
         emptyServiceObjectNode.putPOJO("", vfObjectNode);
 
         /**
-         * Object initialization.
-         * "vf": { " ": " ", "DCAE_CLAMP_DEMO3 1": "DCAE_CLAMP_DEMO3" }
+         * Object initialization. "vf": { " ": " ", "DCAE_CLAMP_DEMO3 1":
+         * "DCAE_CLAMP_DEMO3" }
          *
          */
         ObjectNode vfObjectNode2 = mapper.createObjectNode();
@@ -341,9 +333,8 @@ public class PropJsonBuilderIT extends AbstractIT {
         vfObjectNode2.putPOJO("vf", dcaeClampDemo3Node);
 
         /**
-         * Object initialization.
-         * "location": { "SNDGCA64": "San Diego SAN3", "ALPRGAED":
-         * "Alpharetta PDK1", "LSLEILAA": "Lisle DPA3" },
+         * Object initialization. "location": { "SNDGCA64": "San Diego SAN3",
+         * "ALPRGAED": "Alpharetta PDK1", "LSLEILAA": "Lisle DPA3" },
          */
         ObjectNode sandiegoLocationNode = mapper.createObjectNode();
         sandiegoLocationNode.put("SNDGCA64", "San Diego SAN3");
@@ -351,10 +342,10 @@ public class PropJsonBuilderIT extends AbstractIT {
         vfObjectNode2.putPOJO("location", sandiegoLocationNode);
 
         /**
-         * Object initialization.
-         * "alarmCondition": { "A+Fallback+Operation+will+soon+be+started":
-         * "A Fallback Operation will soon be started",
-         * "BRM%2C+Auto+Export+Backup+Failed": "BRM, Auto Export Backup Failed",
+         * Object initialization. "alarmCondition": {
+         * "A+Fallback+Operation+will+soon+be+started": "A Fallback Operation
+         * will soon be started", "BRM%2C+Auto+Export+Backup+Failed": "BRM, Auto
+         * Export Backup Failed",
          */
         ObjectNode alamrCondition1 = mapper.createObjectNode();
         alamrCondition1.put("A+Fallback+Operation+will+soon+be+started", "A Fallback Operation will soon be started");
@@ -365,8 +356,7 @@ public class PropJsonBuilderIT extends AbstractIT {
         byServiceBasicObjetNode.putPOJO("byService", emptyServiceObjectNode);
 
         /**
-         * Object initialization.
-         * "byVf": { "": { "vfc": { "": "" },
+         * Object initialization. "byVf": { "": { "vfc": { "": "" },
          * "03596c12-c7e3-44b7-8994-5cdfeda8afdd": { "vfc": { " ": " " } } } }
          */