cancel
Showing results for 
Search instead for 
Did you mean: 

Coordinate responses of multiple mocks

Highlighted
Occasional Contributor

Coordinate responses of multiple mocks

Hi,

I need to coordinate the responses of two or more mocks.  One service provides planned vehicle route information and one or more other services provide "real-time" vehicle positions after the vehicle begins traveling from its departure to arrival location.  I've thought about implementing a "coordinator" service that the others communicate with, but it isn't clear how I would discover the coordinator service's endpoint since we run these mocks both in SoapUI proper and in Tomcat.

 

Any ideas would be greatly appreciated.

Thanks

Scott

 

9 REPLIES 9
Highlighted
Moderator

Hi @ScottUFR,

Thanks for reaching out.

 

Community, can anyone assist Scott here please? Maybe has anyone faced a similar task?

 

Thank you in advance,


Olga Terentieva
SmartBear Assistant Community Manager

Highlighted
Community Hero

Hi Scott,

 

I am not sure I got the actual case...

By definition, (most of) web communication is stateless and HTTP is based on the request-response design.

The above means that web client and web server are required for the HTTP session and it is client who sends requests to the server and server responds to the request. As communication is stateless, this means that no coordination is needed.

Your scenario assumes two pairs of clients and servers. First client requests route from the server and the second client requests vehicle's position.

Web servers (and your mocks mimic web servers while they are absent) should not (and, usually, cannot) monitor whether the route for some vehicle was provided in order to start/allow provide coordinates for this given vehicle. If required, this must be a functionality of some intermediate back-end layer and I am not sure that you must implement its functionality. (As you are imitating web servers and their task is to provide the client with the route and current coordinates.)

 

Did I miss something essential in your scenario? What actual coordination you assumed?

 

P.S. Something that seems to be interesting and might appear to be relevant: https://restfulapi.net/hateoas/

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Highlighted
Occasional Contributor

I'll try to clarify my scenario.

 

A vehicle's route is planned by a user to occur at a particular time and submitted.  When that vehicle is enroute, it's location is uploaded.  A client requests the planned route from one service and requests enroute locations from a second service.

 

The planned route service's mock modifies a template response with times that are a short time in the future.  The enroute track service's mock needs to modify it's templated responses to be within the the window defined by the planned route service's mock.  This is the coordination I'm looking for.

 

Scott

 

Highlighted
Community Hero

Hi,

 

OK... How these services are expected to coordinate in the real life?

 

> times that are a short time in the future.

Just curious, whether these services are expected to be used within the same time zone? What if the route starts in one time zone and end in another one?

 

Meanwhile, if both mocks are implemented within the same SoapUI project, why not to create a custom project property and use it for coordination?

 

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Highlighted
Occasional Contributor

Coordination in real life is a matter of process.  A vehicle doesn't report its current position until it is enroute sometime after its planned time of departure.

 

All times are UTC.

 

The mocks are developed in a single SoapUI project, but are deployed as .war files during testing.  Is it possible to deploy the project as a .war file?

Highlighted
Community Hero

Hi,

 

> Is it possible to deploy the project as a .war file?

I believe that yes it is: https://www.soapui.org/soap-mocking/deploying-mock-services-as-war-files.html

 

> Coordination in real life is a matter of process. [...]

Sounds unreliable (what if the first service is out of order? Does this mean that the second service will not be contacted/will not provide information until the first one is back to service?), but this seems to be irrelevant...

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Highlighted
Occasional Contributor

I am already able to deploy individual mocks as .war files.  I misinterpreted your comment about project variables that they were shareable between mocks, not used within a mock.

 

Yes, that is irrelevant.

 

Highlighted
Community Hero

Hi,

 

> I am already able to deploy individual mocks as .war files.

Despite link address, the referenced article talks about project deployment.

 

> shareable between mocks, not used within a mock.

Actually, the idea was to share betweek mocks and use within them to set/get coordination data.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Highlighted
Moderator

Hi everyone,

 

@AlexKaras, many thanks for your time looking into this! I sincerely appreciate your assistance.

 

@ScottUFR, has the situation cleared up? Can the topic be marked as solved?

I'm looking forward to your reply,

 


Olga Terentieva
SmartBear Assistant Community Manager

New Here?
Join us and watch the welcome video:
Announcements
TechCorner Leaderboard
Want a fun and easy way to learn ReadyAPI and show off your skills? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Get a full Raw JMS request

Participate!

Compare an expected JSON value and actual response in Events

Participate!

Fetch value/data from JSON response using Groovy Script

See replies!

Get data from Petstore and add it to Excel sheets

Participate!
Top Kudoed Authors