Rework the cldsUser
Reformat the JSON files and update the code in CldsUser
Change-Id: If82e5e21695189532d7352912db4d4a7be504852
Issue-ID: CLAMP-74
Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
diff --git a/src/main/java/org/onap/clamp/clds/service/CldsUser.java b/src/main/java/org/onap/clamp/clds/service/CldsUser.java
index 34a3f8e..db8a24f 100644
--- a/src/main/java/org/onap/clamp/clds/service/CldsUser.java
+++ b/src/main/java/org/onap/clamp/clds/service/CldsUser.java
@@ -26,11 +26,8 @@
import java.util.Arrays;
public class CldsUser {
-
private String user;
-
private String password;
-
private SecureServicePermission[] permissions;
/**
@@ -67,7 +64,7 @@
* @return the permissions
*/
public SecureServicePermission[] getPermissions() {
- return permissions;
+ return Arrays.copyOf(permissions, permissions.length);
}
public String[] getPermissionsString() {
@@ -78,7 +75,7 @@
* @param permissions
* the permissions to set
*/
- public void setPermissions(SecureServicePermission[] permissions) {
- this.permissions = permissions;
+ public void setPermissions(SecureServicePermission[] permissionsArray) {
+ this.permissions = Arrays.copyOf(permissionsArray, permissionsArray.length);
}
}
diff --git a/src/test/resources/clds/clds-users-incomplete-permissions.json b/src/test/resources/clds/clds-users-incomplete-permissions.json
index a642511..9e3534f 100644
--- a/src/test/resources/clds/clds-users-incomplete-permissions.json
+++ b/src/test/resources/clds/clds-users-incomplete-permissions.json
@@ -1,14 +1,14 @@
- [{
- "user":"admin1",
- "password":"5f4dcc3b5aa765d61d8327deb882cf99",
- "permissions":
- [
- "permission-type-cl|dev|",
- "permission-type-cl|dev",
- "permission-type-cl-manage|dev|*",
- "permission-type-filter-vf|dev|*",
- "permission-type-template|dev|read",
- "permission-type-template|dev|update"
- ]
+[
+ {
+ "user": "admin1",
+ "password": "5f4dcc3b5aa765d61d8327deb882cf99",
+ "permissions": [
+ "permission-type-cl|dev|",
+ "permission-type-cl|dev",
+ "permission-type-cl-manage|dev|*",
+ "permission-type-filter-vf|dev|*",
+ "permission-type-template|dev|read",
+ "permission-type-template|dev|update"
+ ]
}
-]
\ No newline at end of file
+]
diff --git a/src/test/resources/clds/clds-users-no-permission.json b/src/test/resources/clds/clds-users-no-permission.json
index 77f16c3..ac91540 100644
--- a/src/test/resources/clds/clds-users-no-permission.json
+++ b/src/test/resources/clds/clds-users-no-permission.json
@@ -1,9 +1,7 @@
- [{
- "user":"admin1",
- "permissions":
- [
-
- ]
+[
+ {
+ "user": "admin1",
+ "permissions": [
+ ]
}
-
-]
\ No newline at end of file
+]
diff --git a/src/test/resources/clds/clds-users-two-users.json b/src/test/resources/clds/clds-users-two-users.json
index 8c8d727..b372194 100644
--- a/src/test/resources/clds/clds-users-two-users.json
+++ b/src/test/resources/clds/clds-users-two-users.json
@@ -1,28 +1,26 @@
- [{
- "user":"admin1",
- "password":"5f4dcc3b5aa765d61d8327deb882cf99",
- "permissions":
- [
- "permission-type-cl|dev|read",
- "permission-type-cl|dev|update",
- "permission-type-cl-manage|dev|*",
- "permission-type-filter-vf|dev|*",
- "permission-type-template|dev|read",
- "permission-type-template|dev|update"
- ]
+[
+ {
+ "user": "admin1",
+ "password": "5f4dcc3b5aa765d61d8327deb882cf99",
+ "permissions": [
+ "permission-type-cl|dev|read",
+ "permission-type-cl|dev|update",
+ "permission-type-cl-manage|dev|*",
+ "permission-type-filter-vf|dev|*",
+ "permission-type-template|dev|read",
+ "permission-type-template|dev|update"
+ ]
+ },
+ {
+ "user": "admin2",
+ "password": "5f4dcc3b5aa765d61d8327deb882cf99",
+ "permissions": [
+ "permission-type-cl|dev|read",
+ "permission-type-cl|dev|update",
+ "permission-type-cl-manage|dev|*",
+ "permission-type-filter-vf|dev|*",
+ "permission-type-template|dev|read",
+ "permission-type-template|dev|update"
+ ]
}
- ,
- {"user":"admin2",
- "password":"5f4dcc3b5aa765d61d8327deb882cf99",
- "permissions":
- [
- "permission-type-cl|dev|read",
- "permission-type-cl|dev|update",
- "permission-type-cl-manage|dev|*",
- "permission-type-filter-vf|dev|*",
- "permission-type-template|dev|read",
- "permission-type-template|dev|update"
- ]
-
- }
-]
\ No newline at end of file
+]