JasperWirelessSmsClient { public SendSMSResponse sendWakeUpSMS(final String iccid) { final SendSMSRequest sendSMSRequest = WS_CLIENT_FACTORY.createSendSMSRequest(); sendSMSRequest.setLicenseKey(this.jasperWirelessAccess.getLicenseKey()); sendSMSRequest.setMessageId(this.correlationIdProviderService.getCorrelationId(WAKEUPSMS_TYPE, iccid)); sendSMSRequest.setMessageText(""); sendSMSRequest.setMessageTextEncoding(""); sendSMSRequest.setSentToIccid(iccid); sendSMSRequest.setVersion(this.jasperWirelessAccess.getApiVersion()); for (final ClientInterceptor interceptor : this.webServiceTemplate.getInterceptors()) { if (interceptor instanceof Wss4jSecurityInterceptor) { setUsernameToken((Wss4jSecurityInterceptor) interceptor, this.jasperWirelessAccess.getUsername(), this.jasperWirelessAccess.getPassword()); } } this.webServiceTemplate.setDefaultUri(this.jasperWirelessAccess.getUri()); return (SendSMSResponse) this.webServiceTemplate.marshalSendAndReceive(sendSMSRequest, new SoapActionCallback( "http: }  SendSMSResponse sendWakeUpSMS(final String iccid); GetSMSDetailsResponse getSMSDetails(final Long smsMessageId, final String iccid);  }
@Test public void testSendWakeUpSms() throws Exception { final Source requestPayload = new StringSource( "<ns2:SendSMSRequest " + "xmlns:ns2=\"http: + "<ns2:messageId>" + WKAEWUPSMS_CORRID + "</ns2:messageId>" + "<ns2:version>" + API_VERSION + "</ns2:version>" + "<ns2:licenseKey>" + LICENSEKEY + "</ns2:licenseKey>" + "<ns2:sentToIccid>" + ICC_ID + "</ns2:sentToIccid>" + "<ns2:messageText/>" + "</ns2:SendSMSRequest>"); final Source responsePayload = new StringSource( "<ns2:SendSMSResponse " + "ns2:requestId=\"IfBlIDGkzgTkWqa3\" 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:22:05.082Z</ns2:timestamp>" + "<ns2:smsMsgId>" + SMS_MSG_ID + "</ns2:smsMsgId>" + "</ns2:SendSMSResponse>"); when( this.correlationIdProviderService.getCorrelationId("wakeupsms", ICC_ID)).thenReturn(WKAEWUPSMS_CORRID); this.mockServer.expect(payload(requestPayload)).andRespond( withPayload(responsePayload)); final SendSMSResponse response = this.wsClientService .sendWakeUpSMS(ICC_ID); this.mockServer.verify(); assertEquals(SMS_MSG_ID, String.valueOf(response.getSmsMsgId())); }