diff --git a/src/main/java/com/swisscom/aem/tools/impl/hops/MoveNode.java b/src/main/java/com/swisscom/aem/tools/impl/hops/MoveNode.java index 1755bc7..6aeb7a0 100644 --- a/src/main/java/com/swisscom/aem/tools/impl/hops/MoveNode.java +++ b/src/main/java/com/swisscom/aem/tools/impl/hops/MoveNode.java @@ -126,7 +126,8 @@ public void run(Config config, Node node, HopContext context) throws RepositoryE return; } - final String absolutePath = descriptor.getParent().getPath() + '/' + descriptor.getNewChildName(); + final Node effectiveParent = descriptor.getParent(); + final String absolutePath = StringUtils.stripEnd(effectiveParent.getPath(), "/") + '/' + descriptor.getNewChildName(); context.info("Moving node from {} to {}", node.getPath(), absolutePath); node.getSession().move(node.getPath(), absolutePath); diff --git a/src/test/java/com/swisscom/aem/tools/impl/hops/CreateChildNodeTest.java b/src/test/java/com/swisscom/aem/tools/impl/hops/CreateChildNodeTest.java index 4a9f60b..3ea001b 100644 --- a/src/test/java/com/swisscom/aem/tools/impl/hops/CreateChildNodeTest.java +++ b/src/test/java/com/swisscom/aem/tools/impl/hops/CreateChildNodeTest.java @@ -24,7 +24,6 @@ class CreateChildNodeTest { public final AemContext context = new JcrOakAemContext(); - private RunnerBuilder builder; private Session session;