X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=policy-agent%2Fsrc%2Ftest%2Fjava%2Forg%2Foransc%2Fpolicyagent%2Fclients%2FA1ClientHelper.java;h=1855949d99eddb80927c1193765eb55e5cd40170;hb=c683cd55dff59dd3d67cf409e397298bee5b7b91;hp=0d5161fb956ab9aa55472bb218b126b5ac150b08;hpb=19b5cf0428e68d581c544f2c0b5c358f84d310f9;p=nonrtric.git diff --git a/policy-agent/src/test/java/org/oransc/policyagent/clients/A1ClientHelper.java b/policy-agent/src/test/java/org/oransc/policyagent/clients/A1ClientHelper.java index 0d5161fb..1855949d 100644 --- a/policy-agent/src/test/java/org/oransc/policyagent/clients/A1ClientHelper.java +++ b/policy-agent/src/test/java/org/oransc/policyagent/clients/A1ClientHelper.java @@ -40,14 +40,14 @@ import reactor.core.publisher.Mono; public class A1ClientHelper { private static Gson gson = new GsonBuilder() // .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_DASHES) // - .create(); // + .create(); private A1ClientHelper() { } protected static String createInputJsonString(T inputParams) { JSONObject inputJson = new JSONObject(); - inputJson.put("input", new JSONObject(gson.toJson(inputParams))); + inputJson.put("input", gson.toJson(inputParams)); return inputJson.toString(); } @@ -63,6 +63,7 @@ public class A1ClientHelper { RicConfig cfg = ImmutableRicConfig.builder().name("ric") // .baseUrl(url) // .managedElementIds(new Vector(Arrays.asList("kista_1", "kista_2"))) // + .controllerName("") // .build(); return new Ric(cfg); } @@ -82,4 +83,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(); + } }