protected void testRestorePageFromTrash(boolean hasExpandoValues) throws Exception {

    WikiPage page = WikiTestUtil.addPage(_group.getGroupId(), _node.getNodeId(), true);

    if (hasExpandoValues) {
      addExpandoValueToPage(page);
    }

    page =
        WikiPageLocalServiceUtil.movePageToTrash(
            TestPropsValues.getUserId(), _node.getNodeId(), page.getTitle());

    WikiPageLocalServiceUtil.restorePageFromTrash(TestPropsValues.getUserId(), page);

    WikiPage restoredPage = WikiPageLocalServiceUtil.getPage(page.getResourcePrimKey());

    Assert.assertNotNull(restoredPage);

    if (hasExpandoValues) {
      ExpandoBridge expandoBridge = page.getExpandoBridge();

      ExpandoBridge restoredExpandoBridge = restoredPage.getExpandoBridge();

      AssertUtils.assertEquals(
          restoredExpandoBridge.getAttributes(), expandoBridge.getAttributes());
    }
  }
  @Test
  public void testDeleteTrashedPageWithRestoredChildPage() throws Exception {
    WikiPage[] pages =
        WikiTestUtil.addTrashedPageWithChildPage(_group.getGroupId(), _node.getNodeId(), true);

    WikiPage parentPage = pages[0];
    WikiPage childPage = pages[1];

    WikiPageLocalServiceUtil.restorePageFromTrash(TestPropsValues.getUserId(), childPage);

    WikiPageLocalServiceUtil.deletePage(parentPage);

    try {
      WikiPageLocalServiceUtil.getPage(parentPage.getResourcePrimKey());

      Assert.fail();
    } catch (NoSuchPageResourceException nspre) {
      childPage = WikiPageLocalServiceUtil.getPage(childPage.getResourcePrimKey());

      Assert.assertNull(childPage.fetchParentPage());
      Assert.assertEquals(WorkflowConstants.STATUS_APPROVED, childPage.getStatus());
    }
  }