Developers or testers need to call online services to debug the services or query online data during the development process. The service testing feature of Enterprise Distributed Application Service (EDAS) allows you to set parameters in the console to initiate service calls and view the results.
Background information
- The service testing feature is in public preview. You can use this feature free of charge.
- If you want to test a service as a RAM user, you must first grant the permissions to test services to the RAM user in the RAM console. For more information, see Configure permissions for service testing in the RAM console.
Procedure
Verify the result
In the Result section, you can check whether the test is successful. The following list describes the types of test results:
- The test fails. The system displays an error message indicating that the instance for the test is being prepared and you need to try again later. After you start a test, wait 30 to 50 seconds until the instance for the test is initiated.
- The test fails. The system displays an error message. You can troubleshoot issues in the port, network, and code of the service based on the error message that is returned.
- The test succeeds. A response is returned.
Examples of parameter settings
You must specify parameter settings for the method to test in the form of a JSON array. The following table provides examples of parameter settings for different parameter types.
| Parameter type | Sample parameter settings | Remarks |
|---|---|---|
| (java.lang.String, int) | ["test", 100] | N/A |
| (java.util.List, int) | [["hello", "world"], 100] | N/A |
| (java.util.Map, java.lang.List) | [{"test": true}, ["hello", "world]] | N/A |
| (java.util.Map, com.test.User) | [{"test": true}, {"id": 1, "name": "jack"}] | com.test.User is a custom parameter type. In this example, the id and name parameters of this type are used. |