-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JC-2409 Error 500 when saving PM with invalid "To" field
- Fixed hibernate lazy initialization exception by moving userService.getCurrentUser() to service layer.
- Loading branch information
1 parent
cdf589c
commit 47d72d0
Showing
7 changed files
with
27 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -181,12 +181,13 @@ public void testGetDraftsForCurrentUser() { | |
} | ||
|
||
@Test | ||
public void testSaveDraft() throws NotFoundException { | ||
public void testSaveDraft() { | ||
JCUser recipient = new JCUser("name", "[email protected]", "pwd"); | ||
|
||
when(securityService.<User>createAclBuilder()).thenReturn(aclBuilder); | ||
when(userService.getCurrentUser()).thenReturn(JC_USER); | ||
|
||
pmService.saveDraft(PM_ID, recipient, "title", "body", JC_USER); | ||
pmService.saveDraft(PM_ID, recipient, "title", "body"); | ||
|
||
verify(pmDao).saveOrUpdate(any(PrivateMessage.class)); | ||
verify(aclBuilder).grant(GeneralPermission.WRITE); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters