@Test
public void getLastPostsForSectionShouldReturnListOfTheLatestPosts() {
final int count = 42;
JCUser user = new JCUser(USER_NAME, EMAIL, USER_PASSWORD);
Section section = new Section(SECTION_NAME);
Branch branch1 = new Branch("my branch", "1");
branch1.setId(42);
Branch branch2 = new Branch("my branch2", "2");
branch2.setId(43);
section.addOrUpdateBranch(branch1);
section.addOrUpdateBranch(branch2);
when(userService.getCurrentUser()).thenReturn(user);
List<Long> branchIds = Arrays.asList(branch1.getId());
when(sectionDao.getAvailableBranchIds(user, section.getBranches())).thenReturn(branchIds);
List<Post> posts = new ArrayList<>();
posts.add(new Post(user, "post1"));
posts.add(new Post(user, "post2"));