use of javax.slee.ActivityContextInterface in project smscgateway by RestComm.
the class TxHttpServerSbbTest method sendMessageGETJsonWrongPasswordTest.
@Test
public void sendMessageGETJsonWrongPasswordTest() {
System.out.println("sendMessageGETJsonWrongPasswordTest");
if (!this.cassandraDbInited) {
// Assert.fail("Cassandra DB is not inited");
return;
}
// prepare
ActivityContextInterface aci = new HttpActivityContextInterface();
MockHttpServletRequestEvent event = new MockHttpServletRequestEvent();
MockHttpServletRequest request = buildSendMessageRequest(METHOD_GET, URL_SEND_MESSAGE, USER_INCORRECT, PASSWORD_INCORRECT, MESSAGE_DEFAULT, FORMAT_JSON, ENCODING_UCS2, BODY_ENCODING_UTF8, SENDER_ID_DEFAULT, SENDER_TON_DEFAULT, SENDER_NPI_DEFAULT, TO_ONE);
event.setRequest(request);
MockHttpServletResponse response = new MockHttpServletResponse();
event.setResponse(response);
// perform the action
this.sbb.onHttpGet(event, aci);
MockHttpServletResponse resp = (MockHttpServletResponse) event.getResponse();
printResponseData(resp);
Assert.assertEquals(resp.getStatus(), HttpServletResponse.SC_UNAUTHORIZED);
}
use of javax.slee.ActivityContextInterface in project smscgateway by RestComm.
the class RxSmppServerSbbTest method testSubmitSm_test1.
@Test(groups = { "RxSmppServer" })
public void testSubmitSm_test1() throws Exception {
if (!this.cassandraDbInited)
return;
ArrayList<SmsDef> lst = new ArrayList<SmsDef>();
SmsDef sd1 = new SmsDef();
lst.add(sd1);
SmsSet smsSet = prepareDatabase(lst);
SmsSetEvent event = new SmsSetEvent();
event.setSmsSet(smsSet);
EventContext eventContext = null;
ActivityContextInterface aci = new SmppTransactionProxy(esme);
this.sbb.onDeliverSm(event, aci, eventContext);
DeliverSmResp eventResp = new DeliverSmResp();
eventResp.setSequenceNumber(sbb.getNextSentSequenseId());
this.sbb.onDeliverSmRespParent(eventResp, aci, eventContext);
}
Aggregations