JasperWirelessSmsClient { GetSMSDetailsResponse getSMSDetails(final Long smsMessageId, final String iccId) { final GetSMSDetailsRequest getSMSDetailsRequest = WS_CLIENT_FACTORY.createGetSMSDetailsRequest(); getSMSDetailsRequest.setLicenseKey(this.jasperWirelessAccess.getLicenseKey()); getSMSDetailsRequest.setMessageId(this.correlationIdProviderService.getCorrelationId(WAKEUPSMS_TYPE, iccId)); final GetSMSDetailsRequest.SmsMsgIds smsMsgIds = new GetSMSDetailsRequest.SmsMsgIds(); final List<Long> smsMsgId = smsMsgIds.getSmsMsgId(); smsMsgId.add(smsMessageId); getSMSDetailsRequest.setSmsMsgIds(smsMsgIds); getSMSDetailsRequest.setMessageTextEncoding(""); getSMSDetailsRequest.setVersion(this.jasperWirelessAccess.getApiVersion()); this.setInterceptorUsernameTokens(); this.jasperWebServiceTemplate.setDefaultUri(this.jasperWirelessAccess.getUri()); return (GetSMSDetailsResponse) this.jasperWebServiceTemplate.marshalSendAndReceive(getSMSDetailsRequest, new SoapActionCallback(SERVICE_GET_SMSDETAILS)); }  SendSMSResponse sendWakeUpSMS(final String iccId);  }
@Test public void testSendWakeUpSmsResult() throws Exception { final Source requestPayload = new StringSource( "<ns2:GetSMSDetailsRequest " + "xmlns:ns2=\"http: + "<ns2:messageId>" + WKAEWUPSMS_CORRID + "</ns2:messageId>" + "<ns2:version>" + API_VERSION + "</ns2:version>" + "<ns2:licenseKey>" + LICENSEKEY + "</ns2:licenseKey>" + "<ns2:smsMsgIds>" + "<ns2:smsMsgId>" + SMS_MSG_ID + "</ns2:smsMsgId>" + "</ns2:smsMsgIds>" + "</ns2:GetSMSDetailsRequest>"); final Source responsePayload = new StringSource( "<ns2:GetSMSDetailsResponse " + "ns2:requestId=\"c16KNt8BksvZDLex\" xmlns:ns2=\"http: + "<ns2:correlationId>" + WKAEWUPSMS_CORRID + "</ns2:correlationId>" + "<ns2:version>" + API_VERSION + "</ns2:version>" + "<ns2:build>jasper_release_6.29-160108-154179</ns2:build>" + "<ns2:timestamp>2016-01-18T12:31:51.760Z</ns2:timestamp>" + "<ns2:smsMessages>" + "<ns2:smsMessage>" + "<ns2:smsMsgId>" + SMS_MSG_ID + "</ns2:smsMsgId>" + "<ns2:status>" + JWCC_STATUS + "</ns2:status>" + "<ns2:senderLogin>MaartenvanHaasteren</ns2:senderLogin>" + "<ns2:sentToIccid>3197002475559</ns2:sentToIccid>" + "<ns2:sentFrom>Server</ns2:sentFrom>" + "<ns2:smsMsgAttemptStatus>" + MODEM_STATUS + "</ns2:smsMsgAttemptStatus>" + "<ns2:msgType>MT</ns2:msgType>" + "<ns2:dateSent>2016-01-18T12:22:04.853Z</ns2:dateSent>" + "<ns2:dateReceived>2016-01-18T12:22:09.878Z</ns2:dateReceived>" + "<ns2:dateAdded>2016-01-18T12:22:04.854Z</ns2:dateAdded>" + "<ns2:dateModified>2016-01-18T12:22:09.889Z</ns2:dateModified>" + "</ns2:smsMessage>" + "</ns2:smsMessages>" + "</ns2:GetSMSDetailsResponse>"); when(this.correlationIdProviderService.getCorrelationId("wakeupsms", ICC_ID)).thenReturn(WKAEWUPSMS_CORRID); this.mockServer.expect(payload(requestPayload)).andRespond(withPayload(responsePayload)); final GetSMSDetailsResponse response = this.wsClientService.getSMSDetails(new Long(SMS_MSG_ID), ICC_ID); this.mockServer.verify(); final List<SmsMessageType> smsMessageTypes = response.getSmsMessages().getSmsMessage(); assertThat(smsMessageTypes).isNotNull(); final SmsMessageType smsMessageType = smsMessageTypes.get(0); assertThat(smsMessageType.getStatus()).isEqualTo(JWCC_STATUS); assertThat(smsMessageType.getSmsMsgAttemptStatus()).isEqualTo(MODEM_STATUS); }