Merge "logging tests - retry for failed calls to log checker"
[vid.git] / vid-automation / src / main / java / org / onap / simulator / presetGenerator / presets / BasePresets / BaseMSOPreset.java
index 4f4779d..0888bd9 100644 (file)
@@ -1,36 +1,26 @@
 package org.onap.simulator.presetGenerator.presets.BasePresets;
 
+import static org.apache.commons.lang3.StringUtils.isNotEmpty;
+
 import java.util.Map;
 import vid.automation.test.infra.Features;
 
-/**
- * Created by itzikliderman on 27/12/2017.
- */
 public abstract class BaseMSOPreset extends BasePreset {
 
     public static final String DEFAULT_CLOUD_OWNER = "irma-aic";
     public static final String DEFAULT_INSTANCE_ID = "f8791436-8d55-4fde-b4d5-72dd2cf13cfb";
     protected String cloudOwner = DEFAULT_CLOUD_OWNER;
 
-    public static String getRequestBodyWithTestApiOnly() {
-        if (Features.FLAG_ADD_MSO_TESTAPI_FIELD.isActive()) {
-            return "" +
-                    "{" +
-                    "  \"requestDetails\": { " +
-                    "    \"requestParameters\": { " +
-                    "      \"testApi\": \"VNF_API\" " +
-                    "    } " +
-                    "  } " +
-                    "} " +
-                    "";
-        } else {
-            return null;
-        }
-    }
-
     protected String addCloudOwnerIfNeeded() {
         return Features.FLAG_1810_CR_ADD_CLOUD_OWNER_TO_MSO_REQUEST.isActive() ?
-                "\"cloudOwner\": \""+cloudOwner+"\"," : "";
+            "\"cloudOwner\": \"" + cloudOwner + "\"," : "";
+    }
+
+    protected String addPlatformIfNeeded(String platform) {
+        return isNotEmpty(platform) ?
+            " \"platform\": {" +
+                " \"platformName\": \"" + platform + "\"," +
+            "}," : "";
     }
 
     @Override
@@ -41,7 +31,10 @@ public abstract class BaseMSOPreset extends BasePreset {
     @Override
     public Map<String, String> getRequestHeaders() {
         Map<String, String> map = super.getRequestHeaders();
-        map.put("X-ONAP-PartnerName", "VID");
+        map.put("X-ONAP-PartnerName", "VID.VID");
+        map.put("X-ECOMP-RequestID", UUID_REGEX);
+        map.put("X-InvocationID", UUID_REGEX);
+        map.put("X-ONAP-RequestID", UUID_REGEX);
         return map;
     }
 }