use of com.enonic.xp.node.RenameNodeParams in project xp by enonic.
the class MoveNodeHandlerTest method mockGetNode.
private void mockGetNode() {
Mockito.when(this.nodeService.getById(NodeId.from("nodeId"))).thenReturn(createNode());
Mockito.when(this.nodeService.getByPath(NodePath.create("/my-name").build())).thenReturn(createNode());
Mockito.when(this.nodeService.rename(Mockito.any())).thenAnswer(invocation -> {
final RenameNodeParams renameNodeParams = (RenameNodeParams) invocation.getArguments()[0];
name = renameNodeParams.getNewNodeName().toString();
return createNode();
});
Mockito.when(this.nodeService.move(Mockito.any(NodeId.class), Mockito.any(), Mockito.any())).thenAnswer(invocation -> {
parentPath = ((NodePath) invocation.getArguments()[1]).trimTrailingDivider();
return createNode();
});
}
Aggregations