@Test
public void testDoProcessing() throws Exception {

    MessageContext mc = new MessageContext();
    mc.setFLOW(MessageContext.IN_FLOW);
    UserMessage userMessage = new UserMessage();
    Payload payload = new Payload();
    payload.setContainment(IPayload.Containment.ATTACHMENT);
    ArrayList<IProperty> props = new ArrayList<>();
    Property p = new Property();
    p.setName(CompressionFeature.FEATURE_PROPERTY_NAME);
    p.setValue(CompressionFeature.COMPRESSED_CONTENT_TYPE);
    props.add(p);
    p = new Property();
    p.setName(CompressionFeature.MIME_TYPE_PROPERTY_NAME);
    p.setValue("image/jpeg");
    props.add(p);
    payload.setProperties(props);
    String payloadPath = "file://./uncompressed.jpg";
    payload.setPayloadURI(payloadPath);
    userMessage.addPayload(payload);
    Attachments attachments = new Attachments();
    attachments.addDataHandler(payloadPath,
            new DataHandler(new URL(payload.getPayloadURI())));
    mc.setAttachmentMap(attachments);
    // Setting input message property
    IUserMessageEntity userMessageEntity = HolodeckB2BCore.getStorageManager().storeIncomingMessageUnit(userMessage);
    IMessageProcessingContext procCtx = MessageProcessingContext.getFromMessageContext(mc);
    procCtx.setUserMessage(userMessageEntity);
    try {
        Handler.InvocationResponse invokeResp = new DecompressionHandler().invoke(mc);
        assertEquals(Handler.InvocationResponse.CONTINUE, invokeResp);
    } catch (Exception e) {
        fail(e.getMessage());
    }
    
    // Check that attachment payload does not contain the compression enabling properties anymore
    final IPayload deCompPayload = userMessageEntity.getPayloads().iterator().next();
    assertEquals(IPayload.Containment.ATTACHMENT, deCompPayload.getContainment());
    Collection<IProperty> properties = deCompPayload.getProperties();
    assertFalse(Utils.isNullOrEmpty(properties)); 
	assertFalse(properties.parallelStream().anyMatch(pp -> 
    										pp.getName().equals(CompressionFeature.FEATURE_PROPERTY_NAME)));
											
    assertTrue(mc.getAttachment(deCompPayload.getPayloadURI()) instanceof CompressionDataHandler);
    assertEquals("image/jpeg", mc.getAttachment(deCompPayload.getPayloadURI()).getContentType());
}