2

I suppose this is more like two questions. Considering i wanted to do some automated testing of a restful web service that is written in c#.

  • How can I using java and something like rest-assured test this API? can I some how mock it to test or do I need to write my automation code in c# in order to do this?

  • Should I deploy the API on to a server e.g IIS and just run tests against the real service, How / when should we be mocking?

Thanks

  • You're testing the web service or the item that calls the webservice? – Paul Muir Jan 9 '18 at 17:50
  • so say I had an API that the frontend was calling but I didn't want to test everything at the GUI layer for example, it may not interact with a third party system so to speak, but im thinking more generally for instances that it might as well, a holistic approach if you will would be ideal – symon Jan 9 '18 at 17:54
  • 1
    Yeah so you wouldn't want to mock the API. You're testing the API itself so if you mocked it you would be testing the mock. – Paul Muir Jan 9 '18 at 18:14
2

How can I using java and something like rest-assured test this API? can I some how mock it to test or do I need to write my automation code in c# in order to do this?

The same way you would with a Java application except it wouldn't be during deploy. The underlying language of the application shouldn't make a difference.

Should I deploy the API on to a server e.g IIS and just run tests against the real service, How / when should we be mocking?

You should mock the API when you are testing the GUI bit not the API. This allows you to create controlled data for the GUI without relying on the API and verifies the GUI independent from the API.

0

C# unittesting + TE (Test Author and Executing Framework) test harness from WDK are most powerful tools I have used.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.