Rename username for PAP operations. 59/125559/1
authoradheli.tavares <adheli.tavares@est.tech>
Wed, 3 Nov 2021 08:42:47 +0000 (08:42 +0000)
committerAdheli Tavares <adheli.tavares@est.tech>
Wed, 3 Nov 2021 13:06:22 +0000 (13:06 +0000)
Use an account other than healthcheck in PAP for provisioning of policies.

Issue-ID: POLICY-2744
Change-Id: I897f7a4fffbac2d4bbd9cceb059bae1794753aa7
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
main/src/test/java/org/onap/policy/pap/main/rest/CommonPapRestServer.java
main/src/test/java/org/onap/policy/pap/main/rest/TestPdpGroupCreateOrUpdateControllerV1.java
main/src/test/resources/e2e/PapConfigParameters.json
main/src/test/resources/parameters/MinimumParameters.json
main/src/test/resources/parameters/PapConfigParameters.json
main/src/test/resources/parameters/PapConfigParametersStd.json
main/src/test/resources/parameters/PapConfigParameters_InvalidName.json
packages/policy-pap-tarball/src/main/resources/etc/defaultConfig.json
postman/pap-api-collection.json
testsuites/stability/src/main/resources/papsetup/config/pap/etc/defaultConfig.json
testsuites/stability/src/main/resources/testplans/stability.jmx

index e1d1e14..98a24a6 100644 (file)
@@ -60,7 +60,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Class to perform unit test of {@link PapRestServer}.
+ * Class to perform unit test of {@link PapRestControllerV1}.
  *
  * @author Ram Krishna Verma (ram.krishna.verma@est.tech)
  */
@@ -214,7 +214,7 @@ public class CommonPapRestServer {
     /**
      * Stops the "Main".
      *
-     * @throws Exception if an error occurs
+     * @throws PolicyPapException if an error occurs
      */
     private static void stopMain() throws PolicyPapException {
         if (main != null) {
@@ -294,7 +294,7 @@ public class CommonPapRestServer {
         client.register(GsonMessageBodyHandler.class);
 
         if (includeAuth) {
-            final HttpAuthenticationFeature feature = HttpAuthenticationFeature.basic("healthcheck", "zb!XztG34");
+            final HttpAuthenticationFeature feature = HttpAuthenticationFeature.basic("policyadmin", "zb!XztG34");
             client.register(feature);
         }
 
index 3124641..2b08b2c 100644 (file)
@@ -23,7 +23,7 @@ package org.onap.policy.pap.main.rest;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
-import java.util.Arrays;
+import java.util.List;
 import javax.ws.rs.client.Entity;
 import javax.ws.rs.client.Invocation;
 import javax.ws.rs.core.MediaType;
@@ -72,9 +72,9 @@ public class TestPdpGroupCreateOrUpdateControllerV1 extends CommonPapRestServer
         PdpGroup group = new PdpGroup();
         group.setName("drools-group");
         group.setDescription("my description");
-        group.setPdpSubgroups(Arrays.asList(subgrp));
+        group.setPdpSubgroups(List.of(subgrp));
         PdpGroups groups = new PdpGroups();
-        groups.setGroups(Arrays.asList(group));
+        groups.setGroups(List.of(group));
         return Entity.entity(groups, MediaType.APPLICATION_JSON);
     }
 }
index b10f580..b2e100a 100644 (file)
@@ -3,7 +3,7 @@
     "restServerParameters": {
         "host": "0.0.0.0",
         "port": ${port},
-        "userName": "healthcheck",
+        "userName": "policyadmin",
         "password": "zb!XztG34",
         "https": true
     },
@@ -54,7 +54,7 @@
         "clientName": "api",
         "hostname": "policy-api",
         "port": 6969,
-        "userName": "healthcheck",
+        "userName": "policyadmin",
         "password": "zb!XztG34",
         "useHttps": true,
         "basePath": "policy/api/v1/healthcheck"
index 1e4457f..3c439d1 100644 (file)
@@ -3,7 +3,7 @@
     "restServerParameters":{
         "host":"0.0.0.0",
         "port":6901,
-        "userName":"healthcheck",
+        "userName":"policyadmin",
         "password":"zb!XztG34"
     },
     "pdpParameters": {
@@ -43,7 +43,7 @@
         "clientName": "api",
         "hostname": "policy-api",
         "port": 6969,
-        "userName": "healthcheck",
+        "userName": "policyadmin",
         "password": "zb!XztG34",
         "useHttps": true,
         "basePath": "policy/api/v1/healthcheck"
index 4f59d69..bb1a758 100644 (file)
@@ -3,7 +3,7 @@
     "restServerParameters": {
         "host": "0.0.0.0",
         "port": 6903,
-        "userName": "healthcheck",
+        "userName": "policyadmin",
         "password": "zb!XztG34",
         "https": true
     },
index 56e891a..9ba3f12 100644 (file)
@@ -3,7 +3,7 @@
     "restServerParameters": {
         "host": "0.0.0.0",
         "port": ${port},
-        "userName": "healthcheck",
+        "userName": "policyadmin",
         "password": "zb!XztG34",
         "https": true
     },
@@ -56,7 +56,7 @@
         "clientName": "api",
         "hostname": "policy-api",
         "port": 6969,
-        "userName": "healthcheck",
+        "userName": "policyadmin",
         "password": "zb!XztG34",
         "useHttps": true,
         "basePath": "policy/api/v1/healthcheck"
index 3e81245..97db16c 100644 (file)
@@ -3,7 +3,7 @@
     "restServerParameters":{
         "host":"0.0.0.0",
         "port":6902,
-        "userName":"healthcheck",
+        "userName":"policyadmin",
         "password":"zb!XztG34"
     },
     "pdpParameters": {
index 573ecc9..c350e16 100644 (file)
@@ -3,7 +3,7 @@
     "restServerParameters": {
         "host": "0.0.0.0",
         "port": 6969,
-        "userName": "healthcheck",
+        "userName": "policyadmin",
         "password": "zb!XztG34",
         "https": true,
         "aaf": false,
@@ -60,7 +60,7 @@
         "clientName": "api",
         "hostname": "policy-api",
         "port": 6969,
-        "userName": "healthcheck",
+        "userName": "policyadmin",
         "password": "zb!XztG34",
         "useHttps": true,
         "basePath": "policy/api/v1/healthcheck"
index 421b9a7..483468c 100644 (file)
     "variable": [
         {
             "key": "USER",
-            "value": "healthcheck",
+            "value": "policyadmin",
             "type": "string"
         },
         {
index b98cdef..2338f93 100644 (file)
@@ -3,7 +3,7 @@
     "restServerParameters": {
         "host": "0.0.0.0",
         "port": 6969,
-        "userName": "healthcheck",
+        "userName": "policyadmin",
         "password": "zb!XztG34",
         "https": true,
         "aaf": false
index 2291883..32d985f 100644 (file)
         <collectionProp name="AuthManager.auth_list">
           <elementProp name="" elementType="Authorization">
             <stringProp name="Authorization.url">http://${PAP_HOST}:${PAP_PORT}/policy/pap/v1</stringProp>
-            <stringProp name="Authorization.username">healthcheck</stringProp>
+            <stringProp name="Authorization.username">policyadmin</stringProp>
             <stringProp name="Authorization.password">zb!XztG34</stringProp>
             <stringProp name="Authorization.domain"></stringProp>
             <stringProp name="Authorization.realm"></stringProp>
           </elementProp>
           <elementProp name="" elementType="Authorization">
             <stringProp name="Authorization.url">http://${API_HOST}:${API_PORT}/policy/api/v1</stringProp>
-            <stringProp name="Authorization.username">healthcheck</stringProp>
+            <stringProp name="Authorization.username">policyadmin</stringProp>
             <stringProp name="Authorization.password">zb!XztG34</stringProp>
             <stringProp name="Authorization.domain"></stringProp>
             <stringProp name="Authorization.realm"></stringProp>