use of org.jsmpp.bean.DataSm in project camel by apache.
the class MessageReceiverListenerImplTest method onAcceptDataSmSuccess.
@Test
public void onAcceptDataSmSuccess() throws Exception {
SMPPSession session = createMock(SMPPSession.class);
DataSm dataSm = createMock(DataSm.class);
Exchange exchange = createMock(Exchange.class);
OptionalParameter[] optionalParameters = new OptionalParameter[] {};
expect(endpoint.createOnAcceptDataSm(dataSm, "1")).andReturn(exchange);
processor.process(exchange);
expect(exchange.getException()).andReturn(null);
expect(dataSm.getOptionalParameters()).andReturn(optionalParameters);
replay(endpoint, processor, exceptionHandler, session, dataSm, exchange);
DataSmResult result = listener.onAcceptDataSm(dataSm, session);
verify(endpoint, processor, exceptionHandler, session, dataSm, exchange);
assertEquals("1", result.getMessageId());
assertSame(optionalParameters, result.getOptionalParameters());
}
use of org.jsmpp.bean.DataSm in project camel by apache.
the class SmppEndpointTest method createOnAcceptDataSm.
@Test
public void createOnAcceptDataSm() throws Exception {
DataSm dataSm = createMock(DataSm.class);
SmppMessage message = createMock(SmppMessage.class);
expect(binding.createSmppMessage(eq(dataSm), isA(String.class))).andReturn(message);
message.setExchange(isA(Exchange.class));
replay(dataSm, binding, message);
Exchange exchange = endpoint.createOnAcceptDataSm(dataSm, "1");
verify(dataSm, binding, message);
assertSame(binding, exchange.getProperty(Exchange.BINDING));
assertSame(message, exchange.getIn());
assertSame(ExchangePattern.InOnly, exchange.getPattern());
}
use of org.jsmpp.bean.DataSm in project camel by apache.
the class SmppMessageTest method testSmppMessageDataSm.
@Test
public void testSmppMessageDataSm() {
DataSm command = new DataSm();
message = new SmppMessage(command, new SmppConfiguration());
assertTrue(message.getCommand() instanceof DataSm);
assertTrue(message.getHeaders().isEmpty());
assertTrue(message.isDataSm());
}
Aggregations