### Question:
ConfigPropertyServiceImpl implements ConfigPropertyService { @Override @Transactional public String deleteProperty(ConfigPropertyItem configPropertyItem, String user, String userMessage, String timeNow, boolean partOfRollbackOperation) { ConfigPropertyKey configPropertyKey = new ConfigPropertyKey(); configPropertyKey.setApplication(configPropertyItem.getApplication()); configPropertyKey.setProfile(activeProfile); configPropertyKey.setLabel(AdminConstants.LATEST); configPropertyKey.setCfkey(configPropertyItem.getConfigKey()); ConfigProperty configProperty = new ConfigProperty(); configProperty.setConfigKeyParams(configPropertyKey); configProperty.setValue(configPropertyItem.getConfigValue()); ConfigPropertyAudit configPropertyAudit = new ConfigPropertyAudit(); configPropertyAudit.setId(UUID.randomUUID().toString()); configPropertyAudit.setCfkey(configPropertyKey.getCfkey()); configPropertyAudit.setApplication(configPropertyKey.getApplication()); configPropertyAudit.setProfile(configPropertyKey.getProfile()); configPropertyAudit.setLabel(configPropertyKey.getLabel()); configPropertyAudit.setOldvalue(configPropertyRepository.findByConfigKeyParams(configPropertyKey).getValue()); configPropertyAudit.setModifiedBy(user); configPropertyAudit.setModifiedDate(timeNow); configPropertyAudit.setUserMessage(userMessage); configPropertyAudit.setSystemMessage("DELETE operation through API invocation"); if (partOfRollbackOperation) { configPropertyAudit.setSystemMessage(AdminConstants.CONFIG_ROLLBACK_MSG); } configPropertyRepository.delete(configProperty); configPropertyAuditRepository.save(configPropertyAudit); return "Success"; }  @Override ConfigTreeNode listProperties(); @Override @Transactional List<ConfigProperty> addUpdateProperties(ConfigPropertyRequest configPropertyRequest, String user,
			String userMessage, String timeNow, boolean partOfRollbackOperation); @Override @Transactional String deleteProperty(ConfigPropertyItem configPropertyItem, String user, String userMessage, String timeNow,
			boolean partOfRollbackOperation); @Override boolean isAllPropertiesExisting(ConfigPropertyRequest configPropertyRequest); @Override boolean isAnyPropertyExisting(ConfigPropertyRequest configPropertyRequest); @Override boolean isPropertyExisting(ConfigPropertyItem configPropertyItem); @Override boolean isCfkeyExisting(String cfkey); @Override boolean isAllCfkeysExisting(ConfigPropertyRequest configPropertyRequest); @Override boolean isApplicationExisting(String application); @Override boolean isAllApplicationsExisting(ConfigPropertyRequest configPropertyRequest); @Override List<String> listAllKeys(); @Override ConfigPropertyAuditTrail listAllConfigPropertyAudits(String timestamp); @Override ConfigPropertyRollbackPreview getRollbackPreview(String timestamp); @Override @Transactional String doConfigPropertyRollbackToTimestamp(String timestamp, String user, String userMessage); @Override List<ConfigProperty> listProperty(String cfkey, String application);  }### Answer:
@SuppressWarnings("unchecked") @Test public void deletePropertiesTest() throws Exception { ConfigPropertyItem configPropertyRequest = new ConfigPropertyItem(); configPropertyRequest.setApplication("application"); configPropertyRequest.setConfigKey("key"); configPropertyRequest.setConfigKey("value"); List<ConfigProperty> cfList = new ArrayList<>(); ConfigProperty cf1 = new ConfigProperty(); ConfigPropertyKey cfkey1 = new ConfigPropertyKey(); cfkey1.setApplication("application"); cfkey1.setCfkey("applevelkey1"); cfkey1.setProfile("dev"); cf1.setConfigKeyParams(cfkey1); cf1.setValue("applevelvalue"); cfList.add(cf1); when(configPropertyRepository.findByConfigKeyParams(any(ConfigPropertyKey.class))).thenReturn(cf1); Mockito.doNothing().when(configPropertyRepository).deleteAll(anyCollection()); when(configPropertyAuditRepository.saveAll(anyCollection())).thenReturn(new ArrayList<>()); assertTrue(configPropertyService.deleteProperty(configPropertyRequest, "user", "", "10/10/2018 10:10:10", false) .equals("Success")); }