use of teammates.common.datatransfer.attributes.AccountAttributes in project teammates by TEAMMATES.
the class ProfilesDbTest method testUpdateStudentProfile.
@Test
public void testUpdateStudentProfile() throws Exception {
AccountAttributes a = createNewAccount();
// failure cases
testUpdateProfileWithNullParameter();
testUpdateProfileWithInvalidParameters();
testUpdatingNonExistentProfile(a);
// success cases
testUpdateProfileSuccessWithNoPictureKey(a);
testUpdateProfileSuccessInitiallyEmptyPictureKey(a);
testUpdateProfileSuccessNoChangesToProfile(a);
testUpdateProfileSuccessWithSamePictureKey(a);
}
use of teammates.common.datatransfer.attributes.AccountAttributes in project teammates by TEAMMATES.
the class ProfilesDbTest method testUpdateStudentProfilePicture.
@Test
public void testUpdateStudentProfilePicture() throws Exception {
AccountAttributes a = createNewAccount();
// failure test cases
testUpdateProfilePictureWithNullParameters();
testUpdateProfilePictureWithEmptyParameters(a);
testUpdateProfilePictureOnNonExistentProfile();
// success test cases
testUpdateProfilePictureSuccessInitiallyEmpty(a);
testUpdateProfilePictureSuccessSamePictureKey(a);
}
use of teammates.common.datatransfer.attributes.AccountAttributes in project teammates by TEAMMATES.
the class BackDoorTest method testCreateAccount.
@Test
public void testCreateAccount() {
AccountAttributes newAccount = dataBundle.accounts.get("instructor1OfCourse1");
// Make sure not already inside
BackDoor.deleteAccount(newAccount.googleId);
verifyAbsentInDatastore(newAccount);
// Perform creation
BackDoor.createAccount(newAccount);
verifyPresentInDatastore(newAccount);
// Clean up
BackDoor.deleteAccount(newAccount.googleId);
verifyAbsentInDatastore(newAccount);
}
use of teammates.common.datatransfer.attributes.AccountAttributes in project teammates by TEAMMATES.
the class AdminAccountManagementPageData method createAccountTable.
private List<AdminAccountManagementAccountTableRow> createAccountTable(Map<String, AccountAttributes> instructorAccountsTable, Map<String, ArrayList<InstructorAttributes>> instructorCoursesTable) {
List<AdminAccountManagementAccountTableRow> table = new ArrayList<>();
for (Map.Entry<String, AccountAttributes> entry : instructorAccountsTable.entrySet()) {
String key = entry.getKey();
AccountAttributes acc = entry.getValue();
if (isTestingAccount(acc) && !isToShowAll) {
continue;
}
ArrayList<InstructorAttributes> coursesList = instructorCoursesTable.get(key);
AdminAccountManagementAccountTableRow row = new AdminAccountManagementAccountTableRow(acc, coursesList, getSessionToken());
table.add(row);
}
return table;
}
use of teammates.common.datatransfer.attributes.AccountAttributes in project teammates by TEAMMATES.
the class Action method authenticateAndGetActualUser.
protected AccountAttributes authenticateAndGetActualUser(UserType currentUser) {
if (doesUserNeedToLogin(currentUser)) {
return null;
}
AccountAttributes loggedInUser = null;
String email = getRequestParamValue(Const.ParamsNames.STUDENT_EMAIL);
String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID);
if (currentUser == null) {
Assumption.assertPostParamNotNull(Const.ParamsNames.REGKEY, regkey);
loggedInUser = authenticateNotLoggedInUser(email, courseId);
} else {
loggedInUser = logic.getAccount(currentUser.id);
if (doesRegkeyMatchLoggedInUserGoogleId(currentUser.id)) {
loggedInUser = createDummyAccountIfUserIsUnregistered(currentUser, loggedInUser);
}
}
return loggedInUser;
}
Aggregations