use of com.enonic.xp.content.MoveContentsResult in project xp by enonic.
the class ContentServiceImplTest_move method move_to_folder_starting_with_same_name.
@Test
public void move_to_folder_starting_with_same_name() throws Exception {
final Content site = createContent(ContentPath.ROOT, "site");
final Content child1 = createContent(site.getPath(), "child1");
createContent(child1.getPath(), "child1_1");
createContent(child1.getPath(), "child2_1");
final Content site2 = createContent(ContentPath.ROOT, "site2");
refresh();
final MoveContentParams params = MoveContentParams.create().contentId(child1.getId()).parentContentPath(site2.getPath()).build();
final MoveContentsResult result = this.contentService.move(params);
final Content movedContent = contentService.getById(result.getMovedContents().first());
assertEquals(1, result.getMovedContents().getSize());
assertEquals(movedContent.getParentPath(), site2.getPath());
}
use of com.enonic.xp.content.MoveContentsResult in project xp by enonic.
the class MoveContentHandlerTest method mockMove.
private void mockMove(final ContentId contentId, final String parentPath, final Content contentResult) {
final MoveContentParams moveParams = MoveContentParams.create().contentId(contentId).parentContentPath(ContentPath.from(parentPath)).build();
final MoveContentsResult result = MoveContentsResult.create().addMoved(contentResult.getId()).build();
when(this.contentService.move(Mockito.eq(moveParams))).thenReturn(result);
}
Aggregations