CheckSentResult extends AbstractBaseHandler { @Override protected InvocationResponse doProcessing(final IMessageProcessingContext procCtx, final Logger log) throws PersistenceException { final StorageManager updateManager = HolodeckB2BCore.getStorageManager(); final Collection<IMessageUnitEntity> msgUnits = procCtx.getSendingMessageUnits(); for (final IMessageUnitEntity mu : msgUnits) { updateManager.setProcessingState(mu, ProcessingState.SENDING); log.info(MessageUnitUtils.getMessageUnitName(mu) + " with msg-id [" + mu.getMessageId() + "] is being sent"); } return InvocationResponse.CONTINUE; }  @Override void doFlowComplete(final IMessageProcessingContext procCtx, final Logger log);  }
@Test public void testDoProcessing() throws Exception { MessageContext mc = new MessageContext(); mc.setFLOW(MessageContext.OUT_FLOW); IMessageProcessingContext procCtx = MessageProcessingContext.getFromMessageContext(mc); PMode pmode = TestUtils.create1WaySendPushPMode(); HolodeckB2BCore.getPModeSet().add(pmode); StorageManager storageManager = HolodeckB2BCore.getStorageManager(); UserMessage usrMessage = new UserMessage(); usrMessage.setPModeId(pmode.getId()); IUserMessageEntity userMessageEntity = storageManager.storeOutGoingMessageUnit(usrMessage); procCtx.setUserMessage(userMessageEntity); try { Handler.InvocationResponse invokeResp = new CheckSentResult().invoke(mc); assertEquals(Handler.InvocationResponse.CONTINUE, invokeResp); } catch (Exception e) { fail(e.getMessage()); } assertEquals(ProcessingState.SENDING, userMessageEntity.getCurrentProcessingState().getState()); }