Removed one test policy type 82/2382/1
authorPatrikBuhr <patrik.buhr@est.tech>
Thu, 30 Jan 2020 09:08:47 +0000 (10:08 +0100)
committerPatrikBuhr <patrik.buhr@est.tech>
Thu, 30 Jan 2020 09:09:53 +0000 (10:09 +0100)
Change-Id: I7a23ed8ebef4feee12ceddabc09ef5c8a4468545
Issue-ID: NONRTRIC-107
Signed-off-by: PatrikBuhr <patrik.buhr@est.tech>
dashboard/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/config/PolicyControllerMockConfiguration.java
dashboard/webapp-backend/src/test/resources/anr-policy-instance.json [deleted file]
dashboard/webapp-backend/src/test/resources/anr-policy-schema.json [deleted file]
policy-agent/src/test/java/org/oransc/policyagent/ApplicationTest.java
policy-agent/src/test/resources/policy_types/anr-policy-schema.json [deleted file]

index e695b68..2268fe0 100644 (file)
@@ -57,8 +57,8 @@ public class PolicyControllerMockConfiguration {
     private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
     private static com.google.gson.Gson gson = new GsonBuilder() //
-        .serializeNulls() //
-        .create(); //
+            .serializeNulls() //
+            .create(); //
 
     @Bean
     public PolicyAgentApi policyAgentApi() {
@@ -76,7 +76,7 @@ public class PolicyControllerMockConfiguration {
 
         @Override
         public ResponseEntity<String> putPolicy(String policyTypeIdString, String policyInstanceId, String json,
-            String ric) {
+                String ric) {
             database.putInstance(policyTypeIdString, policyInstanceId, json, ric);
             return new ResponseEntity<>("Policy was put successfully", HttpStatus.OK);
         }
@@ -115,32 +115,23 @@ public class PolicyControllerMockConfiguration {
     class Database {
 
         Database() {
-            String schema = getStringFromFile("anr-policy-schema.json");
-            PolicyType policy = new PolicyType("ANR", schema);
-            types.put("ANR", policy);
-
-            schema = getStringFromFile("demo-policy-schema-1.json");
-            policy = new PolicyType("type2", schema);
-            types.put("type2", policy);
+            String schema = getStringFromFile("demo-policy-schema-1.json");
+            PolicyType policyType = new PolicyType("type2", schema);
+            types.put("type2", policyType);
 
             schema = getStringFromFile("demo-policy-schema-2.json");
-            policy = new PolicyType("type3", schema);
-            types.put("type3", policy);
+            policyType = new PolicyType("type3", schema);
+            types.put("type3", policyType);
 
             schema = getStringFromFile("demo-policy-schema-3.json");
-            policy = new PolicyType("type4", schema);
-            types.put("type4", policy);
-            try {
-                putInstance("ANR", "ANR-1", getStringFromFile("anr-policy-instance.json"), "ric_1");
-            } catch (Exception e) {
-                // Nothing
-            }
+            policyType = new PolicyType("type4", schema);
+            types.put("type4", policyType);
         }
 
         private String getStringFromFile(String path) {
             try {
-                InputStream inputStream =
-                    MethodHandles.lookup().lookupClass().getClassLoader().getResourceAsStream(path);
+                InputStream inputStream = MethodHandles.lookup().lookupClass().getClassLoader()
+                        .getResourceAsStream(path);
                 return new BufferedReader(new InputStreamReader(inputStream)).lines().collect(Collectors.joining("\n"));
             } catch (Exception e) {
                 logger.error("Cannot read file :" + path, e);
@@ -158,7 +149,7 @@ public class PolicyControllerMockConfiguration {
 
         void putInstance(String typeId, String instanceId, String instanceData, String ric) {
             PolicyInfo i = ImmutablePolicyInfo.builder().json(instanceData).lastModified(getTimeStampUTC())
-                .id(instanceId).ric(ric).service("service").type(typeId).build();
+                    .id(instanceId).ric(ric).service("service").type(typeId).build();
             instances.put(instanceId, i);
         }
 
diff --git a/dashboard/webapp-backend/src/test/resources/anr-policy-instance.json b/dashboard/webapp-backend/src/test/resources/anr-policy-instance.json
deleted file mode 100644 (file)
index 0d7315e..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-  "servingCellNrcgi": "Cell1",
-  "neighborCellNrpci": "NCell1",
-  "neighborCellNrcgi": "Ncell1",
-  "flagNoHo": true,
-  "flagNoXn": true,
-  "flagNoRemove": true
-}
\ No newline at end of file
diff --git a/dashboard/webapp-backend/src/test/resources/anr-policy-schema.json b/dashboard/webapp-backend/src/test/resources/anr-policy-schema.json
deleted file mode 100644 (file)
index 6e0263d..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-{
-  "$schema": "http://json-schema.org/draft-07/schema#",
-  "title": "ANR",
-  "description": "ANR Neighbour Cell Relation Policy",
-  "type": "object",
-  "properties": {
-    "servingCellNrcgi": {
-      "type": "string",
-      "description": "Serving Cell Identifier (NR CGI)"
-    },
-    "neighborCellNrpci": {
-      "type": "string",
-      "description": "Neighbor Cell Identifier (NR PCI)"
-    },
-    "neighborCellNrcgi": {
-      "type": "string",
-      "description": "Neighbor Cell Identifier (NR CGI)"
-    },
-    "flagNoHo": {
-      "type": "boolean",
-      "description": "Flag for HANDOVER NOT ALLOWED"
-    },
-    "flagNoXn": {
-      "type": "boolean",
-      "description": "Flag for Xn CONNECTION NOT ALLOWED"
-    },
-    "flagNoRemove": {
-      "type": "boolean",
-      "description": "Flag for DELETION NOT ALLOWED"
-    }
-  },
-  "required": [
-    "servingCellNrcgi",
-    "neighborCellNrpci",
-    "neighborCellNrcgi",
-    "flagNoHo",
-    "flagNoXn",
-    "flagNoRemove"
-  ]
-}
\ No newline at end of file
index 3e5932f..847cde1 100644 (file)
@@ -180,7 +180,7 @@ public class ApplicationTest {
         System.out.println(rsp);
         assertThat(rsp).contains("kista_1");
 
-        url = baseUrl() + "/rics?policyType=ANR";
+        url = baseUrl() + "/rics?policyType=STD_PolicyModelUnconstrained_0.2.0";
         rsp = this.restTemplate.getForObject(url, String.class);
         assertThat(rsp).isEqualTo("[]");
     }
diff --git a/policy-agent/src/test/resources/policy_types/anr-policy-schema.json b/policy-agent/src/test/resources/policy_types/anr-policy-schema.json
deleted file mode 100644 (file)
index 6e0263d..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-{
-  "$schema": "http://json-schema.org/draft-07/schema#",
-  "title": "ANR",
-  "description": "ANR Neighbour Cell Relation Policy",
-  "type": "object",
-  "properties": {
-    "servingCellNrcgi": {
-      "type": "string",
-      "description": "Serving Cell Identifier (NR CGI)"
-    },
-    "neighborCellNrpci": {
-      "type": "string",
-      "description": "Neighbor Cell Identifier (NR PCI)"
-    },
-    "neighborCellNrcgi": {
-      "type": "string",
-      "description": "Neighbor Cell Identifier (NR CGI)"
-    },
-    "flagNoHo": {
-      "type": "boolean",
-      "description": "Flag for HANDOVER NOT ALLOWED"
-    },
-    "flagNoXn": {
-      "type": "boolean",
-      "description": "Flag for Xn CONNECTION NOT ALLOWED"
-    },
-    "flagNoRemove": {
-      "type": "boolean",
-      "description": "Flag for DELETION NOT ALLOWED"
-    }
-  },
-  "required": [
-    "servingCellNrcgi",
-    "neighborCellNrpci",
-    "neighborCellNrcgi",
-    "flagNoHo",
-    "flagNoXn",
-    "flagNoRemove"
-  ]
-}
\ No newline at end of file