@Test
public void testDoProcessing() throws Exception {

	MessageContext mc = new MessageContext();
	mc.setFLOW(MessageContext.OUT_FLOW);
	// Envelope is needed to add body payload
	try {
		mc.setEnvelope(SOAPEnv.createEnvelope(SOAPEnv.SOAPVersion.SOAP_12));
	} catch (AxisFault axisFault) {
		fail(axisFault.getMessage());
	}
	UserMessage userMessage = new UserMessage();
	userMessage.setMessageId("payload-adder-01");
	// Programmatically added attachment payload
	Payload payload = new Payload();
	payload.setContainment(IPayload.Containment.ATTACHMENT);
	String payloadURI = "some_URI_01";
	payload.setPayloadURI(payloadURI);
	payload.setContentLocation(baseDir + "/flower.jpg");
	userMessage.addPayload(payload);
	// Programmatically added body payload
	payload = new Payload();
	payload.setContainment(IPayload.Containment.BODY);
	payload.setPayloadURI("some_URI_03");
	payload.setContentLocation(baseDir + "/document.xml");
	userMessage.addPayload(payload);
	// Setting input message property
	IUserMessageEntity userMessageEntity = HolodeckB2BCore.getStorageManager()
															.storeIncomingMessageUnit(userMessage);
	
	IMessageProcessingContext procCtx = MessageProcessingContext.getFromMessageContext(mc);
	procCtx.setUserMessage(userMessageEntity);
	try {
		new AddPayloads().invoke(mc);			
	} catch (Exception e) {
		fail(e.getMessage());
	}
	assertNotNull(mc.getAttachmentMap());
	assertEquals(1, mc.getAttachmentMap().getAllContentIDs().length);
	
	assertNotNull(mc.getEnvelope().getBody().getFirstElement());
	assertEquals("document", mc.getEnvelope().getBody().getFirstElement().getLocalName());
}