aboutsummaryrefslogtreecommitdiffstats
path: root/vid-automation/src/main/java/vid/automation/test/services/UsersService.java
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2019-07-08 15:46:44 +0300
committerIttay Stern <ittay.stern@att.com>2019-07-08 18:50:38 +0300
commitf4dff328c0386c8901b5841943b11f0c13b3169f (patch)
tree4e64c3ee540410b2593c1ebecd0dddd3a4780592 /vid-automation/src/main/java/vid/automation/test/services/UsersService.java
parentf792671ae247a931f34d902e9276202b5016ef9a (diff)
Merge from ecomp 718fd196 - Integration Tests
Issue-ID: VID-378 Change-Id: Icc0bdb9ef37b1d429d47c2070f76d1ee63ad7489 Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-automation/src/main/java/vid/automation/test/services/UsersService.java')
-rw-r--r--vid-automation/src/main/java/vid/automation/test/services/UsersService.java24
1 files changed, 13 insertions, 11 deletions
diff --git a/vid-automation/src/main/java/vid/automation/test/services/UsersService.java b/vid-automation/src/main/java/vid/automation/test/services/UsersService.java
index aae7917f7..84345ebd1 100644
--- a/vid-automation/src/main/java/vid/automation/test/services/UsersService.java
+++ b/vid-automation/src/main/java/vid/automation/test/services/UsersService.java
@@ -1,10 +1,13 @@
package vid.automation.test.services;
-import static org.hamcrest.CoreMatchers.everyItem;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.greaterThan;
-
+//import com.automation.common.report_portal_integration.annotations.Step;
import com.google.common.primitives.Ints;
+import org.apache.commons.lang3.StringUtils;
+import vid.automation.test.model.User;
+import vid.automation.test.model.UsersObject;
+import vid.automation.test.utils.DB_CONFIG;
+import vid.automation.test.utils.ReadFile;
+
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
@@ -13,11 +16,10 @@ import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
-import org.apache.commons.lang3.StringUtils;
-import vid.automation.test.model.User;
-import vid.automation.test.model.UsersObject;
-import vid.automation.test.utils.DB_CONFIG;
-import vid.automation.test.utils.ReadFile;
+
+import static org.hamcrest.CoreMatchers.everyItem;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.greaterThan;
/**
* Created by itzikliderman on 08/09/2017.
@@ -36,6 +38,7 @@ public class UsersService {
return usersObject.users;
}
+ //@Step("${method} with id: ${userId}")
public User getUser(String userId) {
User res = users.get(userId);
System.out.println("getUser userId='" + userId + "' returned: " + res);
@@ -52,7 +55,7 @@ public class UsersService {
/*
Creates a user in the DB, were:
- Login user name is a deterministic number, hashed from the userId string, with 3 trailing zeroes,
- and two leading letters from the userId itself; e.g. "mo26063000" for emanuel.
+ and two leading letters from the userId itself; e.g. "em97331000" for emanuel.
- Login user name == user password
- 'user.credentials.userId' and 'user.credentials.password' input fields are overridden with the generated values.
- Roles are "read" (roleId==16) and all other roles in object (like subscriberName___serviceType___tenant).
@@ -79,7 +82,6 @@ public class UsersService {
"VALUES (" + userNumber + ", '" + user.credentials.userId + "', '" + userId + "', '" + user.credentials.userId + "', '" + user.credentials.password + "')");
List<String> roles = user.roles != null ? user.roles : new LinkedList<>();
- roles.add("Standard User");
ListIterator<String> iter = roles.listIterator();
while (iter.hasNext()) {