Search in sources :

Example 1 with NodeVersionIds

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

the class DumpServiceImplTest method version_ids_should_stay_the_same_if_no_changes.

@Test
public void version_ids_should_stay_the_same_if_no_changes() throws Exception {
    final Node node = createNode(NodePath.ROOT, "myNode");
    RenameNodeCommand.create().searchService(this.searchService).storageService(this.storageService).indexServiceInternal(this.indexServiceInternal).params(RenameNodeParams.create().nodeId(node.id()).nodeName(NodeName.from("renamed")).build()).build().execute();
    this.nodeService.push(NodeIds.from(node.id()), WS_OTHER);
    updateNode(node);
    refresh();
    final NodeVersionQueryResult versionsBeforeLoad = this.nodeService.findVersions(GetNodeVersionsParams.create().nodeId(node.id()).build());
    NodeHelper.runAsAdmin(() -> dumpDeleteAndLoad(true));
    refresh();
    final NodeVersionQueryResult versionsAfterLoad = this.nodeService.findVersions(GetNodeVersionsParams.create().nodeId(node.id()).build());
    final NodeVersionIds versionIdsBeforeLoad = versionsBeforeLoad.getNodeVersionsMetadata().getAllVersionIds();
    final NodeVersionIds versionIdsAfterLoad = versionsAfterLoad.getNodeVersionsMetadata().getAllVersionIds();
    assertEquals(versionIdsBeforeLoad, versionIdsAfterLoad);
}
Also used : Node(com.enonic.xp.node.Node) NodeVersionQueryResult(com.enonic.xp.node.NodeVersionQueryResult) NodeVersionIds(com.enonic.xp.node.NodeVersionIds) Test(org.junit.jupiter.api.Test) AbstractNodeTest(com.enonic.xp.repo.impl.node.AbstractNodeTest)

Aggregations

Node (com.enonic.xp.node.Node)1 NodeVersionIds (com.enonic.xp.node.NodeVersionIds)1 NodeVersionQueryResult (com.enonic.xp.node.NodeVersionQueryResult)1 AbstractNodeTest (com.enonic.xp.repo.impl.node.AbstractNodeTest)1 Test (org.junit.jupiter.api.Test)1