when(securityService.<User>createAclBuilder()).thenReturn(aclBuilder);
when(propertyDao.getByName(PROPERTY_NAME)).
thenReturn(new Property(PROPERTY_NAME, String.valueOf(SENDING_NOTIFICATIONS_ENABLED)));
JC_USER.setSendPmNotification(SENDING_NOTIFICATIONS_ENABLED);
PrivateMessage pm = pmService.sendMessage("body", "title", JC_USER, user);
assertFalse(pm.isRead());
assertEquals(pm.getStatus(), PrivateMessageStatus.SENT);
verify(userDataCache).incrementNewMessageCountFor(USERNAME);
verify(pmDao).saveOrUpdate(pm);
verify(aclBuilder, times(2)).grant(GeneralPermission.READ);
verify(propertyDao).getByName(PROPERTY_NAME);
verify(mailService, times(1)).sendReceivedPrivateMessageNotification(JC_USER, pm);