### Question:
OnDeployScriptBase implements OnDeployScript { protected final void renameProperty(Node node, String oldPropertyName, String newPropertyName) throws RepositoryException { Resource resource = resourceResolver.getResource(node.getPath()); renameProperty(resource, oldPropertyName, newPropertyName); }  final void execute(ResourceResolver resourceResolver);  }### Answer:
@Test public void testRenameProperty() throws RepositoryException { final Resource resource = resourceResolver.getResource("/content/resource-type-update1"); final Node node = resource.adaptTo(Node.class); assertTrue(resource.getValueMap().containsKey("text")); assertFalse(resource.getValueMap().containsKey("label")); assertEquals("hello world", resource.getValueMap().get("text", String.class)); onDeployScript.renameProperty(node, "text", "label"); assertFalse(resource.getValueMap().containsKey("text")); assertTrue(resource.getValueMap().containsKey("label")); assertEquals("hello world", resource.getValueMap().get("label", String.class)); }
@Test public void testRenamePropertyWhenPropertyDoesNotExist() throws RepositoryException { final Resource resource = resourceResolver.getResource("/content/resource-type-update1"); final Node node = resource.adaptTo(Node.class); onDeployScript.renameProperty(node, "bogus", "label"); assertLogText("Property 'bogus' does not exist on resource: /content/resource-type-update1"); }