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;
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.
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);
/*
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).
"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()) {