I need to run Munit 2 and application simultaneously in Anypoint Studio.
Here is the flow:
We have two applications (Project) A and B. Application A contains http listener endpoint flow fA1. When data is received here, it sends transformed JSON data to a third party, name it X.
Now, suppose I have flow fB1 in application B, which contains a http listener endpoint, this endpoint(Flow fB1) receive JSON notifications from X. Flow fB1 does some processing based on that, and transforms it into another JSON format. That format is sent to application A.
Now, application A receives data at http listener endpoint flow fA2, and does some processing based on that.
So the whole flow is A -> X -> B -> A
Here is the problem: I am writing Munit for this whole flow. At point 1, I mentioned we send data to application X from A and X sends data B. But B application is down because Anypoint doesn't allow both Munit and the application to run simultaneously, so I'm not able to receive data from X. To make it work, I have to copy the whole logic of application B in Munit of application and mock notification. Is their any workaround, to avoid copying code from app B to Munit of app A? I tried parallel deployment, but it didn't work at all.
Kindly guide if any one of you got a solution or pointers.