3

I have an application with a Cron job that makes a REST call every couple of minutes and stores the data in hazelcast instance. It also exposes REST endpoints to provide the processed data from hazelcast instance to client. I want to write integration test case for the same preferably by mocking the REST call in the cron job as it is to a third system. Would need some suggestions or solution recommendations on how to do the same.

Kanika G.
  • 75
  • 6
  • Can you please elaborate on the sequence of events? – CodeRider Dec 03 '19 at 10:08
  • The application has a cron job, that runs every 5 mins, fetches data from a restendpoint (lets say A) and stores the data in hazelcast instance. Another rest endpoint(lets say B) in this application takes data from hazelcast, processes it and sends it. I need to test this rest endpoint B but I should then have some data in hazelcast instance. For that I would need the scheduler to return mock data from the rest endpoint A. Is it understandable now? – Kanika G. Dec 03 '19 at 12:13

1 Answers1

0

You can use jMeter to hit REST endpoint A (say 50 hits in a minute). By that you will get those many set of data in hazelcast instance, and then you can test REST endpoint B as per your need. For testing using jMeter, follow the below link.

https://octoperf.com/blog/2018/04/23/jmeter-rest-api-testing/

Please comment if you need more info.

CodeRider
  • 564
  • 4
  • 15
  • Well I don't want my application to hit real endpoint A. I want to mock this endpoint so it can return a response as I want as this endpoint is not a part of this application. It is just being called by the cron job. – Kanika G. Dec 03 '19 at 16:40