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);
}
Aggregations