fix use of user credentials logic
[sdc.git] / test-apis-ci / src / main / java / org / openecomp / sdc / ci / tests / datatypes / enums / UserRoleEnum.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.sdc.ci.tests.datatypes.enums;
22
23 import org.openecomp.sdc.ci.tests.config.UserCredentialsFromFile;
24 import org.openecomp.sdc.ci.tests.datatypes.UserCredentials;
25
26 public enum UserRoleEnum {
27
28 //      ADMIN("jh0003", "Jimmy", "Hendrix"), DESIGNER("cs0008", "Carlos", "Santana"), DESIGNER2("me0009", "Melissa","Etheridge"), TESTER("jm0007", "Joni", "Mitchell"), ADMIN4("km2000", "Kot", "May"),
29 //      GOVERNOR("gv0001","David", "Shadmi"), OPS("op0001", "Steve", "Regev"), PRODUCT_STRATEGIST1("ps0001", "Eden","Rozin"), PRODUCT_STRATEGIST2("ps0002", "Ella", "Kvetny"), PRODUCT_STRATEGIST3("ps0003", "Geva", "Alon"), 
30 //      PRODUCT_MANAGER1("pm0001", "Teddy", "Isashar"), PRODUCT_MANAGER2("pm0002", "Sarah", "Bettens");
31         ADMIN("admin"),
32         ADMIN2("admin"),
33     DESIGNER("designer"),
34         DESIGNER2("designer"),
35     TESTER("tester"),
36     GOVERNOR("governor"),
37     OPS("ops"),
38         PRODUCT_STRATEGIST1("ops"),
39         PRODUCT_STRATEGIST2("ops"),
40         PRODUCT_STRATEGIST3("ops"),
41         PRODUCT_MANAGER1("ops"),
42         PRODUCT_MANAGER2("ops");
43
44         private String password;
45         private String userId;
46         private String firstName;
47     private String lastName;
48
49
50     private UserRoleEnum(String userRole) {
51         String name = name();
52         final UserCredentialsFromFile instance = UserCredentialsFromFile.getInstance();
53         this.credentials = instance.getUserCredentialsByRole(userRole);
54         this.userId = this.credentials.getUserId();
55         this.firstName = this.credentials.getFirstName();
56                 this.lastName = this.credentials.getLastName();
57                 this.password = this.credentials.getPassword();
58                 this.userName = this.firstName + " " + this.lastName;
59     }
60
61
62         public String getUserId() {
63                 return userId;
64         }
65
66         public void setUserId(String userId) {
67                 this.userId = userId;
68         }
69
70         public String getFirstName() {
71                 return firstName;
72         }
73
74         public void setFirstName(String firstName) {
75                 this.firstName = firstName;
76         }
77
78         public UserCredentials getCredentials() {
79                 return credentials;
80         }
81
82         public String getLastName() {
83                 return lastName;
84         }
85
86         public String getUserName() {
87                 return userName;
88         }
89
90         private String userName;
91         private UserCredentials credentials;
92
93
94         public String getPassword() {
95                 return password;
96         }
97 }