Does castlemock have support for XPATH math functions?
See original GitHub issueHello, folks,
I have been using Castlemock for a while, but only yesterday I felt the need to validate a xpath by a math function. I’m trying to validate if the system is sending a valid SOAP requisition to CastleMock. The system has to send a list of products, each one of them with an attribute called ValorTotal, as you can see below:
<Produtos>
<!--Zero or more repetitions:-->
<Produto>
<!--Optional:-->
<Codigo>1</Codigo>
<Quantidade>5</Quantidade>
<ValorTotal>0.50</ValorTotal>
</Produto>
<Produto>
<!--Optional:-->
<Codigo>2</Codigo>
<Quantidade>1</Quantidade>
<ValorTotal>0.50</ValorTotal>
</Produto>
<Produto>
<!--Optional:-->
<Codigo>3</Codigo>
<Quantidade>1</Quantidade>
<ValorTotal>0.50</ValorTotal>
</Produto>
</Produtos>
In this case, I have to verify if the system is sending the list correctly. In order to do this, I tried to verify the sum of the values of all attributes called ValorTotal. Firstly, I validated the expression on Xpather, so I did as it follows:
You can see that it works, but putting this on castlemock XPath it simply doesn’t work. It doesn’t recognise the expression, so castlemock returns http code 500 (there’s no default response).
I want to know if math functions are recognised by the castlemock Xpath, and if they are, what am I doing wrong?
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Top GitHub Comments
Hi again @wedla. Publishing images to Docker hub now works again. The latest version is now available on Docker hub.
Hi @wedla. Thank you for creating this issue. This hasn’t been supported before, but I have now added support for this. I will include this in the next release. I can have the next release ready in a couple of days. Does that work for you?
Thanks! Best regards