Unlock instant, AI-driven research and patent intelligence for your innovation.

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.

Active Publication Date: 2022-04-29
INTERNET DOMAIN NAME SYST BEIJING ENG RES CENT
View PDF11 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

But in practice, some business scenarios are not easy to construct. It would be a perfect solution to simulate the corresponding scenarios. Therefore, there is a demand for simulating interface responses.
[0004] On the other hand, limited by the different schedules of front-end and back-end development
Sometimes the business logic of the back-end interface has not yet been developed, but the front-end needs to use the interface urgently

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for realizing Restful interface simulation test service based on Netty
  • Method and device for realizing Restful interface simulation test service based on Netty
  • Method and device for realizing Restful interface simulation test service based on Netty

Examples

Experimental program
Comparison scheme
Effect test

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...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a method and a device for realizing a Restful interface simulation test service based on Netty, and computer equipment. The method comprises the steps that a simulation test server receives an interface calling request from a front end; performing matching detection of a request path and a request parameter on the interface calling request to enable the interface calling request to meet business code logic required by a back end; after the interface calling request is confirmed to be legal, performing interface response processing; and the Netty server sends the processed response result to the front end. According to the method provided by the invention, the front-end and back-end service development efficiency and the complete coverage test requirement of the service scene are improved.

Description

technical field [0001] The present application relates to the technical field of web development, in particular to a method, device, computer equipment and storage medium for implementing a Restful interface simulation test service based on Netty. Background technique [0002] With the development of the times, modern web applications have become more and more complex. Correspondingly, more manpower will be invested in development. In order to better support the needs of large-scale collaborative development. People have proposed a development model that separates the front and back ends. Thus, developers are divided into: front-end and back-end, two relatively independent development teams. The general mode is that the front end completes the corresponding function by calling the interface provided by the back end. After the front-end and back-end define relevant interfaces, the independent development of the front-end and back-end can be realized, and the development r...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F11/36
CPCG06F11/3676G06F11/3684G06F11/3688
Inventor 郭汉磊高雷卢文哲邢志杰毛伟
Owner INTERNET DOMAIN NAME SYST BEIJING ENG RES CENT