diff options
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 | 24 |
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()) { |