REST Service Mocking

Source: Internet
Author: User

Rest Service mocks

The Rest Service impersonation feature allows you to create a rest service simulator- mockservice .

Benefits

Restmockservices can be used for example:

  • prototyping of Web Services --Generate a complete static simulation execution from the request in a few seconds. This allows you to implement and test the client faster than you need to wait for the actual solution build.
  • Client testing/development --Create the actions required by the simulation implementation and set up many alternative responses (including scripts, attachments, and custom HTTP headers). The client can be developed for mockservice and tested without getting a real service. Responses can be randomly or in a selected XPath expression for incoming requests
  • test-driven development --Create functional and load tests for mockservice or before actual service implementations

Mockservices adhere to the standards that clients can use as if they were real services.

Script

The mockservices can be further expanded by scripting more dynamically. By adding a script, you can simulate any expected behavior, including (but not limited to) dynamic results, random errors, fixed response variables, and so on.

Mockservice Model

Mockservices provides analog services to expose any number ofmockactions In turn, each can contain any number ofmockresponse :

    • mockservice
      • mockaction
        • mockresponses

Mockservice looks like this:

in this example, Mockservice contains two Action , a Get and post. If we open the post operation, we can seereaction It contains:

show method and Resource Path  , list of all mockresponses .  dispatch--"sequence "In this case, it indicates that when Mockservice receives a request, the response will be used once, in the order listed, from the beginning to the end, and then restarted.

Look at the reaction of "success":

 Mockresponse will return the request contains configuration information: a HTTP status Code any custom Header information, Body Response .

REST Service Mocking

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.