@Test
public void testDoProcessing() throws Exception {

 PMode pmode = TestUtils.create1WaySendPushPMode();        
    Leg leg = pmode.getLeg(Label.REQUEST);
    
    DeliveryConfiguration deliverySpecification = new DeliveryConfiguration();
    deliverySpecification.setFactory(NullDeliveryMethod.class.getName());
    deliverySpecification.setId("delivery_spec_id");
    leg.setDefaultDelivery(deliverySpecification);
    
    ReceiptConfiguration rcptCfg = new ReceiptConfiguration();
    rcptCfg.setNotifyReceiptToBusinessApplication(true);
    leg.setReceiptConfiguration(rcptCfg);
    
    HolodeckB2BCore.getPModeSet().add(pmode);
    UserMessage userMessage = new UserMessage();
    userMessage.setMessageId(MessageIdUtils.createMessageId());
    userMessage.setPModeId(pmode.getId());
    
    MessageContext mc = new MessageContext();
    mc.setFLOW(MessageContext.IN_FLOW);
    Receipt receipt = new Receipt();
    OMElement receiptChildElement = OMAbstractFactory.getOMFactory().createOMElement(RECEIPT_CHILD_ELEMENT_NAME);
    ArrayList<OMElement> content = new ArrayList<>();
    content.add(receiptChildElement);
    receipt.setContent(content);
    receipt.setMessageId(MessageIdUtils.createMessageId());
    receipt.setPModeId(pmode.getId());
    receipt.setRefToMessageId(userMessage.getMessageId());
    StorageManager storageManager = HolodeckB2BCore.getStorageManager();
    IMessageUnitEntity umEntity = storageManager.storeOutGoingMessageUnit(userMessage);        
    
    IReceiptEntity rcptMessageEntity = storageManager.storeIncomingMessageUnit(receipt);        
    storageManager.setProcessingState(rcptMessageEntity, ProcessingState.READY_FOR_DELIVERY);
    
    IMessageProcessingContext procCtx = MessageProcessingContext.getFromMessageContext(mc);
    procCtx.addReceivedReceipt(rcptMessageEntity);        
    
    try {
        assertEquals(Handler.InvocationResponse.CONTINUE, new DeliverReceipts().invoke(mc));
    } catch (Exception e) {
        fail(e.getMessage());
    }
    assertTrue(((NullDeliverer) HolodeckB2BCore.getMessageDeliverer(deliverySpecification))
 		   														  .wasDelivered(receipt.getMessageId()));
    assertEquals(ProcessingState.DONE, rcptMessageEntity.getCurrentProcessingState().getState());
}