From f4dff328c0386c8901b5841943b11f0c13b3169f Mon Sep 17 00:00:00 2001 From: Ittay Stern Date: Mon, 8 Jul 2019 15:46:44 +0300 Subject: Merge from ecomp 718fd196 - Integration Tests Issue-ID: VID-378 Change-Id: Icc0bdb9ef37b1d429d47c2070f76d1ee63ad7489 Signed-off-by: Ittay Stern --- .../vid/automation/test/services/UsersService.java | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'vid-automation/src/main/java/vid/automation/test/services/UsersService.java') 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 roles = user.roles != null ? user.roles : new LinkedList<>(); - roles.add("Standard User"); ListIterator iter = roles.listIterator(); while (iter.hasNext()) { -- cgit 1.2.3-korg