Skip to content

Commit

Permalink
feat: Fix Test API usage - MEED-7545 - Meeds-io/MIPs#151 (#1139)
Browse files Browse the repository at this point in the history
  • Loading branch information
boubaker authored and exo-swf committed Oct 7, 2024
1 parent 0621136 commit c59c673
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@
import org.exoplatform.wiki.service.WikiPageParams;
import org.exoplatform.wiki.utils.NoteConstants;

import static org.exoplatform.social.core.jpa.test.AbstractCoreTest.persist;

/**
* Created by The eXo Platform SAS Author : eXoPlatform [email protected]
* 9/8/15
Expand Down Expand Up @@ -1161,7 +1159,7 @@ public void testDeleteOrphanDraftPagesByParentPage() throws Exception {
draft = draftPageDAO.create(draft);
assertNotNull(draft);
storage.deleteOrphanDraftPagesByParentPage(Long.parseLong(wiki.getWikiHome().getId()));
persist();
restartTransaction();
assertNull(draftPageDAO.find(draft.getId()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
import org.exoplatform.wiki.jpa.entity.PageEntity;
import org.exoplatform.wiki.jpa.entity.WikiEntity;

import static org.exoplatform.social.core.jpa.test.AbstractCoreTest.persist;

/**
* Created by The eXo Platform SAS Author : eXoPlatform [email protected] Jun
* 26, 2015
Expand Down Expand Up @@ -348,7 +346,7 @@ public void testFindLatestDraftPageByTargetPage() throws InterruptedException {
dp1.setCreatedDate(new Date());
dp1.setUpdatedDate(new Date());
draftPageDAO.create(dp1);
persist();
restartTransaction();

// Added to fix random fail when draft pages
// are added at the same time
Expand All @@ -361,7 +359,7 @@ public void testFindLatestDraftPageByTargetPage() throws InterruptedException {
dp2.setCreatedDate(new Date());
dp2.setUpdatedDate(new Date());
draftPageDAO.create(dp2);
persist();
restartTransaction();

// When
DraftPageEntity latestDraft = draftPageDAO.findLatestDraftPageByTargetPage(page.getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
package org.exoplatform.wiki.service;


import static org.exoplatform.social.core.jpa.test.AbstractCoreTest.persist;
import static org.junit.Assert.assertThrows;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.mock;
Expand Down Expand Up @@ -720,7 +719,7 @@ public void testRemoveOrphanDraftPagesByParentPage() throws Exception {
draft = noteService.createDraftForNewPage(draft, new Date().getTime(), 1L);
assertNotNull(draft);
noteService.removeOrphanDraftPagesByParentPage(Long.parseLong(homePage.getId()));
persist();
restartTransaction();
assertNull(noteService.getDraftNoteById(draft.getId(), "root"));
}

Expand Down

0 comments on commit c59c673

Please sign in to comment.