@Test public void testSendCHPSMessage() { System.out.println("sendCHPSMessage"); String messageId = "tsid2"; String workerName = "Test worker"; String workerNumber = "000000000000"; MediaType messageType = MediaType.TEXT; Patient[] patientList = null; NameValuePair attrib = new NameValuePair("Test", "Test"); NameValuePair[] personalInfo = new NameValuePair[]{attrib}; expect( mockOMIService.saveCHPSMessageRequest((String) anyObject(), ( NameValuePair[]) anyObject(), (String) anyObject(), (Patient[]) anyObject(), (String) anyObject(), (MediaType) anyObject(), (Long) anyObject(), (Date) anyObject(), (Date) anyObject()) ).andReturn(MessageStatus.QUEUED); replay(mockOMI, mockOMIService); MessageStatus result = instance.sendCHPSMessage(messageId, personalInfo, workerNumber, patientList, "Lang", messageType, 13L, null, null); assertEquals(result, MessageStatus.QUEUED); verify(mockOMI, mockOMIService); }
@WebMethod public MessageStatus sendCHPSMessage(@WebParam(name = "messageId") String messageId, @WebParam(name = "personalInfo") NameValuePair[] personalInfo, @WebParam(name = "workerNumber") String workerNumber, @WebParam(name = "patientList") Patient[] patientList, @WebParam(name = "langCode") String langCode, @WebParam(name = "mediaType") MediaType messageType, @WebParam(name = "notificationType") Long notificationType, @WebParam(name = "startDate") Date startDate, @WebParam(name = "endDate") Date endDate) { logger.debug("Called MessageService.sendCHPSMessage with parameters:\n\rmessageId - " + messageId + "\n\rworkerNumber - " + workerNumber + "\n\rstartDate - " + startDate + "\n\rendDate - " + endDate); logger.info("Processing request..."); return this.omiManager.createOMIService().saveCHPSMessageRequest(messageId, personalInfo, workerNumber, patientList, langCode, messageType, notificationType, startDate, endDate); }
MessageServiceImpl implements MessageService { @WebMethod public MessageStatus sendCHPSMessage(@WebParam(name = "messageId") String messageId, @WebParam(name = "personalInfo") NameValuePair[] personalInfo, @WebParam(name = "workerNumber") String workerNumber, @WebParam(name = "patientList") Patient[] patientList, @WebParam(name = "langCode") String langCode, @WebParam(name = "mediaType") MediaType messageType, @WebParam(name = "notificationType") Long notificationType, @WebParam(name = "startDate") Date startDate, @WebParam(name = "endDate") Date endDate) { logger.debug("Called MessageService.sendCHPSMessage with parameters:\n\rmessageId - " + messageId + "\n\rworkerNumber - " + workerNumber + "\n\rstartDate - " + startDate + "\n\rendDate - " + endDate); logger.info("Processing request..."); return this.omiManager.createOMIService().saveCHPSMessageRequest(messageId, personalInfo, workerNumber, patientList, langCode, messageType, notificationType, startDate, endDate); } }
MessageServiceImpl implements MessageService { @WebMethod public MessageStatus sendCHPSMessage(@WebParam(name = "messageId") String messageId, @WebParam(name = "personalInfo") NameValuePair[] personalInfo, @WebParam(name = "workerNumber") String workerNumber, @WebParam(name = "patientList") Patient[] patientList, @WebParam(name = "langCode") String langCode, @WebParam(name = "mediaType") MediaType messageType, @WebParam(name = "notificationType") Long notificationType, @WebParam(name = "startDate") Date startDate, @WebParam(name = "endDate") Date endDate) { logger.debug("Called MessageService.sendCHPSMessage with parameters:\n\rmessageId - " + messageId + "\n\rworkerNumber - " + workerNumber + "\n\rstartDate - " + startDate + "\n\rendDate - " + endDate); logger.info("Processing request..."); return this.omiManager.createOMIService().saveCHPSMessageRequest(messageId, personalInfo, workerNumber, patientList, langCode, messageType, notificationType, startDate, endDate); }  }
MessageServiceImpl implements MessageService { @WebMethod public MessageStatus sendCHPSMessage(@WebParam(name = "messageId") String messageId, @WebParam(name = "personalInfo") NameValuePair[] personalInfo, @WebParam(name = "workerNumber") String workerNumber, @WebParam(name = "patientList") Patient[] patientList, @WebParam(name = "langCode") String langCode, @WebParam(name = "mediaType") MediaType messageType, @WebParam(name = "notificationType") Long notificationType, @WebParam(name = "startDate") Date startDate, @WebParam(name = "endDate") Date endDate) { logger.debug("Called MessageService.sendCHPSMessage with parameters:\n\rmessageId - " + messageId + "\n\rworkerNumber - " + workerNumber + "\n\rstartDate - " + startDate + "\n\rendDate - " + endDate); logger.info("Processing request..."); return this.omiManager.createOMIService().saveCHPSMessageRequest(messageId, personalInfo, workerNumber, patientList, langCode, messageType, notificationType, startDate, endDate); }  @WebMethod void sendPatientMessages(@WebParam(name="messages") PatientMessage[] messages); @WebMethod MessageStatus sendPatientMessage(@WebParam(name = "messageId") String messageId, 
    										@WebParam(name = "personalInfo") NameValuePair[] personalInfo, 
    										@WebParam(name = "patientNumber") String patientNumber, 
    										@WebParam(name = "patientNumberType") ContactNumberType patientNumberType, 
    										@WebParam(name = "langCode") String langCode, 
    										@WebParam(name = "mediaType") MediaType messageType, 
    										@WebParam(name = "notificationType") Long notificationType, 
    										@WebParam(name = "startDate") Date startDate, 
    										@WebParam(name = "endDate") Date endDate, 
    										@WebParam(name = "recipientId") String recipientId); @WebMethod MessageStatus sendCHPSMessage(@WebParam(name = "messageId") String messageId,
                                         @WebParam(name = "personalInfo") NameValuePair[] personalInfo,
                                         @WebParam(name = "workerNumber") String workerNumber,
                                         @WebParam(name = "patientList") Patient[] patientList,
                                         @WebParam(name = "langCode") String langCode,
                                         @WebParam(name = "mediaType") MediaType messageType,
                                         @WebParam(name = "notificationType") Long notificationType,
                                         @WebParam(name = "startDate") Date startDate,
                                         @WebParam(name = "endDate") Date endDate); @WebMethod MessageStatus sendDefaulterMessage(@WebParam(name = "messageId") String messageId,
                                              @WebParam(name = "workerNumber") String workerNumber,
                                              @WebParam(name = "cares") Care[] cares,
                                              @WebParam(name = "groupingStrategy") CareMessageGroupingStrategy groupingStrategy,
                                              @WebParam(name = "messageType") MediaType mediaType,
                                              @WebParam(name = "startDate") Date startDate,
                                              @WebParam(name = "endDate") Date endDate); @WebMethod MessageStatus sendDeliveriesMessage(@WebParam(name = "messageId") String messageId,
                                               @WebParam(name = "workerNumber") String workerNumber,
                                               @WebParam(name = "patients") Patient[] patients,
                                               @WebParam(name = "deliveryStatus") String deliveryStatus,
                                               @WebParam(name = "mediaType") MediaType mediaType,
                                               @WebParam(name = "startDate") Date startDate,
                                               @WebParam(name = "endDate") Date endDate); @WebMethod MessageStatus sendUpcomingCaresMessage(@WebParam(name = "messageId") String messageId,
                                                  @WebParam(name = "workerNumber") String workerNumber,
                                                  @WebParam(name = "patient") Patient patient,
                                                  @WebParam(name = "mediaType") MediaType mediaType,
                                                  @WebParam(name = "startDate") Date startDate,
                                                  @WebParam(name = "endDate") Date endDate); @WebMethod MessageStatus sendBulkCaresMessage(@WebParam(name = "messageId") String messageId,
                                                  @WebParam(name = "workerNumber") String workerNumber,
                                                  @WebParam(name = "patient") Care[] cares,
                                                  @WebParam(name = "groupingStrategy") CareMessageGroupingStrategy groupingStrategy,
                                                  @WebParam(name = "mediaType") MediaType mediaType,
                                                  @WebParam(name = "startDate") Date startDate,
                                                  @WebParam(name = "endDate") Date endDate); @WebMethod MessageStatus sendMessage(@WebParam(name = "content") String content,
                                     @WebParam(name = "recipient") String recipient); @WebMethod(exclude = true) OMIManager getOmiManager(); @WebMethod(exclude = true) void setOmiManager(OMIManager omiManager); }
MessageServiceImpl implements MessageService { @WebMethod public MessageStatus sendCHPSMessage(@WebParam(name = "messageId") String messageId, @WebParam(name = "personalInfo") NameValuePair[] personalInfo, @WebParam(name = "workerNumber") String workerNumber, @WebParam(name = "patientList") Patient[] patientList, @WebParam(name = "langCode") String langCode, @WebParam(name = "mediaType") MediaType messageType, @WebParam(name = "notificationType") Long notificationType, @WebParam(name = "startDate") Date startDate, @WebParam(name = "endDate") Date endDate) { logger.debug("Called MessageService.sendCHPSMessage with parameters:\n\rmessageId - " + messageId + "\n\rworkerNumber - " + workerNumber + "\n\rstartDate - " + startDate + "\n\rendDate - " + endDate); logger.info("Processing request..."); return this.omiManager.createOMIService().saveCHPSMessageRequest(messageId, personalInfo, workerNumber, patientList, langCode, messageType, notificationType, startDate, endDate); }  @WebMethod void sendPatientMessages(@WebParam(name="messages") PatientMessage[] messages); @WebMethod MessageStatus sendPatientMessage(@WebParam(name = "messageId") String messageId, 
    										@WebParam(name = "personalInfo") NameValuePair[] personalInfo, 
    										@WebParam(name = "patientNumber") String patientNumber, 
    										@WebParam(name = "patientNumberType") ContactNumberType patientNumberType, 
    										@WebParam(name = "langCode") String langCode, 
    										@WebParam(name = "mediaType") MediaType messageType, 
    										@WebParam(name = "notificationType") Long notificationType, 
    										@WebParam(name = "startDate") Date startDate, 
    										@WebParam(name = "endDate") Date endDate, 
    										@WebParam(name = "recipientId") String recipientId); @WebMethod MessageStatus sendCHPSMessage(@WebParam(name = "messageId") String messageId,
                                         @WebParam(name = "personalInfo") NameValuePair[] personalInfo,
                                         @WebParam(name = "workerNumber") String workerNumber,
                                         @WebParam(name = "patientList") Patient[] patientList,
                                         @WebParam(name = "langCode") String langCode,
                                         @WebParam(name = "mediaType") MediaType messageType,
                                         @WebParam(name = "notificationType") Long notificationType,
                                         @WebParam(name = "startDate") Date startDate,
                                         @WebParam(name = "endDate") Date endDate); @WebMethod MessageStatus sendDefaulterMessage(@WebParam(name = "messageId") String messageId,
                                              @WebParam(name = "workerNumber") String workerNumber,
                                              @WebParam(name = "cares") Care[] cares,
                                              @WebParam(name = "groupingStrategy") CareMessageGroupingStrategy groupingStrategy,
                                              @WebParam(name = "messageType") MediaType mediaType,
                                              @WebParam(name = "startDate") Date startDate,
                                              @WebParam(name = "endDate") Date endDate); @WebMethod MessageStatus sendDeliveriesMessage(@WebParam(name = "messageId") String messageId,
                                               @WebParam(name = "workerNumber") String workerNumber,
                                               @WebParam(name = "patients") Patient[] patients,
                                               @WebParam(name = "deliveryStatus") String deliveryStatus,
                                               @WebParam(name = "mediaType") MediaType mediaType,
                                               @WebParam(name = "startDate") Date startDate,
                                               @WebParam(name = "endDate") Date endDate); @WebMethod MessageStatus sendUpcomingCaresMessage(@WebParam(name = "messageId") String messageId,
                                                  @WebParam(name = "workerNumber") String workerNumber,
                                                  @WebParam(name = "patient") Patient patient,
                                                  @WebParam(name = "mediaType") MediaType mediaType,
                                                  @WebParam(name = "startDate") Date startDate,
                                                  @WebParam(name = "endDate") Date endDate); @WebMethod MessageStatus sendBulkCaresMessage(@WebParam(name = "messageId") String messageId,
                                                  @WebParam(name = "workerNumber") String workerNumber,
                                                  @WebParam(name = "patient") Care[] cares,
                                                  @WebParam(name = "groupingStrategy") CareMessageGroupingStrategy groupingStrategy,
                                                  @WebParam(name = "mediaType") MediaType mediaType,
                                                  @WebParam(name = "startDate") Date startDate,
                                                  @WebParam(name = "endDate") Date endDate); @WebMethod MessageStatus sendMessage(@WebParam(name = "content") String content,
                                     @WebParam(name = "recipient") String recipient); @WebMethod(exclude = true) OMIManager getOmiManager(); @WebMethod(exclude = true) void setOmiManager(OMIManager omiManager);  }