### Question:
PropertiesAdminService extends RegistryAbstractAdmin implements
        IPropertiesAdminService<PropertiesBean,RetentionBean> { public RetentionBean getRetentionProperties(String path) throws RegistryException { UserRegistry registry = (UserRegistry) getRootRegistry(); Resource resource = registry.get(path); RetentionBean bean = new RetentionBean(); ResourcePath resourcePath = new ResourcePath(path); String userName = resource.getProperty(CommonConstants.RETENTION_USERNAME_PROP_NAME); if (userName == null) { if(!resourcePath.isCurrentVersion()){ String originalPath = resourcePath.getPath(); resource = registry.get(originalPath); userName = resource.getProperty(CommonConstants.RETENTION_USERNAME_PROP_NAME); bean.setReadOnly(true); }else{ return null; } } else { bean.setReadOnly(!userName.equals(registry.getUserName())); } bean.setUserName(userName); bean.setFromDate(resource.getProperty(CommonConstants.RETENTION_FROM_DATE_PROP_NAME)); bean.setToDate(resource.getProperty(CommonConstants.RETENTION_TO_DATE_PROP_NAME)); bean.setWriteLocked(Boolean.parseBoolean(resource.getProperty( CommonConstants.RETENTION_WRITE_LOCKED_PROP_NAME))); bean.setDeleteLocked(Boolean.parseBoolean(resource.getProperty( CommonConstants.RETENTION_DELETE_LOCKED_PROP_NAME))); return bean; }  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 public void testGetRetentionProperties() throws Exception { System.setProperty("carbon.repo.write.mode", "true"); DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); String fromDate = df.format(Calendar.getInstance().getTime()); resource.setProperty(CommonConstants.RETENTION_USERNAME_PROP_NAME, "admin"); resource.setProperty(CommonConstants.RETENTION_FROM_DATE_PROP_NAME, fromDate); String toDate = df.format(Calendar.getInstance().getTime()); resource.setProperty(CommonConstants.RETENTION_TO_DATE_PROP_NAME, toDate); resource.setProperty(CommonConstants.RETENTION_WRITE_LOCKED_PROP_NAME, "true"); resource.setProperty(CommonConstants.RETENTION_DELETE_LOCKED_PROP_NAME, "false"); PropertiesAdminService adminService = new PropertiesAdminService(); RetentionBean retentionBean = adminService.getRetentionProperties(resourcePath); assertEquals(fromDate, retentionBean.getFromDate()); assertEquals(toDate, retentionBean.getToDate()); assertEquals("admin", retentionBean.getUserName()); assertTrue(retentionBean.getWriteLocked()); assertFalse(retentionBean.getDeleteLocked()); System.clearProperty("carbon.repo.write.mode"); }