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);
JsonResponse jsonResponse = administrationController.getGroupsForBranchPermission(dto);
assertEquals(jsonResponse.getStatus(), JsonResponseStatus.SUCCESS);
assertTrue(jsonResponse.getResult() instanceof PermissionGroupsDto);
PermissionGroupsDto result = (PermissionGroupsDto)jsonResponse.getResult();
assertEquals(result.getAvailableGroups().size(), 3);
assertEquals(result.getSelectedGroups().size(), 3);
}