@Test public void doNotProceed_shouldNotCreateRecordFolder() { rmaConfig.setCreateRecordFolderOnComplaintCreate(false); expect(mockService.getRmaConfig()).andReturn(rmaConfig); ComplaintCreatedEvent event = new ComplaintCreatedEvent(new Complaint()); replayAll(); unit.onApplicationEvent(event); verifyAll(); }
@Override public void onApplicationEvent(ComplaintCreatedEvent complaintCreatedEvent) { AlfrescoRmaConfig rmaConfig = alfrescoRecordsService.getRmaConfig(); boolean proceed = rmaConfig.getIntegrationEnabled() && rmaConfig.getCreateRecordFolderOnComplaintCreate(); if (!proceed) { return; } if (!complaintCreatedEvent.isSucceeded()) { log.trace("Returning - complaint creation was not successful"); return; } try { Folder categoryFolder = getAlfrescoRecordsService().findFolder(ComplaintConstants.OBJECT_TYPE); getAlfrescoRecordsService().createOrFindRecordFolder(complaintCreatedEvent.getComplaintNumber(), categoryFolder); } catch (AlfrescoServiceException e) { log.error("Could not create record folder for complaint: {}", e.getMessage(), e); } }
AcmComplaintFolderListener implements ApplicationListener<ComplaintCreatedEvent> { @Override public void onApplicationEvent(ComplaintCreatedEvent complaintCreatedEvent) { AlfrescoRmaConfig rmaConfig = alfrescoRecordsService.getRmaConfig(); boolean proceed = rmaConfig.getIntegrationEnabled() && rmaConfig.getCreateRecordFolderOnComplaintCreate(); if (!proceed) { return; } if (!complaintCreatedEvent.isSucceeded()) { log.trace("Returning - complaint creation was not successful"); return; } try { Folder categoryFolder = getAlfrescoRecordsService().findFolder(ComplaintConstants.OBJECT_TYPE); getAlfrescoRecordsService().createOrFindRecordFolder(complaintCreatedEvent.getComplaintNumber(), categoryFolder); } catch (AlfrescoServiceException e) { log.error("Could not create record folder for complaint: {}", e.getMessage(), e); } } }
AcmComplaintFolderListener implements ApplicationListener<ComplaintCreatedEvent> { @Override public void onApplicationEvent(ComplaintCreatedEvent complaintCreatedEvent) { AlfrescoRmaConfig rmaConfig = alfrescoRecordsService.getRmaConfig(); boolean proceed = rmaConfig.getIntegrationEnabled() && rmaConfig.getCreateRecordFolderOnComplaintCreate(); if (!proceed) { return; } if (!complaintCreatedEvent.isSucceeded()) { log.trace("Returning - complaint creation was not successful"); return; } try { Folder categoryFolder = getAlfrescoRecordsService().findFolder(ComplaintConstants.OBJECT_TYPE); getAlfrescoRecordsService().createOrFindRecordFolder(complaintCreatedEvent.getComplaintNumber(), categoryFolder); } catch (AlfrescoServiceException e) { log.error("Could not create record folder for complaint: {}", e.getMessage(), e); } }  }
AcmComplaintFolderListener implements ApplicationListener<ComplaintCreatedEvent> { @Override public void onApplicationEvent(ComplaintCreatedEvent complaintCreatedEvent) { AlfrescoRmaConfig rmaConfig = alfrescoRecordsService.getRmaConfig(); boolean proceed = rmaConfig.getIntegrationEnabled() && rmaConfig.getCreateRecordFolderOnComplaintCreate(); if (!proceed) { return; } if (!complaintCreatedEvent.isSucceeded()) { log.trace("Returning - complaint creation was not successful"); return; } try { Folder categoryFolder = getAlfrescoRecordsService().findFolder(ComplaintConstants.OBJECT_TYPE); getAlfrescoRecordsService().createOrFindRecordFolder(complaintCreatedEvent.getComplaintNumber(), categoryFolder); } catch (AlfrescoServiceException e) { log.error("Could not create record folder for complaint: {}", e.getMessage(), e); } }  @Override void onApplicationEvent(ComplaintCreatedEvent complaintCreatedEvent); AlfrescoRecordsService getAlfrescoRecordsService(); void setAlfrescoRecordsService(AlfrescoRecordsService alfrescoRecordsService); }
AcmComplaintFolderListener implements ApplicationListener<ComplaintCreatedEvent> { @Override public void onApplicationEvent(ComplaintCreatedEvent complaintCreatedEvent) { AlfrescoRmaConfig rmaConfig = alfrescoRecordsService.getRmaConfig(); boolean proceed = rmaConfig.getIntegrationEnabled() && rmaConfig.getCreateRecordFolderOnComplaintCreate(); if (!proceed) { return; } if (!complaintCreatedEvent.isSucceeded()) { log.trace("Returning - complaint creation was not successful"); return; } try { Folder categoryFolder = getAlfrescoRecordsService().findFolder(ComplaintConstants.OBJECT_TYPE); getAlfrescoRecordsService().createOrFindRecordFolder(complaintCreatedEvent.getComplaintNumber(), categoryFolder); } catch (AlfrescoServiceException e) { log.error("Could not create record folder for complaint: {}", e.getMessage(), e); } }  @Override void onApplicationEvent(ComplaintCreatedEvent complaintCreatedEvent); AlfrescoRecordsService getAlfrescoRecordsService(); void setAlfrescoRecordsService(AlfrescoRecordsService alfrescoRecordsService);  }