Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#12048] Migrate UpdateStudentAction #12727

Merged
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
eaf3399
Modify student entity
domoberzin Jan 29, 2024
8672116
Add update comment logic
domoberzin Jan 29, 2024
e43cadf
Modify logic files for cascading update and creation for student
domoberzin Jan 29, 2024
565e7bf
Add database queries for updating student
domoberzin Jan 29, 2024
6c2dccf
Update EnrollStudentsAction
domoberzin Jan 29, 2024
b907544
Fix checkstyle
domoberzin Jan 29, 2024
9a3f142
Remove extra query for editor update
domoberzin Jan 29, 2024
b9c08ed
Remove email update logic
domoberzin Jan 30, 2024
8708e92
Update javadocs
domoberzin Jan 30, 2024
389ecb9
Copy over logic for Team and Section validation
domoberzin Feb 1, 2024
059a5fa
Edit javadocs
domoberzin Feb 1, 2024
21f6aea
Change StudentAttributes to Student instead
domoberzin Feb 1, 2024
7634971
Fix lint issues
domoberzin Feb 1, 2024
0ea2b58
Fix lint issues
domoberzin Feb 1, 2024
fad80d0
Fix component tests and lint
domoberzin Feb 1, 2024
6ea397e
Merge branch 'v9-migration' into migrate-enroll-students-action
domoberzin Feb 1, 2024
b02ef4d
Remove ununsed method
domoberzin Feb 2, 2024
30d3c2a
Fix lint
domoberzin Feb 2, 2024
2b53dcb
Update validation logic to use Student
domoberzin Feb 2, 2024
dbf4a2d
Update test case
domoberzin Feb 2, 2024
ca26582
Add tests for duplicate team across sections
domoberzin Feb 2, 2024
029fc01
Migrate UpdateStudentAction and add tests
marquestye Feb 5, 2024
ded4b35
Fix merge conflicts
marquestye Feb 5, 2024
ac29c3f
Remove resetStudentGoogleId
marquestye Feb 5, 2024
c5fb48d
Refactor updateStudentCascade
marquestye Feb 7, 2024
70b8e61
Fix integration tests
marquestye Feb 7, 2024
77b37a7
Merge branch v9-migration into 12048-migrate-update-student-action
marquestye Feb 7, 2024
c6092c0
Fix checkstyle
marquestye Feb 9, 2024
52bafc2
Fix integration tests
marquestye Feb 9, 2024
172ede7
Fix lint
marquestye Feb 9, 2024
4af4a8e
Add persist verification in test
marquestye Feb 18, 2024
a5e0513
Merge branch v9-migration into 12048-migrate-update-student-action
marquestye Feb 18, 2024
ddac6f4
Fix test
marquestye Feb 19, 2024
1d83eb9
Fix tests
marquestye Feb 19, 2024
9c3c3d1
Remove unused method
marquestye Feb 19, 2024
7cb022b
Merge branch 'v9-migration' of https://github.com/TEAMMATES/teammates…
marquestye Feb 19, 2024
b29e6a3
Merge branch 'v9-migration' of https://github.com/TEAMMATES/teammates…
marquestye Feb 19, 2024
2f1f635
Merge branch 'v9-migration' of https://github.com/TEAMMATES/teammates…
marquestye Feb 20, 2024
8036a17
Merge branch 'v9-migration' of https://github.com/TEAMMATES/teammates…
marquestye Feb 20, 2024
d69f3c2
Fix test
marquestye Feb 20, 2024
4f9926e
Fix test
marquestye Feb 20, 2024
2043011
Fix test
marquestye Feb 20, 2024
6abdb7f
Split UpdateStudentActionIT into multiple testcases
marquestye Feb 23, 2024
aa5df74
Merge branch 'v9-migration' of https://github.com/TEAMMATES/teammates…
marquestye Feb 23, 2024
313a305
Add test separators
marquestye Feb 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public void allTests() throws Exception {
Student stu1InCourse1 = typicalBundle.students.get("student1InCourse1");
Student stu2InCourse1 = typicalBundle.students.get("student2InCourse1");
Student stu3InCourse1 = typicalBundle.students.get("student3InCourse1");
Student stu4InCourse1 = typicalBundle.students.get("student4InCourse1");
Student stu1InCourse2 = typicalBundle.students.get("student1InCourse2");
Student unregisteredStuInCourse1 = typicalBundle.students.get("unregisteredStudentInCourse1");
Student stu1InCourse3 = typicalBundle.students.get("student1InCourse3");
Expand Down Expand Up @@ -80,12 +81,12 @@ public void allTests() throws Exception {
______TS("success: search for students in whole system; students should be searchable by course id");

results = usersDb.searchStudentsInWholeSystem("\"course-1\"");
verifySearchResults(results, stu1InCourse1, stu2InCourse1, stu3InCourse1, unregisteredStuInCourse1);
verifySearchResults(results, stu1InCourse1, stu2InCourse1, stu3InCourse1, stu4InCourse1, unregisteredStuInCourse1);

______TS("success: search for students in whole system; students should be searchable by course name");

results = usersDb.searchStudentsInWholeSystem("\"Typical Course 1\"");
verifySearchResults(results, stu1InCourse1, stu2InCourse1, stu3InCourse1, unregisteredStuInCourse1);
verifySearchResults(results, stu1InCourse1, stu2InCourse1, stu3InCourse1, stu4InCourse1, unregisteredStuInCourse1);

______TS("success: search for students in whole system; students should be searchable by their name");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected void testExecute() throws Exception {

List<Student> studentsToDelete = logic.getStudentsForCourse(courseId);

assertEquals(4, studentsToDelete.size());
assertEquals(5, studentsToDelete.size());

String[] params = new String[] {
Const.ParamsNames.COURSE_ID, courseId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void testExecute() throws Exception {
};

List<Student> students = new ArrayList<>(logic.getStudentsForCourse(courseId));
assertEquals(4, students.size());
assertEquals(5, students.size());

______TS("Typical Success Case For Enrolling a Student");

Expand All @@ -83,7 +83,7 @@ public void testExecute() throws Exception {
EnrollStudentsData data = (EnrollStudentsData) res.getOutput();
assertEquals(1, data.getStudentsData().getStudents().size());
List<Student> studentsInCourse = logic.getStudentsForCourse(courseId);
assertEquals(5, studentsInCourse.size());
assertEquals(6, studentsInCourse.size());

______TS("Fail to enroll due to duplicate team name across sections");

Expand Down Expand Up @@ -111,7 +111,7 @@ public void testExecute() throws Exception {
data = (EnrollStudentsData) res.getOutput();
assertEquals(1, data.getStudentsData().getStudents().size());
studentsInCourse = logic.getStudentsForCourse(courseId);
assertEquals(5, studentsInCourse.size());
assertEquals(6, studentsInCourse.size());

// Verify that changes have cascaded to feedback responses
String giverEmail = "[email protected]";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ private void textExecute_typicalSuccess1() {
assertTrue(session.isClosingSoonEmailSent());
assertTrue(session.getDeadlineExtensions().stream().allMatch(de -> !de.isClosingSoonEmailSent()));

// 6 email tasks queued:
// 1 co-owner, 4 students and 3 instructors,
// 7 email tasks queued:
// 1 co-owner, 5 students and 3 instructors,
// but 1 student and 1 instructor have deadline extensions (should not receive email)
verifySpecifiedTasksAdded(Const.TaskQueue.SEND_EMAIL_QUEUE_NAME, 6);
verifySpecifiedTasksAdded(Const.TaskQueue.SEND_EMAIL_QUEUE_NAME, 7);
}

private void textExecute_typicalSuccess2() {
Expand All @@ -149,11 +149,11 @@ private void textExecute_typicalSuccess2() {
assertTrue(session.isClosingSoonEmailSent());
assertTrue(de.isClosingSoonEmailSent());

// 7 email tasks queued:
// - 6 emails: 1 co-owner, 4 students and 3 instructors,
// 8 email tasks queued:
// - 7 emails: 1 co-owner, 5 students and 3 instructors,
// but 1 student and 1 instructor have deadline extensions (should not receive email)
// - 1 email: 1 student deadline extension
verifySpecifiedTasksAdded(Const.TaskQueue.SEND_EMAIL_QUEUE_NAME, 7);
verifySpecifiedTasksAdded(Const.TaskQueue.SEND_EMAIL_QUEUE_NAME, 8);
}

private void textExecute_typicalSuccess3() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected void testExecute() throws Exception {
StudentsData response = (StudentsData) jsonResult.getOutput();
List<StudentData> students = response.getStudents();

assertEquals(4, students.size());
assertEquals(5, students.size());

StudentData firstStudentInStudents = students.get(0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void execute_adminSearchName_success() {
JsonResult result = getJsonResult(a);
StudentsData response = (StudentsData) result.getOutput();

assertEquals(10, response.getStudents().size());
assertEquals(11, response.getStudents().size());
}

@Test
Expand All @@ -114,7 +114,7 @@ public void execute_adminSearchCourseId_success() {
JsonResult result = getJsonResult(a);
StudentsData response = (StudentsData) result.getOutput();

assertEquals(10, response.getStudents().size());
assertEquals(11, response.getStudents().size());
}

@Test
Expand Down
Loading
Loading