Skip to content

Commit

Permalink
SAK-33565 Quartz Seed Sites and User job use configurable email domain (
Browse files Browse the repository at this point in the history
  • Loading branch information
ern authored Nov 8, 2017
1 parent 40d3a39 commit 98ce527
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4475,7 +4475,9 @@
# how many instructors are created and added to each site
#site.seed.instructors.per.site=1
# the size in bytes of generated content that is randomly added to the sites created site.seed.create.sites
#site.seed.repository.size=10485760
#site.seed.repository.size=10485760
# the email domain used when creating user accounts
#site.seed.email.domain=mailinator.com

# ######################################
# SAK-26283 Unenroll users before delete
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public class SeedSitesAndUsersJob implements Job {
private int numberOfStudents = 100;
private int numberOfEnnrollmentsPerSite = 50;
private int numberOfInstructorsPerSite = 1;
private String emailDomain = "mailinator.com";

private long repositorySize = 10485760; // 10 MB
//private long repositorySize = 1073741824L; // 1 GB
Expand All @@ -124,7 +125,8 @@ public void init() {
numberOfStudents = serverConfigurationService.getInt("site.seed.create.students", 100);
numberOfEnnrollmentsPerSite = serverConfigurationService.getInt("site.seed.enrollments.per.site", 50);
numberOfInstructorsPerSite = serverConfigurationService.getInt("site.seed.instructors.per.site", 1);

emailDomain = serverConfigurationService.getString("site.seed.email.domain", "mailinator.com");

try {
repositorySize = Long.parseLong(serverConfigurationService.getString("site.seed.repository.size", "10485760"));
} catch (NumberFormatException nfe) {
Expand Down Expand Up @@ -273,7 +275,7 @@ private User createUser(String userType) {
String lastName = faker.name().lastName();
String eid = faker.numerify("#########");
try {
user = userDirectoryService.addUser(null, eid, faker.name().firstName(), lastName, eid + "@nowhere.com", faker.letterify("???????"), userType, null);
user = userDirectoryService.addUser(null, eid, faker.name().firstName(), lastName, eid + "@" + emailDomain, faker.letterify("???????"), userType, null);
} catch (UserIdInvalidException uiue) {
log.error("invalid userId: ", uiue);
} catch (UserAlreadyDefinedException uade) {
Expand Down

0 comments on commit 98ce527

Please sign in to comment.