verify(userDataCache, never()).decrementNewMessageCountFor(USERNAME);
}
@Test
public void testGetPrivateMessageUserToNotCurrentUser() throws NotFoundException {
PrivateMessage message = new PrivateMessage(user, user, "title", "body");
JCUser currentUser = new JCUser(USERNAME, "email", "password");
when(pmDao.get(PM_ID)).thenReturn(message);
when(pmDao.isExist(PM_ID)).thenReturn(true);
when(userService.getCurrentUser()).thenReturn(currentUser);
PrivateMessage resultMessage = pmService.get(PM_ID);
assertEquals(resultMessage.isRead(), false,
"The message isn't addressed to the current user, so message shouldn't be marked as read.");
verify(pmDao, never()).saveOrUpdate(resultMessage);
verify(userDataCache, never()).decrementNewMessageCountFor(USERNAME);
}