@Test @Ignore public void test_complaint_repository_should_call_jpa_repository_to_save_the_complaint() { RequestInfo requestInfo = new RequestInfo(); ServiceRequest serviceRequest = new ServiceRequest(); SevaRequest sevaRequest = new SevaRequest(requestInfo, serviceRequest); complaintRepository.save(sevaRequest); verify(serviceRequestMessageQueueRepository).save(sevaRequestArgumentCaptor.capture()); SevaRequest actual = sevaRequestArgumentCaptor.getValue(); assertThat(actual.getRequestInfo().getAction()).isEqualTo("POST"); assertThat(actual.getServiceRequest().getCreatedDate()).isNotNull(); }
public void save(SevaRequest sevaRequest) { sevaRequest.getRequestInfo().setAction(POST); final Date now = new Date(); sevaRequest.getServiceRequest().setCreatedDate(now); sevaRequest.getServiceRequest().setLastModifiedDate(now); String serviceTypeCode = sevaRequest.getServiceRequest().getServiceTypeCode(); String tenantId = sevaRequest.getServiceRequest().getTenantId(); String serviceName = getServiceName(serviceTypeCode, tenantId); sevaRequest.getServiceRequest().setServiceTypeName(serviceName); this.serviceRequestMessageQueueRepository.save(sevaRequest); }
ServiceRequestRepository { public void save(SevaRequest sevaRequest) { sevaRequest.getRequestInfo().setAction(POST); final Date now = new Date(); sevaRequest.getServiceRequest().setCreatedDate(now); sevaRequest.getServiceRequest().setLastModifiedDate(now); String serviceTypeCode = sevaRequest.getServiceRequest().getServiceTypeCode(); String tenantId = sevaRequest.getServiceRequest().getTenantId(); String serviceName = getServiceName(serviceTypeCode, tenantId); sevaRequest.getServiceRequest().setServiceTypeName(serviceName); this.serviceRequestMessageQueueRepository.save(sevaRequest); } }
ServiceRequestRepository { public void save(SevaRequest sevaRequest) { sevaRequest.getRequestInfo().setAction(POST); final Date now = new Date(); sevaRequest.getServiceRequest().setCreatedDate(now); sevaRequest.getServiceRequest().setLastModifiedDate(now); String serviceTypeCode = sevaRequest.getServiceRequest().getServiceTypeCode(); String tenantId = sevaRequest.getServiceRequest().getTenantId(); String serviceName = getServiceName(serviceTypeCode, tenantId); sevaRequest.getServiceRequest().setServiceTypeName(serviceName); this.serviceRequestMessageQueueRepository.save(sevaRequest); } @Autowired  ServiceRequestRepository(ServiceRequestMessageQueueRepository serviceRequestMessageQueueRepository,
                                    SubmissionRepository submissionRepository, ServiceRequestESRepository
                                        serviceRequestESRepository,
                                    ServiceRequestTypeRepository serviceRequestTypeRepository,
                                    SubmissionAttributeRepository submissionAttributeRepository); }
ServiceRequestRepository { public void save(SevaRequest sevaRequest) { sevaRequest.getRequestInfo().setAction(POST); final Date now = new Date(); sevaRequest.getServiceRequest().setCreatedDate(now); sevaRequest.getServiceRequest().setLastModifiedDate(now); String serviceTypeCode = sevaRequest.getServiceRequest().getServiceTypeCode(); String tenantId = sevaRequest.getServiceRequest().getTenantId(); String serviceName = getServiceName(serviceTypeCode, tenantId); sevaRequest.getServiceRequest().setServiceTypeName(serviceName); this.serviceRequestMessageQueueRepository.save(sevaRequest); } @Autowired  ServiceRequestRepository(ServiceRequestMessageQueueRepository serviceRequestMessageQueueRepository,
                                    SubmissionRepository submissionRepository, ServiceRequestESRepository
                                        serviceRequestESRepository,
                                    ServiceRequestTypeRepository serviceRequestTypeRepository,
                                    SubmissionAttributeRepository submissionAttributeRepository); void save(SevaRequest sevaRequest); List<ServiceRequest> find(ServiceRequestSearchCriteria searchCriteria); Long getCount(ServiceRequestSearchCriteria serviceRequestSearchCriteria); void update(SevaRequest sevaRequest); List<ServiceRequest> findFromDb(ServiceRequestSearchCriteria serviceRequestSearchCriteria); List<String> getCrnBySubmissionAttributes(ServiceRequestSearchCriteria searchCriteria); String getServiceName(String serviceCode, String tenantId); }
ServiceRequestRepository { public void save(SevaRequest sevaRequest) { sevaRequest.getRequestInfo().setAction(POST); final Date now = new Date(); sevaRequest.getServiceRequest().setCreatedDate(now); sevaRequest.getServiceRequest().setLastModifiedDate(now); String serviceTypeCode = sevaRequest.getServiceRequest().getServiceTypeCode(); String tenantId = sevaRequest.getServiceRequest().getTenantId(); String serviceName = getServiceName(serviceTypeCode, tenantId); sevaRequest.getServiceRequest().setServiceTypeName(serviceName); this.serviceRequestMessageQueueRepository.save(sevaRequest); } @Autowired  ServiceRequestRepository(ServiceRequestMessageQueueRepository serviceRequestMessageQueueRepository,
                                    SubmissionRepository submissionRepository, ServiceRequestESRepository
                                        serviceRequestESRepository,
                                    ServiceRequestTypeRepository serviceRequestTypeRepository,
                                    SubmissionAttributeRepository submissionAttributeRepository); void save(SevaRequest sevaRequest); List<ServiceRequest> find(ServiceRequestSearchCriteria searchCriteria); Long getCount(ServiceRequestSearchCriteria serviceRequestSearchCriteria); void update(SevaRequest sevaRequest); List<ServiceRequest> findFromDb(ServiceRequestSearchCriteria serviceRequestSearchCriteria); List<String> getCrnBySubmissionAttributes(ServiceRequestSearchCriteria searchCriteria); String getServiceName(String serviceCode, String tenantId);  }