Merge "Update documentation for added RIC state"
[nonrtric.git] / policy-agent / src / test / java / org / oransc / policyagent / clients / A1ClientHelper.java
index 0d5161f..2180856 100644 (file)
@@ -20,9 +20,6 @@
 
 package org.oransc.policyagent.clients;
 
-import com.google.gson.FieldNamingPolicy;
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
 
 import java.util.Arrays;
 import java.util.Vector;
@@ -38,19 +35,10 @@ import org.oransc.policyagent.repository.Ric;
 import reactor.core.publisher.Mono;
 
 public class A1ClientHelper {
-    private static Gson gson = new GsonBuilder() //
-        .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_DASHES) //
-        .create(); //
 
     private A1ClientHelper() {
     }
 
-    protected static <T> String createInputJsonString(T inputParams) {
-        JSONObject inputJson = new JSONObject();
-        inputJson.put("input", new JSONObject(gson.toJson(inputParams)));
-        return inputJson.toString();
-    }
-
     protected static Mono<String> createOutputJsonResponse(String key, String value) {
         JSONObject paramsJson = new JSONObject();
         paramsJson.put(key, value);
@@ -63,6 +51,7 @@ public class A1ClientHelper {
         RicConfig cfg = ImmutableRicConfig.builder().name("ric") //
             .baseUrl(url) //
             .managedElementIds(new Vector<String>(Arrays.asList("kista_1", "kista_2"))) //
+            .controllerName("") //
             .build();
         return new Ric(cfg);
     }
@@ -82,4 +71,10 @@ public class A1ClientHelper {
         return ImmutablePolicyType.builder().name(name).schema("schema").build();
     }
 
+    protected static String getCreateSchema(String policyType, String policyTypeId) {
+        JSONObject obj = new JSONObject(policyType);
+        JSONObject schemaObj = obj.getJSONObject("create_schema");
+        schemaObj.put("title", policyTypeId);
+        return schemaObj.toString();
+    }
 }