Hey @costas80,
I could use some guidance.
I have a test case where I want to simulate a server. The idea is that the SUT should only need to change its endpoint from the real-life endpoint to the mocked/simulated test bed endpoint, and then run as it normally would.
During the test, I expect the SUT to call this endpoint three times. These calls must happen in a specific order, as shown here:
The issue is that I currently have the steps placed in separate threads. This causes some steps to start out of order. For example, the “Send SBDH Ack” step is a SimulatedMessaging step, and it completes automatically. As a result, the diagram becomes confusing, and the intended messaging flow appears out of order.
One option would be to put everything into a single thread, like this pseudocode:
<receive id="1" from="SUT" to="simulatedServer">
<input name="uri">"same_URI_All_Three_Requests"</input>
</receive>
<verify desc="verify the SUT request 1"/>
<send desc="Simulate the messaging flow" from="SUT" to="SomeOtherActor" handler="SimulatedMessaging"/>
<receive id="2" from="SUT" to="simulatedServer">
<input name="uri">"same_URI_All_Three_Requests"</input>
</receive>
<send desc="Simulate the messaging flow" from="SUT" to="SomeOtherActor" handler="SimulatedMessaging"/>
<verify desc="verify the SUT request 2"/>
<receive id="3" from="SUT" to="simulatedServer">
<input name="uri">"same_URI_All_Three_Requests"</input>
</receive>
<verify desc="verify the SUT request 3"/>
However, I am concerned that the SUT and the test engine could get out of sync. For example, while the second receive step is being started, the SUT may already have sent the second request.
What is the best way to handle this?
I was considering building some kind of custom server with a queueing mechanism, which would hold the incoming requests and forward them to the ITB once it is ready to receive them. However, that feels like quite a lot of work and complexity, so I was hoping there might be a simpler approach.
Hey @costas80,
I could use some guidance.
I have a test case where I want to simulate a server. The idea is that the SUT should only need to change its endpoint from the real-life endpoint to the mocked/simulated test bed endpoint, and then run as it normally would.
During the test, I expect the SUT to call this endpoint three times. These calls must happen in a specific order, as shown here:
The issue is that I currently have the steps placed in separate threads. This causes some steps to start out of order. For example, the “Send SBDH Ack” step is a SimulatedMessaging step, and it completes automatically. As a result, the diagram becomes confusing, and the intended messaging flow appears out of order.
One option would be to put everything into a single thread, like this pseudocode:
However, I am concerned that the SUT and the test engine could get out of sync. For example, while the second receive step is being started, the SUT may already have sent the second request.
What is the best way to handle this?
I was considering building some kind of custom server with a queueing mechanism, which would hold the incoming requests and forward them to the ITB once it is ready to receive them. However, that feels like quite a lot of work and complexity, so I was hoping there might be a simpler approach.