// add a pre-processing action
MockAction preProcessingAction = new MockAction();
processorService.addPreProcessingAction(preProcessingAction);
// add another pre-processing action that changes the message
processorService.addPreProcessingAction(new Action() {
@Override
public void execute(Message message) throws Exception {
Message smsMessage = (Message) message;
smsMessage.setProperty("from", "1234");
}
});
// add a post-processing action
MockAction postProcessingAction = new MockAction();
processorService.addPostProcessingAction(postProcessingAction);
// add another post-processing action that changes the message
processorService.addPostProcessingAction(new Action() {
@Override
public void execute(Message message) throws Exception {
Message smsMessage = (Message) message;
smsMessage.setProperty("to", "1111");