Skip to content

Commit

Permalink
Update usage of refactored attributes from FeedbackResponse entity
Browse files Browse the repository at this point in the history
  • Loading branch information
domlimm committed Apr 15, 2024
1 parent bc5c4f7 commit 3c27af8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ private boolean isResponseVisibleForUser(
|| relatedQuestion.getRecipientType() == FeedbackParticipantType.TEAMS_IN_SAME_SECTION
|| relatedQuestion.getRecipientType() == FeedbackParticipantType.TEAMS_EXCLUDING_SELF)
&& relatedQuestion.isResponseVisibleTo(FeedbackParticipantType.RECEIVER)
&& response.getRecipient().getEmail().equals(student.getTeamName())) {
&& response.getRecipient().getTeam().getName().equals(student.getTeamName())) {
isVisibleResponse = true;
} else if (relatedQuestion.getGiverType() == FeedbackParticipantType.TEAMS
&& response.getGiver().getEmail().equals(student.getTeamName())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void verifyResponseOwnerShipForInstructor(InstructorAttributes instructor,
*/
void verifyResponseOwnerShipForInstructor(Instructor instructor, FeedbackResponse response)
throws UnauthorizedAccessException {
if (!response.getGiver().equals(instructor.getEmail())) {
if (!response.getGiver().getEmail().equals(instructor.getEmail())) {
throw new UnauthorizedAccessException("Response [" + response.getId() + "] is not accessible to "
+ instructor.getName());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ protected void verifyEquals(BaseEntity expected, ApiOutput actual) {
expectedFeedbackResponse.getFeedbackResponseDetailsCopy();
FeedbackResponseData actualResponse = (FeedbackResponseData) actual;
FeedbackResponseDetails actualResponseDetails = actualResponse.getResponseDetails();
assertEquals(expectedFeedbackResponse.getGiver(), actualResponse.getGiverIdentifier());
assertEquals(expectedFeedbackResponse.getRecipient(), actualResponse.getRecipientIdentifier());
assertEquals(expectedFeedbackResponse.getGiver().getEmail(), actualResponse.getGiverIdentifier());
assertEquals(expectedFeedbackResponse.getRecipient().getEmail(), actualResponse.getRecipientIdentifier());
assertEquals(expectedResponseDetails.getAnswerString(),
actualResponse.getResponseDetails().getAnswerString());
assertEquals(expectedResponseDetails.getQuestionType(),
Expand All @@ -116,11 +116,11 @@ protected void verifyEquals(BaseEntity expected, ApiOutput actual) {
} else if (expected instanceof FeedbackResponseComment) {
FeedbackResponseComment expectedFeedbackResponseComment = (FeedbackResponseComment) expected;
FeedbackResponseCommentData actualComment = (FeedbackResponseCommentData) actual;
assertEquals(expectedFeedbackResponseComment.getGiver(), actualComment.getCommentGiver());
assertEquals(expectedFeedbackResponseComment.getGiver().getEmail(), actualComment.getCommentGiver());
assertEquals(expectedFeedbackResponseComment.getCommentText(), actualComment.getCommentText());
assertEquals(expectedFeedbackResponseComment.getIsVisibilityFollowingFeedbackQuestion(),
actualComment.isVisibilityFollowingFeedbackQuestion());
assertEquals(expectedFeedbackResponseComment.getLastEditorEmail(), actualComment.getLastEditorEmail());
assertEquals(expectedFeedbackResponseComment.getLastEditor().getEmail(), actualComment.getLastEditorEmail());
} else if (expected instanceof FeedbackSession) {
FeedbackSession expectedFeedbackSession = (FeedbackSession) expected;
FeedbackSessionData actualFeedbackSession = (FeedbackSessionData) actual;
Expand Down

0 comments on commit 3c27af8

Please sign in to comment.