@Test
public void testDoProcessing() throws Exception {

	UserMessage userMessage = new UserMessage();
	userMessage.setMessageId(MessageIdUtils.createMessageId());
	MessageContext mc = new MessageContext();
	mc.setServerSide(true);
	mc.setFLOW(MessageContext.IN_FLOW);
	mc.setAxisService(new AxisService("TEST"));
	EbmsError ebmsError = new EbmsError();
	ebmsError.setSeverity(IEbmsError.Severity.failure);
	ebmsError.setErrorCode("some_error_code");
	ebmsError.setRefToMessageInError(userMessage.getMessageId());
	ebmsError.setMessage("some error message");
	ErrorMessage errorMessage = new ErrorMessage(ebmsError);
	errorMessage.setMessageId(MessageIdUtils.createMessageId());
	errorMessage.setRefToMessageId(userMessage.getMessageId());
	StorageManager storageManager = HolodeckB2BCore.getStorageManager();
	storageManager.storeOutGoingMessageUnit(userMessage);
	IErrorMessageEntity errorMessageEntity = storageManager.storeIncomingMessageUnit(errorMessage);
	storageManager.setProcessingState(errorMessageEntity, ProcessingState.RECEIVED);
	IMessageProcessingContext procCtx = MessageProcessingContext.getFromMessageContext(mc);
	procCtx.addReceivedError(errorMessageEntity);
	try {
		Handler.InvocationResponse invokeResp = handler.invoke(mc);
		assertEquals(Handler.InvocationResponse.CONTINUE, invokeResp);
	} catch (Exception e) {
		fail(e.getMessage());
	}
	assertEquals(ProcessingState.FAILURE,
			HolodeckB2BCoreInterface.getQueryManager().getMessageUnitsWithId(userMessage.getMessageId()).iterator()
					.next().getCurrentProcessingState().getState());
	assertEquals(ProcessingState.READY_FOR_DELIVERY, errorMessageEntity.getCurrentProcessingState().getState());
}