Search in sources :

Example 31 with Nodes

use of com.enonic.xp.node.Nodes in project xp by enonic.

the class ContentNodeTranslatorTest method testFromNodesNotResolvingChildren.

@Test
public void testFromNodesNotResolvingChildren() throws Exception {
    final Nodes nodes = createNodes();
    final Contents contents = this.contentNodeTranslator.fromNodes(nodes, false);
    assertEquals(3, contents.getSize());
    final Content content1 = contents.getContentById(ContentId.from(ID_1.toString()));
    final Content content3 = contents.getContentById(ContentId.from(ID_3.toString()));
    final Content content2 = contents.getContentById(ContentId.from(ID_2.toString()));
    assertFalse(content1.hasChildren());
    assertFalse(content2.hasChildren());
    assertFalse(content3.hasChildren());
}
Also used : Contents(com.enonic.xp.content.Contents) Content(com.enonic.xp.content.Content) Nodes(com.enonic.xp.node.Nodes) Test(org.junit.jupiter.api.Test)

Aggregations

Nodes (com.enonic.xp.node.Nodes)31 Node (com.enonic.xp.node.Node)14 FindNodesByParentResult (com.enonic.xp.node.FindNodesByParentResult)9 FindNodesByQueryResult (com.enonic.xp.node.FindNodesByQueryResult)9 Test (org.junit.jupiter.api.Test)8 NodeQuery (com.enonic.xp.node.NodeQuery)5 Contents (com.enonic.xp.content.Contents)4 NodeIds (com.enonic.xp.node.NodeIds)3 NodeNotFoundException (com.enonic.xp.node.NodeNotFoundException)3 CompareExpr (com.enonic.xp.query.expr.CompareExpr)3 QueryExpr (com.enonic.xp.query.expr.QueryExpr)3 Branch (com.enonic.xp.branch.Branch)2 Content (com.enonic.xp.content.Content)2 FindNodesByParentParams (com.enonic.xp.node.FindNodesByParentParams)2 NodePaths (com.enonic.xp.node.NodePaths)2 Principals (com.enonic.xp.security.Principals)2 AccessControlList (com.enonic.xp.security.acl.AccessControlList)2 Application (com.enonic.xp.app.Application)1 ApplicationKey (com.enonic.xp.app.ApplicationKey)1 BlobKey (com.enonic.xp.blob.BlobKey)1