Merge "Add unit tests for SdnrOnapA1Client"
[nonrtric.git] / policy-agent / src / test / java / org / oransc / policyagent / clients / A1ClientHelper.java
index e0f885d..4fd8405 100644 (file)
@@ -45,7 +45,7 @@ public class A1ClientHelper {
     private A1ClientHelper() {
     }
 
-    protected static String createInputJsonString(SdncOscAdapterInput inputParams) {
+    protected static <T> String createInputJsonString(T inputParams) {
         JSONObject inputJson = new JSONObject();
         inputJson.put("input", new JSONObject(gson.toJson(inputParams)));
         return inputJson.toString();
@@ -82,4 +82,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();
+    }
 }