// Path: authrite-acctests/src/main/java/com/lewisd/authrite/acctests/model/User.java
// public class User {
// 
//     private UUID id;
//     private String email;
//     private String displayName;
//     private Set<Roles> roles;
//     private Date createdDate;
//     private Date modifiedDate;
//     private Date deletedDate;
//     private Date lastLoginDate;
//     private Date lastPasswordChangeDate;
//     private Date emailValidatedDate;
// 
//     public User() {
//         // for deserialization
//     }
// 
//     public User(final UUID id, final String email, final String displayName, final Set<Roles> roles) {
//         this.id = id;
//         this.email = email;
//         this.displayName = displayName;
//         this.roles = roles;
//     }
// 
//     public UUID getId() {
//         return id;
//     }
// 
//     public void setId(final UUID id) {
//         this.id = id;
//     }
// 
//     public String getEmail() {
//         return email;
//     }
// 
//     public void setEmail(final String email) {
//         this.email = email;
//     }
// 
//     public String getDisplayName() {
//         return displayName;
//     }
// 
//     public void setDisplayName(final String displayName) {
//         this.displayName = displayName;
//     }
// 
//     public Set<Roles> getRoles() {
//         return roles;
//     }
// 
//     public void setRoles(final Set<Roles> roles) {
//         this.roles = roles;
//     }
// 
//     public Date getCreatedDate() {
//         return createdDate;
//     }
// 
//     public void setCreatedDate(final Date createdDate) {
//         this.createdDate = createdDate;
//     }
// 
//     public Date getModifiedDate() {
//         return modifiedDate;
//     }
// 
//     public void setModifiedDate(final Date modifiedDate) {
//         this.modifiedDate = modifiedDate;
//     }
// 
//     public Date getDeletedDate() {
//         return deletedDate;
//     }
// 
//     public void setDeletedDate(final Date deletedDate) {
//         this.deletedDate = deletedDate;
//     }
// 
//     public Date getLastLoginDate() {
//         return lastLoginDate;
//     }
// 
//     public void setLastLoginDate(final Date lastLoginDate) {
//         this.lastLoginDate = lastLoginDate;
//     }
// 
//     public Date getLastPasswordChangeDate() {
//         return lastPasswordChangeDate;
//     }
// 
//     public void setLastPasswordChangeDate(final Date lastPasswordChangeDate) {
//         this.lastPasswordChangeDate = lastPasswordChangeDate;
//     }
// 
//     public Date getEmailValidatedDate() {
//         return emailValidatedDate;
//     }
// 
//     public void setEmailValidatedDate(final Date emailValidatedDate) {
//         this.emailValidatedDate = emailValidatedDate;
//     }
// }
// 
// Path: authrite-service/src/main/java/com/lewisd/authrite/auth/Roles.java
// public enum Roles {
//     PLAYER {
//         @Override
//         protected boolean canReadUser(final User principal, final UUID userId) {
//             return userId.equals(principal.getId());
//         }
// 
//         @Override
//         protected boolean canWriteUser(final User principal, final UUID userId) {
//             return userId.equals(principal.getId());
//         }
//     },
//     RO_ADMIN {
//         @Override
//         protected boolean canReadUser(final User principal, final UUID userId) {
//             return true;
//         }
// 
//         @Override
//         protected boolean canWriteUser(final User principal, final UUID userId) {
//             return userId.equals(principal.getId());
//         }
//     },
//     ADMIN {
//         @Override
//         protected boolean canReadUser(final User principal, final UUID userId) {
//             return true;
//         }
// 
//         @Override
//         protected boolean canWriteUser(final User principal, final UUID userId) {
//             return true;
//         }
//     };
// 
//     public String getName() {
//         return name();
//     }
// 
//     public boolean canRead(final Class<?> resourceClass, final User principal, final UUID resourceId) {
//         if (resourceClass == User.class) {
//             return canReadUser(principal, resourceId);
//         }
//         return false;
//     }
// 
//     protected abstract boolean canReadUser(User principal, UUID userId);
// 
//     public boolean canWrite(final Class<?> resourceClass, final User principal, final UUID resourceId) {
//         if (resourceClass == User.class) {
//             return canWriteUser(principal, resourceId);
//         } else if (resourceClass == Player.class) {
//             // TODO: Implement this
//             return false;
//         }
//         return false;
//     }
// 
//     protected abstract boolean canWriteUser(User principal, UUID userId);
// }


import com.google.common.collect.Sets;
import com.lewisd.authrite.acctests.model.User;
import com.lewisd.authrite.auth.Roles;
import io.github.unacceptable.alias.AliasStore;
import io.github.unacceptable.alias.EmailAddressGenerator;
import io.github.unacceptable.alias.PasswordGenerator;
import io.github.unacceptable.alias.UsernameGenerator;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
package com.lewisd.authrite.acctests.framework.context;



/**
 * Shared state for the current test run. DSL classes can use their test context to convert aliases (used in test cases)
 * into run-unique actual values, while reusing those values within a test run.
 *
 * @see Dsl
 */
//CHECKSTYLE.OFF: VisibilityModifier
public class TestContext {
    public static final String ADMIN_EMAIL = "admin@lewisd.com";
    public static final String ADMIN_DISPLAY_NAME = "Admin";
    public final AliasStore<String> displayNames = new AliasStore<>(new UsernameGenerator(20)::generate);
    public final AliasStore<String> emailAddresses = new AliasStore<>(EmailAddressGenerator::defaultGenerate);
    public final AliasStore<String> passwords = new AliasStore<>(PasswordGenerator::defaultGenerate);
    public final DateStore dates = new DateStore();

    private final Map<String, UUID> userIdsByEmail = new HashMap<>();
    private final Map<UUID, String> emailsByUserId = new HashMap<>();

    public TestContext() {
        emailAddresses.store(ADMIN_EMAIL, ADMIN_EMAIL);
        displayNames.store(ADMIN_DISPLAY_NAME, ADMIN_DISPLAY_NAME);
// Path: authrite-acctests/src/main/java/com/lewisd/authrite/acctests/model/User.java
// public class User {
// 
//     private UUID id;
//     private String email;
//     private String displayName;
//     private Set<Roles> roles;
//     private Date createdDate;
//     private Date modifiedDate;
//     private Date deletedDate;
//     private Date lastLoginDate;
//     private Date lastPasswordChangeDate;
//     private Date emailValidatedDate;
// 
//     public User() {
//         // for deserialization
//     }
// 
//     public User(final UUID id, final String email, final String displayName, final Set<Roles> roles) {
//         this.id = id;
//         this.email = email;
//         this.displayName = displayName;
//         this.roles = roles;
//     }
// 
//     public UUID getId() {
//         return id;
//     }
// 
//     public void setId(final UUID id) {
//         this.id = id;
//     }
// 
//     public String getEmail() {
//         return email;
//     }
// 
//     public void setEmail(final String email) {
//         this.email = email;
//     }
// 
//     public String getDisplayName() {
//         return displayName;
//     }
// 
//     public void setDisplayName(final String displayName) {
//         this.displayName = displayName;
//     }
// 
//     public Set<Roles> getRoles() {
//         return roles;
//     }
// 
//     public void setRoles(final Set<Roles> roles) {
//         this.roles = roles;
//     }
// 
//     public Date getCreatedDate() {
//         return createdDate;
//     }
// 
//     public void setCreatedDate(final Date createdDate) {
//         this.createdDate = createdDate;
//     }
// 
//     public Date getModifiedDate() {
//         return modifiedDate;
//     }
// 
//     public void setModifiedDate(final Date modifiedDate) {
//         this.modifiedDate = modifiedDate;
//     }
// 
//     public Date getDeletedDate() {
//         return deletedDate;
//     }
// 
//     public void setDeletedDate(final Date deletedDate) {
//         this.deletedDate = deletedDate;
//     }
// 
//     public Date getLastLoginDate() {
//         return lastLoginDate;
//     }
// 
//     public void setLastLoginDate(final Date lastLoginDate) {
//         this.lastLoginDate = lastLoginDate;
//     }
// 
//     public Date getLastPasswordChangeDate() {
//         return lastPasswordChangeDate;
//     }
// 
//     public void setLastPasswordChangeDate(final Date lastPasswordChangeDate) {
//         this.lastPasswordChangeDate = lastPasswordChangeDate;
//     }
// 
//     public Date getEmailValidatedDate() {
//         return emailValidatedDate;
//     }
// 
//     public void setEmailValidatedDate(final Date emailValidatedDate) {
//         this.emailValidatedDate = emailValidatedDate;
//     }
// }
// 
// Path: authrite-service/src/main/java/com/lewisd/authrite/auth/Roles.java
// public enum Roles {
//     PLAYER {
//         @Override
//         protected boolean canReadUser(final User principal, final UUID userId) {
//             return userId.equals(principal.getId());
//         }
// 
//         @Override
//         protected boolean canWriteUser(final User principal, final UUID userId) {
//             return userId.equals(principal.getId());
//         }
//     },
//     RO_ADMIN {
//         @Override
//         protected boolean canReadUser(final User principal, final UUID userId) {
//             return true;
//         }
// 
//         @Override
//         protected boolean canWriteUser(final User principal, final UUID userId) {
//             return userId.equals(principal.getId());
//         }
//     },
//     ADMIN {
//         @Override
//         protected boolean canReadUser(final User principal, final UUID userId) {
//             return true;
//         }
// 
//         @Override
//         protected boolean canWriteUser(final User principal, final UUID userId) {
//             return true;
//         }
//     };
// 
//     public String getName() {
//         return name();
//     }
// 
//     public boolean canRead(final Class<?> resourceClass, final User principal, final UUID resourceId) {
//         if (resourceClass == User.class) {
//             return canReadUser(principal, resourceId);
//         }
//         return false;
//     }
// 
//     protected abstract boolean canReadUser(User principal, UUID userId);
// 
//     public boolean canWrite(final Class<?> resourceClass, final User principal, final UUID resourceId) {
//         if (resourceClass == User.class) {
//             return canWriteUser(principal, resourceId);
//         } else if (resourceClass == Player.class) {
//             // TODO: Implement this
//             return false;
//         }
//         return false;
//     }
// 
//     protected abstract boolean canWriteUser(User principal, UUID userId);
// }


// Path: authrite-acctests/src/main/java/com/lewisd/authrite/acctests/framework/context/TestContext.java
import com.google.common.collect.Sets;
import com.lewisd.authrite.acctests.model.User;
import com.lewisd.authrite.auth.Roles;
import io.github.unacceptable.alias.AliasStore;
import io.github.unacceptable.alias.EmailAddressGenerator;
import io.github.unacceptable.alias.PasswordGenerator;
import io.github.unacceptable.alias.UsernameGenerator;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

package com.lewisd.authrite.acctests.framework.context;



/**
 * Shared state for the current test run. DSL classes can use their test context to convert aliases (used in test cases)
 * into run-unique actual values, while reusing those values within a test run.
 *
 * @see Dsl
 */
//CHECKSTYLE.OFF: VisibilityModifier
public class TestContext {
    public static final String ADMIN_EMAIL = "admin@lewisd.com";
    public static final String ADMIN_DISPLAY_NAME = "Admin";
    public final AliasStore<String> displayNames = new AliasStore<>(new UsernameGenerator(20)::generate);
    public final AliasStore<String> emailAddresses = new AliasStore<>(EmailAddressGenerator::defaultGenerate);
    public final AliasStore<String> passwords = new AliasStore<>(PasswordGenerator::defaultGenerate);
    public final DateStore dates = new DateStore();

    private final Map<String, UUID> userIdsByEmail = new HashMap<>();
    private final Map<UUID, String> emailsByUserId = new HashMap<>();

    public TestContext() {
        emailAddresses.store(ADMIN_EMAIL, ADMIN_EMAIL);
        displayNames.store(ADMIN_DISPLAY_NAME, ADMIN_DISPLAY_NAME);
        addUser(new User(UUID.fromString("46c668be-e2d2-4452-96a9-a8a0452ac922"),