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 tests for GetReadNotificationsActionTest #13220

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

InfinityTwo
Copy link

Part of #12048

Outline of Solution
Added the unit tests for GetReadNotificationsActionTest for PostgreSQL.

Copy link
Contributor

@mingyang143 mingyang143 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but do consider the changes!


@Test
protected void testExecute_getReadNotificationsAsInstructor_shouldSucceed() {
InstructorAttributes instructor = typicalBundle.instructors.get("instructor1OfCourse1");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like typicalBundle.instructors.get("instructor1OfCourse1") is related to the Google Datastore pre-migration. Would it be better to create the InstructorStub manually instead?

loginAsInstructor(instructor.getGoogleId());

List<NotificationAttributes> notificationAttributesList = List.of(
typicalBundle.notifications.get("notification1"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should typicalBundle be used here as well? This seems related to the previous comment.


readNotificationsData.forEach(notificationId ->
assertTrue(testNotificationIds.contains(UUID.fromString(notificationId))));
assertEquals(2, readNotificationsData.size());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from a few minor nits mentioned, the code is well-structured and effectively accomplishes its purpose!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants