use of com.enonic.xp.content.Contents in project xp by enonic.
the class ContentServiceImplTest_getByPaths method test_publish_expired_draft.
@Test
public void test_publish_expired_draft() throws Exception {
final Content content1 = createContent(ContentPath.ROOT);
final Content content2 = createContent(ContentPath.ROOT, ContentPublishInfo.create().from(Instant.now().minus(Duration.ofDays(1))).to(Instant.now().minus(Duration.ofDays(1))).build());
final ContentPaths paths = ContentPaths.from(content1.getPath(), content2.getPath());
final Contents contents = this.contentService.getByPaths(paths);
assertEquals(contents.getSize(), 2);
assertTrue(contents.contains(content1));
assertTrue(contents.contains(content2));
}
Aggregations