diff options
author | 2018-04-08 14:03:29 +0300 | |
---|---|---|
committer | 2018-04-09 18:03:21 +0000 | |
commit | 1788983cf083303c51d538608c92abbebef10307 (patch) | |
tree | a70997752b5448dc45739309c53df2ef49f5f59f /test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/UserRoleEnum.java | |
parent | 0ebace5621e54b8102b0371f0500340adedf7f75 (diff) |
fix use of user credentials logic
Change-Id: If518234e78983fe35ceb4b971d5093052ee824bb
Issue-ID: SDC-384
Signed-off-by: Yuli Shlosberg <ys9693@att.com>
Diffstat (limited to 'test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/UserRoleEnum.java')
-rw-r--r-- | test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/UserRoleEnum.java | 69 |
1 files changed, 43 insertions, 26 deletions
diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/UserRoleEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/UserRoleEnum.java index aa70c376bb..7f19d45dfb 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/UserRoleEnum.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/enums/UserRoleEnum.java @@ -20,30 +20,44 @@ package org.openecomp.sdc.ci.tests.datatypes.enums; +import org.openecomp.sdc.ci.tests.config.UserCredentialsFromFile; +import org.openecomp.sdc.ci.tests.datatypes.UserCredentials; + public enum UserRoleEnum { -// ADMIN("jh0003", "Jimmy", "Hendrix"), DESIGNER("cs0008", "Carlos", "Santana"), DESIGNER2("me0009", "Melissa","Etheridge"), TESTER("jm0007", "Joni", "Mitchell"), ADMIN4("km2000", "Kot", "May"), +// ADMIN("jh0003", "Jimmy", "Hendrix"), DESIGNER("cs0008", "Carlos", "Santana"), DESIGNER2("me0009", "Melissa","Etheridge"), TESTER("jm0007", "Joni", "Mitchell"), ADMIN4("km2000", "Kot", "May"), // GOVERNOR("gv0001","David", "Shadmi"), OPS("op0001", "Steve", "Regev"), PRODUCT_STRATEGIST1("ps0001", "Eden","Rozin"), PRODUCT_STRATEGIST2("ps0002", "Ella", "Kvetny"), PRODUCT_STRATEGIST3("ps0003", "Geva", "Alon"), // PRODUCT_MANAGER1("pm0001", "Teddy", "Isashar"), PRODUCT_MANAGER2("pm0002", "Sarah", "Bettens"); - ADMIN("jh0003", "Jimmy", "Hendrix"), DESIGNER("m08740", "Zero", "ASDCMech"), DESIGNER2("me0009", "Melissa","Etheridge"), DESIGNER3("cs0008", "Carlos", "Santana"),TESTER("jm0007", "Johnny", "Depp"), ADMIN4("km2000", "Kot", "May"), - GOVERNOR("gv0001","David", "Shadmi"), OPS("af0006", "Aretha", "Franklin"), PRODUCT_STRATEGIST1("ps0001", "Eden","Rozin"), PRODUCT_STRATEGIST2("ps0002", "Ella", "Kvetny"), PRODUCT_STRATEGIST3("ps0003", "Geva", "Alon"), - PRODUCT_MANAGER1("pm0001", "Teddy", "Isashar"), PRODUCT_MANAGER2("pm0002", "Sarah", "Bettens"); + ADMIN("admin"), + ADMIN2("admin"), + DESIGNER("designer"), + DESIGNER2("designer"), + TESTER("tester"), + GOVERNOR("governor"), + OPS("ops"), + PRODUCT_STRATEGIST1("ops"), + PRODUCT_STRATEGIST2("ops"), + PRODUCT_STRATEGIST3("ops"), + PRODUCT_MANAGER1("ops"), + PRODUCT_MANAGER2("ops"); + + private String password; private String userId; private String firstName; - private String lastName; - private String userName; + private String lastName; - private UserRoleEnum(String userId, String userName) { - this.userId = userId; - this.userName = userName; - } - private UserRoleEnum(String userId, String firstName, String lastName) { - this.userId = userId; - this.firstName = firstName; - this.lastName = lastName; - this.userName = firstName + " " + lastName; - } + private UserRoleEnum(String userRole) { + String name = name(); + final UserCredentialsFromFile instance = UserCredentialsFromFile.getInstance(); + this.credentials = instance.getUserCredentialsByRole(userRole); + this.userId = this.credentials.getUserId(); + this.firstName = this.credentials.getFirstName(); + this.lastName = this.credentials.getLastName(); + this.password = this.credentials.getPassword(); + this.userName = this.firstName + " " + this.lastName; + } + public String getUserId() { return userId; @@ -53,14 +67,6 @@ public enum UserRoleEnum { this.userId = userId; } - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - public String getFirstName() { return firstName; } @@ -69,12 +75,23 @@ public enum UserRoleEnum { this.firstName = firstName; } + public UserCredentials getCredentials() { + return credentials; + } + public String getLastName() { return lastName; } - public void setLastName(String lastName) { - this.lastName = lastName; + public String getUserName() { + return userName; } + private String userName; + private UserCredentials credentials; + + + public String getPassword() { + return password; + } } |