Search in sources :

Example 21 with PublishContentResult

use of com.enonic.xp.content.PublishContentResult in project xp by enonic.

the class ContentServiceImplTest_publish method push_deleted.

@Test
public void push_deleted() throws Exception {
    final Content content = this.contentService.create(CreateContentParams.create().contentData(new PropertyTree()).displayName("This is my content").parent(ContentPath.ROOT).type(ContentTypeName.folder()).build());
    final PushContentParams pushParams = PushContentParams.create().contentIds(ContentIds.from(content.getId())).target(WS_OTHER).build();
    final PublishContentResult push = this.contentService.publish(pushParams);
    assertEquals(1, push.getPushedContents().getSize());
    contentService.deleteWithoutFetch(DeleteContentParams.create().contentPath(content.getPath()).build());
    final PublishContentResult pushWithDeleted = this.contentService.publish(pushParams);
    assertEquals(1, pushWithDeleted.getDeletedContents().getSize());
}
Also used : PublishContentResult(com.enonic.xp.content.PublishContentResult) Content(com.enonic.xp.content.Content) PropertyTree(com.enonic.xp.data.PropertyTree) PushContentParams(com.enonic.xp.content.PushContentParams) Test(org.junit.jupiter.api.Test)

Aggregations

PublishContentResult (com.enonic.xp.content.PublishContentResult)21 Test (org.junit.jupiter.api.Test)19 Content (com.enonic.xp.content.Content)12 PropertyTree (com.enonic.xp.data.PropertyTree)11 PushContentParams (com.enonic.xp.content.PushContentParams)10 CreateContentParams (com.enonic.xp.content.CreateContentParams)7 DeleteContentsResult (com.enonic.xp.content.DeleteContentsResult)5 Disabled (org.junit.jupiter.api.Disabled)3 ContentId (com.enonic.xp.content.ContentId)2 ContentIds (com.enonic.xp.content.ContentIds)2 Contents (com.enonic.xp.content.Contents)2 LogAuditLogParams (com.enonic.xp.audit.LogAuditLogParams)1 ContentPath (com.enonic.xp.content.ContentPath)1 ContentPublishInfo (com.enonic.xp.content.ContentPublishInfo)1 DeleteContentParams (com.enonic.xp.content.DeleteContentParams)1 GetContentByIdsParams (com.enonic.xp.content.GetContentByIdsParams)1 PropertySet (com.enonic.xp.data.PropertySet)1 PublishContentResultMapper (com.enonic.xp.lib.content.mapper.PublishContentResultMapper)1 ContentType (com.enonic.xp.schema.content.ContentType)1 ArrayList (java.util.ArrayList)1