Method and device for realizing Restful interface simulation test service based on Netty
A technology that simulates testing and interfaces, applied in the field of web development, can solve problems such as different development schedules between front and back ends, and achieve the effects of improving development efficiency, achieving coverage, and improving robustness.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0038] refer to figure 1 As shown, Embodiment 1 of the present invention provides a method for implementing a Restful interface simulation test service based on Netty, the method is applied to an interface simulation test server, wherein the interface simulation test server is based on the Netty-Server framework as a whole, and abstract Entity components such as request server (RequestExpect), response server (ResponseExpect), Mock class (MockFunction) and so on, the method includes:
[0039] Step S1, the interface simulation test server receives the interface call request from the front end, and matches the interface call request to determine whether it is the preset request content and format.
[0040] Specifically, the request server (RequestExpect) processes the interface call request from the front end, mainly for path matching and parameter matching, and through matching to accurately match the interface call request to the business code logic required by the back-end bu...
Embodiment 2
[0084] Embodiment 2 of the present invention provides a kind of service device that realizes Restful interface simulation test based on Netty, comprising:
[0085] A request processor, configured to receive an interface call request from the front end, and perform path and parameter matching detection on the interface call request, so that the interface call request meets the business code logic required by the back end;
[0086] A response processor, configured to process the interface response according to business requirements and generate a response result after the interface call request is confirmed to be legal;
[0087] The Netty server is used to send the response result to the front end.
[0088] Among them, both the request processor and the response processor provide their own API interfaces, use the API provided by the request processor to write the Mock interface, and use the API provided by the response processor to write the response content corresponding to the...
Embodiment 3
[0091] Embodiment 3 of the present invention provides a kind of computer equipment, and its internal structure diagram can be as follows image 3 shown. The computer device includes a processor, memory and a network interface connected by a system bus. Wherein, the processor of the computer device is used to provide calculation and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used to communicate with other terminals or services through a network connection. When the computer program is executed by the processor, a method for simulating and testing the Restful interface based on Netty is realized. Wherein, the computer device may b...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


