public void testGetAllFromUserOneMessageCaseMessageCountOnOnePageIsCorrect() {
int pageSize = 25;
JCUser userTo = PersistedObjectsFactory.getUser("UserTo", "mail2@mail.com");
JCUser userFrom = PersistedObjectsFactory.getUser("UserFrom", "mail1" +
"@mail.com");
PageRequest pageRequest = new PageRequest("1", pageSize);
PersistedObjectsFactory.createAndSaveMessage(PrivateMessageStatus.SENT, userTo, userFrom);
Page<PrivateMessage> messagePage = dao.getAllFromUser(userFrom, pageRequest);
assertEquals(messagePage.getContent().size(), 1, "Incorrect count of message in one page.");