assertEquals(jsonResponse.getStatus(), JsonResponseStatus.SUCCESS);
}
@Test
public void getGroupsForBranchPermissionShouldReturnSuccessIfBranchExists() throws Exception {
Component component = setupComponentMock();
BranchPermission targetPermission = BranchPermission.CREATE_POSTS;
BranchPermissionDto dto = createBranchPermissionDto(targetPermission);
List<Group> selectedGroupList = Arrays.asList(new Group("1"), new Group("2"), new Group("3"));
when(branchService.getPermissionGroupsFor(component.getId(), dto.getBranchId(), dto.isAllowed(), targetPermission))
.thenReturn(selectedGroupList);
List<Group> allGroupList = Arrays.asList(new Group("4"), new Group("5"), new Group("6"));
when(permissionManager.getAllGroupsWithoutExcluded(selectedGroupList, targetPermission)).thenReturn(allGroupList);
when(permissionManager.findBranchPermissionByMask(targetPermission.getMask())).thenReturn(targetPermission);