I´m developing a munit test but It is failing, because when it makes a call to another api, it is expecting a new Id, but for the test I cannot make several new Ids, as I understand this is a simulation, that´s why we use mock responses. But is weird, It is not returning the mock responses, instead, it returns the real responses, so it is always gonna fail.
<munit:parameterizations file="postEndPoint/tests.yaml" />
</munit:config>
<munit:test name="post-test-suite" doc:id="deab786d-ee5b-4ba8-96d3-613d4e8de55e" description="Test" expectedErrorType="${errorType}">
<munit:behavior >
<munit-tools:mock-when doc:name="Mock when APIKIT" doc:id="5aa0b2d4-8552-493f-a03f-6b548f45562c" processor="apikit:router">
<munit-tools:with-attributes >
<munit-tools:with-attribute whereValue="${routerConfig}" attributeName="config-ref" />
</munit-tools:with-attributes>
<munit-tools:then-call flow="${callFlow}" />
</munit-tools:mock-when>
<munit-tools:mock-when doc:name="Call Product Sys API" doc:id="e89e50c0-2a20-4ca3-a32b-c715b1f2adcc" processor="${processorOne}">
<munit-tools:with-attributes >
<munit-tools:with-attribute whereValue="${valueName1}" attributeName="doc:name" />
<munit-tools:with-attribute whereValue="${valueId1}" attributeName="doc:id" />
</munit-tools:with-attributes>
<munit-tools:then-return >
<munit-tools:variables >
<munit-tools:variable key="productResponse" value="#[output application/json --- readUrl(p('mockResponse1'),"application/json")]" mediaType="application/json" />
</munit-tools:variables>
</munit-tools:then-return>
</munit-tools:mock-when>
<munit-tools:mock-when doc:name="Call Entitlement sys API" doc:id="6e6964c3-72c4-4d3f-86e9-d0734fb706cf" processor="${processorOne}">
<munit-tools:with-attributes >
<munit-tools:with-attribute whereValue="${valueName2}" attributeName="doc:name" />
<munit-tools:with-attribute whereValue="${valueId2}" attributeName="doc:id" />
</munit-tools:with-attributes>
<munit-tools:then-return >
<munit-tools:payload value="#[output application/json --- readUrl(p('mockResponse2'),"application/json")]" />
<munit-tools:error typeId="${errorType}" />
<munit-tools:variables >
<munit-tools:variable key="updateEntitlementResponse" value="#[output application/json --- readUrl(p('mockResponse2'),"application/json")]" />