15 years ago
Getting Mock Request Content
I am trying to create a test case that allow sending a web service as well as receiving a web service request. The concept is like a forum: I submit to a topic, whenever a person put something new to the topic, I will get an alert and/or content of the post.
1 - I am able to start my mock service (outside of the test case, but inside the test suite) from the test case's setup script.
2 - In my test case, I am able to create a subscription with destination to my mock service
3 - In my test case, I am able to create a new post.
4 - Mock service inside the test suite receive an alert
5 - In my test case, I am trying to get the following information from the mock service:
a. The number of call back on my mock service: testRunner.testCase.testSuite.project.getMockServiceByName("xx").getMockRunner().getMockresultCount() - it works great
b. The request sent to my mock service: testRunner.testCase.testSuite.project.getMockServiceByName("xx").getMockRunner().getMockResultat(0) - it returns "null".
In my mock service, I could see the request without any issue, so I know it is not null. I want to know if there is a way to get the request from a groovy script? I am using a 3.6.1 Pro.
I am not using the Mock Service Response inside my test case because I need a mock service that could be invoke multiple times throughout the test. At the same time, I have mock service(s) that doesn't get any request at all. Throughout the test, I will have to check every mock service to see if it is triggered, so I will need all of my mock service stay alive until the end of the test.
Any help will be really appreciated.
Danny
1 - I am able to start my mock service (outside of the test case, but inside the test suite) from the test case's setup script.
2 - In my test case, I am able to create a subscription with destination to my mock service
3 - In my test case, I am able to create a new post.
4 - Mock service inside the test suite receive an alert
5 - In my test case, I am trying to get the following information from the mock service:
a. The number of call back on my mock service: testRunner.testCase.testSuite.project.getMockServiceByName("xx").getMockRunner().getMockresultCount() - it works great
b. The request sent to my mock service: testRunner.testCase.testSuite.project.getMockServiceByName("xx").getMockRunner().getMockResultat(0) - it returns "null".
In my mock service, I could see the request without any issue, so I know it is not null. I want to know if there is a way to get the request from a groovy script? I am using a 3.6.1 Pro.
I am not using the Mock Service Response inside my test case because I need a mock service that could be invoke multiple times throughout the test. At the same time, I have mock service(s) that doesn't get any request at all. Throughout the test, I will have to check every mock service to see if it is triggered, so I will need all of my mock service stay alive until the end of the test.
Any help will be really appreciated.
Danny