### Question:
PropertiesAdminService extends RegistryAbstractAdmin implements
        IPropertiesAdminService<PropertiesBean,RetentionBean> { public void updateProperty(String path, String name, String value, String oldName) throws RegistryException { if(name != null && name.startsWith("registry.")) { throw new RegistryException("Property cannot start with the \"registry.\" prefix. " + "Property name " + name + ". Resource path = " + path); } UserRegistry registry = (UserRegistry) getRootRegistry(); if (RegistryUtils.isRegistryReadOnly(registry.getRegistryContext())) { return; } Resource resource = registry.get(path); if(resource.getProperties().keySet().contains(name) && !name.equals(oldName)) { throw new RegistryException("Cannot duplicate property name. Please choose a different name. " + "Property name " + name + ". Resource path = " + path); } if (oldName.equals(name)) { resource.setProperty(name, value); } else { resource.setProperty(name, value); resource.removeProperty(oldName); } registry.put(resource.getPath(), resource); resource.discard(); }  PropertiesBean getProperties(String path, String viewProps); void setProperty(String path, String name, String value); void updateProperty(String path, String name, String value, String oldName); void removeProperty(String path, String name); boolean setRetentionProperties(String path, RetentionBean bean); RetentionBean getRetentionProperties(String path);  }### Answer:
@Test(expected = RegistryException.class) public void testUpdatePropertyRegistryProperty() throws Exception { PropertiesAdminService adminService = new PropertiesAdminService(); adminService.updateProperty(resourcePath, "registry.mount.path", "_system_governance", "registry.mount" + ".path"); }
@Test public void updateProperty() throws Exception { System.setProperty("carbon.repo.write.mode", "true"); resource.setProperty("mount.path", "_system_config"); PropertiesAdminService adminService = new PropertiesAdminService(); adminService.updateProperty(resourcePath, "mount.path", "_system_governance", "mount.path"); PropertiesBean propertiesBean = adminService.getProperties(resourcePath, "true"); assertArrayEquals(new String[]{}, propertiesBean.getLifecycleProperties()); Property[] properties = propertiesBean.getProperties(); assertEquals(1, properties.length); assertEquals("_system_governance", properties[0].getValue()); assertArrayEquals(new String[]{"mount.path"}, propertiesBean.getSysProperties()); assertArrayEquals(new String[]{}, propertiesBean.getValidationProperties()); System.clearProperty("carbon.repo.write.mode"); }