This project is read-only.

Accessing the request retrieved in RequestResponseStep

Sep 19, 2016 at 1:57 PM
Hi,

Small question on Transmock: is there any way we can retrieve the request retrieved by the mock:// adapter in the RequestResponseStep?
Sep 19, 2016 at 1:59 PM
FYI: Reason for my question is that this request can be validated towards an envelope schema, but part of that envelope schema should be validated according to a different XSD. I want to get the original request, retrieve the 'body' part and validate that one according to the other XSD.

Any idea how I would be able to do so?
Dec 19, 2016 at 10:09 PM
Hi Pierken, sorry for the very delayed reply. I think i just have the remedy for this particular challenge of yours. I've just released TransMock version 1.2 and as part of it is a new validation step called LambdaValidationStep. It is a lightweight validation step that allows you to register a callback method in your unit test class where you implement the desired validation logic. This method receives a single parameter of Stream which contains the message as delieverd by the Mock adapter. You can use this stream to apply any desired processing to this stream.

Hope this will help you with your scenario.

Thanks and regards,
Svetoslav
Marked as answer by PierkenAtCodePlex on 12/22/2016 at 5:46 AM
Dec 22, 2016 at 1:47 PM
Thank you very much! I will try this out!