diff options
author | Amichai Hemli <ah0398@intl.att.com> | 2019-03-18 10:07:02 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-03-18 10:07:02 +0000 |
commit | a036637a4d466662128cde1823816578e76c69e0 (patch) | |
tree | d58add45a75701717e67de676463fc6b15068f9d /vid-automation/src/main/java/vid/automation/test/services/UsersService.java | |
parent | 756a9c041981e05a3f5bd740ebc0d3fc22579003 (diff) | |
parent | 66af8b9b391879be78660d6ccb0a1f1f9340b423 (diff) |
Merge "Merge automation from ECOMP's repository"
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.java | 23 |
1 files changed, 11 insertions, 12 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 ac8af4511..aae7917f7 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,12 +1,10 @@ package vid.automation.test.services; -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 static org.hamcrest.CoreMatchers.everyItem; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.greaterThan; +import com.google.common.primitives.Ints; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; @@ -15,10 +13,11 @@ import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.ListIterator; - -import static org.hamcrest.CoreMatchers.everyItem; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.greaterThan; +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; /** * Created by itzikliderman on 08/09/2017. @@ -53,7 +52,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 mobility. + and two leading letters from the userId itself; e.g. "mo26063000" 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). @@ -77,7 +76,7 @@ public class UsersService { user.credentials.password = getLoginId(userId); stmt.addBatch("INSERT INTO `fn_user` (`USER_ID`, `ORG_USER_ID`, `FIRST_NAME`, `LOGIN_ID`, `LOGIN_PWD`) " + - "VALUES (" + userNumber + ", '" + userId + "', '" + userId + "', '" + user.credentials.userId + "', '" + user.credentials.password + "')"); + "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"); |