CN117240746A - Method, system, equipment and medium for starting baffle based on contract test - Google Patents

Method, system, equipment and medium for starting baffle based on contract test Download PDF

Info

Publication number
CN117240746A
CN117240746A CN202311194450.4A CN202311194450A CN117240746A CN 117240746 A CN117240746 A CN 117240746A CN 202311194450 A CN202311194450 A CN 202311194450A CN 117240746 A CN117240746 A CN 117240746A
Authority
CN
China
Prior art keywords
baffle
interface
information
contract
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311194450.4A
Other languages
Chinese (zh)
Inventor
余庆丹
赵许福
郝美利
吴捷雄
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202311194450.4A priority Critical patent/CN117240746A/en
Publication of CN117240746A publication Critical patent/CN117240746A/en
Pending legal-status Critical Current

Links

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application discloses a baffle starting method, a system, equipment and a medium based on contract testing, which can be applied to the field of Internet of things or the financial field. Firstly, interface information input by a provider is obtained, then, after contract information of a target interface is obtained according to interface basic information of the target interface, baffle scene information and baffle data input by a using method are obtained, the baffle data are checked according to the interface information and the contract information of the target interface, and if the baffle data are checked successfully, baffle service is started so that a user can call the baffle service. In the process, the baffle data can be checked by utilizing the interface information and contract information of the target interface, so that the accuracy of the baffle data can be improved, the opened baffle service not only can enable the interface provider and the interface user to realize parallel development, but also can greatly improve the success rate of system integration.

Description

Method, system, equipment and medium for starting baffle based on contract test
Technical Field
The application relates to the technical field of computers, in particular to a baffle starting method, system, equipment and medium based on contract testing.
Background
With the rapid development of science and technology, business processes are often completed by a plurality of micro-services. Thus, when each micro-service jointly develops a business function, parallel development is an important way to improve efficiency. At present, baffles are used between micro services to simulate the return of an external system, so that parallel development is realized.
At present, most of message data returned by baffle tools are written manually by developers, so that the accuracy of the message data cannot be ensured, and a large risk is easily caused to system service integration.
Disclosure of Invention
The application provides a baffle starting method, a system, equipment and a medium based on contract test, which are used for verifying baffle data through interface information and contract information of a target interface so as to improve the accuracy of the baffle data.
In a first aspect, the present application provides a method for starting a baffle based on contract testing, the method comprising:
acquiring interface information input by a provider, and creating an interface according to the interface information, wherein the interface information comprises interface basic information and interface access parameter information;
acquiring contract information of the target interface according to the interface basic information of the target interface, wherein the contract information comprises the contract basic information and contract access parameter information;
acquiring baffle scene information and baffle data input by a user, and checking the baffle data according to interface information of a target interface and contract information of the target interface;
and if the baffle data check passes, starting the baffle service so that the user can call the baffle service.
Optionally, obtaining contract information of the target interface according to the interface basic information of the target interface includes:
responding to the operation of selecting an interface, and obtaining interface basic information of a target interface;
acquiring use information and contract access parameter information input by a user;
and acquiring contract basic information according to the interface basic information of the target interface and the use information.
Optionally, verifying the baffle data according to the interface information of the target interface and contract information of the target interface includes:
and checking the baffle data according to the interface access parameter information of the target interface and contract access parameter information of the target interface.
Optionally, if the barrier data check passes, starting a barrier service, including:
if the baffle data passes the verification, generating a code file of the service request according to the interface information of the target interface, contract information of the target interface, baffle scene information and the baffle data;
and starting the baffle service according to the code file of the service request.
Optionally, the method further comprises:
if the baffle data check is not passed, displaying data errors on a visual interface so as to prompt a user to re-input new baffle data.
Optionally, after the baffle service is started, before the user invokes the baffle service, the method further includes:
responding to the baffle test operation, and sending a request message to a baffle service;
and receiving and verifying the response message generated by the baffle service.
In a second aspect, the present application provides a contract test based baffle activation system comprising: interface management module, contract management module and baffle management module.
The interface management module is used for acquiring interface information input by a provider and creating an interface according to the interface information, wherein the interface information comprises interface basic information and interface access parameter information;
the contract management module is used for obtaining contract information of the target interface according to the interface basic information of the target interface, wherein the contract information comprises the contract basic information and contract access parameter information;
the baffle management module is used for acquiring baffle scene information and baffle data input by a user and checking the baffle data, wherein the baffle data comprises baffle basic information and baffle access parameter information;
and the baffle management module is also used for starting the baffle service if the baffle data check is successful so that the user can call the baffle service.
Optionally, the contract management module is specifically configured to:
responding to the operation of selecting an interface, and obtaining interface basic information of a target interface;
acquiring use information and contract access parameter information input by a user;
and acquiring contract basic information according to the interface basic information and the use information of the target interface.
Optionally, the baffle management module is specifically configured to:
and checking the baffle data according to the interface access parameter information of the target interface and contract access parameter information of the target interface.
Optionally, the baffle management module is specifically configured to:
if the baffle data passes the verification, generating a code file of the service request according to the interface information of the target interface, contract information of the target interface, baffle scene information and baffle data;
and starting the baffle service according to the code file of the service request.
Optionally, the baffle management module is further configured to:
if the baffle data check is not passed, displaying data errors on a visual interface so as to prompt a user to re-input new baffle data.
Optionally, the baffle management module is further configured to:
responding to the baffle test operation, and sending a request message to a baffle service;
and receiving and verifying the response message generated by the baffle service.
In a third aspect, the present application provides an electronic device comprising a memory and a processor:
the memory is used for storing a computer program;
the processor is configured to perform the method provided in the first aspect above according to a computer program.
In a fourth aspect, the present application provides a computer readable storage medium for storing a computer program for performing the method provided in the first aspect above.
From this, the application has the following beneficial effects:
the application provides a baffle starting method, a system, equipment and a medium based on contract test, which are characterized in that firstly interface information input by a provider is acquired, an interface is created based on the interface information, then after contract information of a target interface is acquired according to the interface information of the target interface, baffle scene information and baffle data input by a using method are acquired, the baffle data are checked according to the interface information and the contract information of the target interface, and if the baffle data are checked successfully, baffle service is started, so that a user can call the baffle service. In the process, because the interface information and contract information of the target interface are formulated together by the provider and the user, the baffle data can be checked by utilizing the interface information and contract information of the target interface, so that the accuracy of the baffle data can be improved, the opened baffle service not only can enable the interface provider and the interface user to realize parallel development, but also can greatly improve the success rate of system integration.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments described in the present application, and other drawings may be obtained according to these drawings for those of ordinary skill in the art.
FIG. 1 is a schematic flow chart of a method for starting a baffle based on contract testing in an embodiment of the application;
fig. 2 is a schematic diagram of a manual input interface in a method for starting a baffle based on contract testing in an embodiment of the present application;
FIG. 3 is a schematic diagram of a detailed information interface of a micro-service contract in a method for starting a baffle based on contract testing according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a detailed information interface of a baffle in a baffle starting method based on contract testing according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a baffle test interface in a baffle start method based on contract testing according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a baffle start system based on contract testing according to an embodiment of the present application;
FIG. 7 is a flow chart of an embodiment of a method for starting a baffle based on contract testing according to an embodiment of the present application;
FIG. 8 is a schematic structural diagram of a baffle plate starting device based on contract testing according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data need to comply with the related laws and regulations and standards of the related country and region.
The baffle starting method, system, equipment and medium based on contract testing provided by the application can be applied to the field of Internet of things or the financial field. The foregoing is merely an example, and the application fields of the method, the system, the device and the medium for starting the baffle based on contract testing provided by the application are not limited.
At present, all baffle tools on the market are manually written by a user using an interface to request for a Mock service and return a json file to return, and the baffle data completely depend on understanding of the interface document by a developer of the user of the interface, so that the accuracy of the baffle data cannot be ensured.
In the embodiment of the application, the baffle data is checked through the interface information and contract information of the target interface, and when the baffle data is checked, the baffle service is started so that a user can call the baffle service. In particular implementations, the method may include, for example: firstly, interface information input by a provider is acquired, then, after contract information of a target interface is acquired according to interface basic information of the target interface, baffle scene information and baffle data input by a using method are acquired, the baffle data are checked according to the interface information and the contract information of the target interface, and if the baffle data are checked successfully, baffle service is started according to the interface information of the target interface, the contract information of the target interface, the baffle scene information and the baffle data.
Therefore, the method provided by the embodiment of the application can utilize the interface information and contract information of the target interface to check the baffle data, so that the accuracy of the baffle data can be improved, the opened baffle service not only can enable the interface provider and the interface user to realize parallel development, but also can greatly improve the success rate of system integration.
In order to facilitate understanding of a specific implementation of a method for starting a baffle based on contract testing according to an embodiment of the present application, the following description will be given with reference to the accompanying drawings.
It should be noted that, the main body implementing the method for starting the baffle based on the contract test may be a baffle starting system based on the contract test provided by the embodiment of the present application, or may be a baffle starting device based on the contract test provided by the embodiment of the present application, where the baffle starting device based on the contract test may be carried in an electronic device or a functional module of the electronic device. The electronic device in the embodiment of the present application may be any device capable of implementing a contract-test-based baffle start method in the embodiment of the present application, for example, may be an internet of things (Internet ofThings, ioT) device.
Fig. 1 is a schematic flow chart of a method for starting a baffle based on contract testing according to an embodiment of the present application. The method may be applied to a contract test based baffle start system, such as the contract test based baffle start system 600 shown in fig. 6; the method may also be applied to a contract-test-based baffle activation device, which may be, for example, a contract-test-based baffle activation device 800 as shown in fig. 8, or may be a functional module integrated into the electronic device 900 shown in fig. 9.
As shown in fig. 1, the method includes the following S101 to S104:
s101: and acquiring interface information input by the provider, and creating an interface according to the interface information, wherein the interface information comprises interface basic information and interface access parameter information.
In order to obtain the visual contract verification result, firstly, interface information input by a provider is required to be obtained, an interface is created according to the interface information, then, after contract information of a target interface is obtained, baffle scene information and baffle data input by the provider are obtained, the baffle data are verified according to the interface information and the contract information of the target interface, and finally, if the baffle data are verified, a baffle service is started so that a user can call the baffle service. Therefore, the embodiment of the application acquires the interface information input by the provider through S101, creates an interface according to the interface information, and provides a precondition for acquiring contract information of the target interface.
As one example, S101 may include: firstly, interface information input by a provider on a visual interface is acquired, and then an interface is created according to the interface information. The interface information comprises interface basic information and interface access parameter information, wherein the interface basic information comprises: version lot, provider module name, method description, user list, URL, request method, change description, application system number, service ID, service version number, service type, interface code, service number, service name, and remark field; the interface access parameter information comprises: the name, type, length, description, data item number, interface must input, whether fields are sensitive, remarks, constraint relationships, interface constraints, operations of each field. The visual interface for specific provider input interface information may refer to the manual entry interface shown in fig. 2. It should be noted that, version batch, provider module name, method name and URL in the basic information of the interface are the necessary filling information, and other information belongs to the unnecessary filling information.
S102: and acquiring contract information of the target interface according to the interface basic information of the target interface, wherein the contract information comprises the contract basic information and contract access parameter information.
As one example, S102 may include: s1021, responding to the interface selection operation of a user on the visual interface, and obtaining the interface basic information of the target interface; s1022, obtaining use information and contract access parameter information which can be input by a user on a visual interface, wherein the use information comprises: the contract access parameter information comprises the following components of a user, a user module name, a scene name, an application system number, a service ID (identity), a service version number: the contract must be input, the constraint relation and the contract constraint. The user, the user module name and the scene name in the use information belong to the necessary filling information, and other information belongs to the unnecessary filling information; s1023, acquiring contract basic information according to interface basic information and use information of the target interface, wherein the contract basic information comprises: version lot, provider, user module name, method description, URL, request method, scene name, application system number, service ID, service version number. And finally, acquiring contract basic information and contract access parameter information which are contract information of the target interface. The visual interface for inputting the usage information and contract entry and exit information by the specific user can refer to the micro-service contract detailed information interface shown in fig. 3.
S103: and acquiring baffle scene information and baffle data input by a user, and checking the baffle data according to interface information of the target interface and contract information of the target interface.
As one example, S103 may include: firstly, acquiring baffle scene information and baffle data which can be input by a user at a visual interface; and then checking the baffle data according to the interface input-output parameter information of the target interface and the contract input-output parameter information of the target interface. The interface input and output parameter information for checking the baffle data comprises: interface must input and interface constraint these two constraint conditions; the contract input and output parameter information for verifying the baffle data comprises the following steps: the contract must defeat and the contract constrains the two constraints. Therefore, the baffle data is verified according to the four constraint conditions of interface must input, interface constraint, contract must input and contract constraint. The specific visual interface for inputting the baffle scene information and the baffle data by the user may refer to the baffle detailed information interface shown in fig. 4, and it should be noted that, except for the baffle scene information which needs to be input by the user, the baffle basic information in the baffle detailed information interface is the interface basic information and the contract basic information which are automatically filled in after the corresponding interface and contract are selected. Similarly, the baffle parameter information in the baffle detailed information interface is baffle data which needs to be input by a user, and other information is interface parameter information and contract parameter information which are automatically filled after the corresponding interface and contract are selected.
In the process, constraint conditions are formulated by the provider and the user together to check the baffle data, so that the accuracy of the baffle data can be improved, and the success rate of system integration can be improved.
S104: and if the baffle data check passes, starting the baffle service so that the user can call the baffle service.
As one example, S104 may include: if the baffle data passes the verification, a code file, such as a json file, of the service request can be generated according to the interface information of the target interface, the contract information of the target interface, the baffle scene information and the baffle data; and starting baffle service according to the code file of the service request. In the process, the accuracy of the baffle data passing the verification is higher, so that the coded file of the service request can be automatically generated according to the baffle data and the data input before, and the baffle service can be automatically started according to the coded file of the service request.
In addition, if the baffle data is not checked, the baffle data cannot be stored, a data error is displayed on a visual interface, a user is prompted to input new baffle data again, and checking is performed again until the check is passed. In the process, a visual interface is used for prompting that baffle data input by a user baffle is wrong, and new baffle data is required to be input again.
In addition, after the baffle service is started, before the user invokes the baffle service, a baffle test may be performed on the baffle service, where the step of the baffle test includes: and responding to the baffle test operation, and after sending a request message to the baffle service, receiving and verifying a response message generated by the baffle service. Wherein, the verification process comprises: firstly, verifying whether the baffle service can normally generate a response message, and if so, verifying whether the response message returned by the baffle service accords with the maintained data. The visual interface for a particular baffle test operation may refer to the baffle test interface shown in fig. 5. In this process, before the user invokes the baffle service, the baffle service is tested, and the availability of the baffle service is checked, thereby providing the availability of the baffle service.
It can be seen that, in the embodiment of the application, by acquiring interface information input by a provider, acquiring contract information of a target interface according to interface basic information of the target interface, acquiring baffle scene information and baffle data input by a using method, checking the baffle data according to the interface information and the contract information of the target interface, and if the baffle data is checked successfully, starting baffle service according to the interface information of the target interface, the contract information of the target interface, the baffle scene information and the baffle data. In the process, the baffle data can be checked by utilizing the interface information and contract information of the target interface, so that the accuracy of the baffle data can be improved, the opened baffle service not only can enable the interface provider and the interface user to realize parallel development, but also can greatly improve the success rate of system integration.
The system according to the embodiment of the present application may refer to, for example, a baffle start system 600 based on contract test shown in fig. 6, and may include, for example: an interface management module 601, a contract management module 602, and a baffle management module 603.
The interface management module 601 is configured to obtain interface information input by a provider, and create an interface according to the interface information, where the interface information includes interface basic information and interface access parameter information;
the contract management module 602 is configured to obtain contract information of the target interface according to interface basic information of the target interface, where the contract information includes contract basic information and contract access parameter information;
the baffle management module 603 is configured to obtain baffle scene information and baffle data input by a user, and verify the baffle data, where the baffle data includes baffle basic information and baffle access parameter information;
the barrier management module 603 is further configured to start the barrier service if the barrier data check is successful, so that the user invokes the barrier service.
Optionally, the contract management module 602 is specifically configured to:
responding to the operation of selecting an interface, and obtaining interface basic information of a target interface;
acquiring use information and contract access parameter information input by a user;
and acquiring contract basic information according to the interface basic information and the use information of the target interface.
Optionally, the baffle management module 603 is specifically configured to:
and checking the baffle data according to the interface access parameter information of the target interface and contract access parameter information of the target interface.
Optionally, the baffle management module 603 is specifically configured to:
if the baffle data passes the verification, generating a code file of the service request according to the interface information of the target interface, contract information of the target interface, baffle scene information and baffle data;
and starting the baffle service according to the code file of the service request.
Optionally, the baffle management module 603 is further configured to:
if the baffle data check is not passed, displaying data errors on a visual interface so as to prompt a user to re-input new baffle data.
Optionally, the baffle management module 603 is further configured to:
responding to the baffle test operation, and sending a request message to a baffle service;
and receiving and verifying the response message generated by the baffle service.
In order to make the method provided by the embodiment of the present application clearer and easier to understand, a specific example of the method applied to a compact test-based baffle start system 600 shown in fig. 6 will be described with reference to fig. 7.
As shown in fig. 7, this embodiment may include:
s701: the interface management module 601 obtains interface information input by a provider, and creates an interface according to the interface information, wherein the interface information comprises interface basic information and interface access parameter information.
S702: the contract management module 602 obtains interface basic information of the target interface in response to the interface selection operation.
As one example, S702 may include: since contract testing is only performed for one interface, a user is required to select a target interface first and perform contract testing on the target interface. After the target interface is selected, the interface basic information of the target interface is automatically obtained.
S703: the contract management module 602 obtains usage information and contract entry and exit parameter information entered by the user.
As one example, S703 may include: the contract management module 602 further obtains the usage information and contract entry and exit parameter information input by the user after obtaining the interface basic information of the target interface. The interface basic information and the use information of the target interface are combined to obtain contract basic information of the target interface.
S704: the barrier management module 603 acquires barrier scene information and barrier data input by the user.
S705: the barrier management module 603 checks the barrier data according to the interface access parameter information of the target interface and contract access parameter information of the target interface.
As one example, S705 may include: the baffle management module 603 needs to verify the input baffle data according to the interface access parameter information of the target interface and the contract access parameter information of the target interface, for example: when the interface in the interface access parameter information is required to be input as yes, the interface constraint is required to be input as no and the contract constraint is required to be input as value (A), if the input baffle data is A, the baffle data check is passed, and if the input baffle data is not A, the baffle data check is not passed. In the process, the baffle data are restrained through contracts which are jointly formulated and complied by the interface provider and the user, so that the accuracy of the baffle data can be improved.
In addition, multiple groups of baffle data can be input at one time by clicking a new baffle button in the visual interface for multiple times, so that the workload of a user for inputting the baffle data is reduced.
S706: if the barrier data passes the verification, the barrier management module 603 generates an encoded file of the service request according to the interface information of the target interface, the contract information of the target interface, the barrier scene information and the barrier data.
As one example, S706 may include: if the barrier data passes the verification, the barrier management module 603 generates a json file of the service request according to the interface information of the target interface, the contract information of the target interface, the barrier scene information and the barrier data.
Alternatively, if the barrier data does not pass the verification, the barrier management module 603 displays a data error on the visual interface to prompt the user to reenter new barrier data.
S707: the barrier management module 603 initiates a barrier service according to the encoded file of the service request.
S708: the barrier management module 603 responds to the barrier test operation, sends a request message to the barrier service, and verifies a response message generated by the barrier service.
As one example, S708 may include: after the baffle management module 603 starts the baffle service and before the calling interface of the baffle service is not provided to the user, the baffle service may be subjected to a baffle test, specifically, after the baffle management module 603 responds to the baffle test operation, a request message is sent to the baffle service, and then whether the response message generated by the baffle service accords with the maintained data is received and verified.
S709: the baffle management module 603 provides a call interface of the baffle service to the user if the baffle service passes through.
The embodiment provides a baffle starting method based on contract testing, which comprises the steps that firstly interface information input by a provider can be obtained in a visual interface, an interface is created according to the interface information, and after a corresponding target interface is selected, use information and contract entering and exiting parameter information input by a user can be obtained in the visual interface, so that contract information of the target interface is obtained. After selecting the corresponding contract, the baffle scene information and the baffle data input by the user can be obtained at the visual interface, the baffle data is checked according to the interface access parameter information and the contract access parameter information of the target interface, if the baffle data is checked, the code file of the service request is generated according to the interface information, the contract information, the baffle scene information and the baffle data of the target interface, and the baffle service is started, or the baffle service can be subjected to baffle test before the calling interface of the baffle service is not provided for the user, so that the availability of the baffle service is tested. In the process, the baffle data are constrained through contracts which are jointly formulated and complied by the interface provider and the user, so that the baffle data can provide accuracy, and therefore, the baffle service not only can enable the interface provider and the interface user to realize parallel development, but also can greatly improve the success rate of system integration.
Referring to fig. 8, an embodiment of the present application provides a barrier actuation device 800 based on contract testing, the device comprising:
an obtaining unit 801, configured to obtain interface information input by a provider, where the interface information includes interface basic information and interface access parameter information;
a processing unit 802 for creating an interface according to the interface information;
an obtaining unit 803, configured to obtain contract information of the target interface according to interface basic information of the target interface, where the contract information includes contract basic information and contract entry and exit parameter information;
an obtaining unit 801, configured to obtain baffle scene information and baffle data input by a user;
a verification unit 804, configured to verify the baffle data according to the interface information of the target interface and contract information of the target interface;
and a starting unit 805, configured to start the baffle service if the baffle data check passes, so that the user invokes the baffle service.
Optionally, the processing unit 802 is specifically configured to:
responding to the operation of selecting an interface, and obtaining interface basic information of a target interface; acquiring use information and contract access parameter information input by a user; and acquiring contract basic information according to the interface basic information and the use information of the target interface.
Optionally, the verification unit 804 is specifically configured to:
and checking the baffle data according to the interface access parameter information of the target interface and contract access parameter information of the target interface.
Optionally, the starting unit 805 is specifically configured to:
if the baffle data passes the verification, generating a code file of the service request according to the interface information of the target interface, contract information of the target interface, baffle scene information and baffle data;
and starting the baffle service according to the code file of the service request.
Optionally, the compact test-based baffle actuating device 800 further includes:
and the prompting unit is used for displaying data errors on the visual interface if the baffle data check is not passed, so as to prompt a user to input new baffle data again.
Optionally, the compact test-based baffle actuating device 800 further includes:
the test unit is used for responding to the baffle test operation and sending a request message to the baffle service; and receiving and verifying the response message generated by the baffle service.
It should be noted that, the specific implementation manner and the achieved effect of the baffle start device 800 based on contract test can be referred to the related description in the method provided in fig. 1 or fig. 7, and will not be repeated here.
The embodiment of the application also provides an electronic device 900, as shown in fig. 9, where the device 900 includes a memory 901 and a processor 902:
the memory 901 is for storing a computer program;
the processor 902 is configured to perform the methods provided in fig. 1 or fig. 7 described above in accordance with a computer program.
Furthermore, the present application provides a computer readable storage medium for storing a computer program for executing the method provided in fig. 1 or fig. 7.
From the above description of embodiments, it will be apparent to those skilled in the art that all or part of the steps of the above described example methods may be implemented in software plus general hardware platforms. Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a storage medium, such as a read-only memory (ROM)/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network communication device such as a router) to perform the method according to the embodiments or some parts of the embodiments of the present application.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points. The apparatus embodiments described above are merely illustrative, in which the modules illustrated as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, may be located in one place, or may be distributed over multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the objective of the embodiment. Those of ordinary skill in the art will understand and implement the present application without undue burden.
The foregoing description of the exemplary embodiments of the application is merely illustrative of the application and is not intended to limit the scope of the application.

Claims (10)

1. The baffle starting method based on contract test is characterized by being applied to a contract platform and comprising the following steps of:
acquiring interface information input by a provider, and creating an interface according to the interface information, wherein the interface information comprises interface basic information and interface access parameter information;
acquiring contract information of a target interface according to interface basic information of the target interface, wherein the contract information comprises the contract basic information and contract access parameter information;
acquiring baffle scene information and baffle data input by a user, and checking the baffle data according to interface information of the target interface and contract information of the target interface;
and if the baffle data check passes, starting a baffle service so that the user can call the baffle service.
2. The method according to claim 1, wherein the obtaining contract information of the target interface according to the interface basic information of the target interface includes:
responding to the interface selecting operation, and obtaining the interface basic information of the target interface;
acquiring the use information and contract access parameter information input by the user;
and obtaining the contract basic information according to the interface basic information and the use information of the target interface.
3. The method of claim 1, wherein the verifying the baffle data based on the interface information of the target interface and the contract information of the target interface comprises:
and verifying the baffle data according to the interface access parameter information of the target interface and the contract access parameter information of the target interface.
4. The method of claim 1, wherein if the barrier data check passes, starting a barrier service, comprising:
if the baffle data passes the verification, generating a code file of a service request according to the interface information of the target interface, contract information of the target interface, the baffle scene information and the baffle data;
and starting the baffle service according to the code file of the service request.
5. The method according to claim 1, wherein the method further comprises:
and if the baffle data check is not passed, displaying data errors on a visual interface so as to prompt the user to reenter new baffle data.
6. The method of claim 1, wherein after the initiating the baffle service, before the user invokes the baffle service, further comprising:
responding to a baffle test operation, and sending a request message to the baffle service;
and receiving and verifying the response message generated by the baffle service.
7. A compact test-based baffle activation system, comprising:
the interface management module is used for acquiring interface information input by a provider and creating an interface according to the interface information, wherein the interface information comprises interface basic information and interface access parameter information;
the contract management module is used for obtaining contract information of the target interface according to the interface basic information of the target interface, wherein the contract information comprises the contract basic information and contract access parameter information;
the baffle management module is used for acquiring baffle scene information and baffle data input by a user and checking the baffle data, wherein the baffle data comprises baffle basic information and baffle access parameter information;
and the baffle management module is also used for starting the baffle service if the baffle data verification is successful, so that the user can call the baffle service.
8. The system of claim 7, wherein the baffle management module is further configured to, prior to the user invoking the baffle service:
responding to a baffle test operation, and sending a request message to the baffle service;
and receiving and verifying the response message generated by the baffle service.
9. An electronic device comprising a memory and a processor for executing a program stored in the memory, running the method of any one of claims 1-6.
10. A computer readable storage medium, characterized in that the computer readable storage medium is for storing a computer program for executing the method of any one of claims 1-6.
CN202311194450.4A 2023-09-15 2023-09-15 Method, system, equipment and medium for starting baffle based on contract test Pending CN117240746A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311194450.4A CN117240746A (en) 2023-09-15 2023-09-15 Method, system, equipment and medium for starting baffle based on contract test

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311194450.4A CN117240746A (en) 2023-09-15 2023-09-15 Method, system, equipment and medium for starting baffle based on contract test

Publications (1)

Publication Number Publication Date
CN117240746A true CN117240746A (en) 2023-12-15

Family

ID=89094293

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311194450.4A Pending CN117240746A (en) 2023-09-15 2023-09-15 Method, system, equipment and medium for starting baffle based on contract test

Country Status (1)

Country Link
CN (1) CN117240746A (en)

Similar Documents

Publication Publication Date Title
CN108415832B (en) Interface automation test method, device, equipment and storage medium
CN107656874B (en) Interface testing method and device, simulation baffle and system
CN113268336B (en) Service acquisition method, device, equipment and readable medium
CN110569159A (en) Baffle generation method, device, equipment and computer storage medium
CN105378703A (en) Methods and systems for validating multiple methods of input using unified rule set
CN113227976A (en) Methods, systems, and computer readable media for data transformation using representational state transfer (REST) Application Programming Interfaces (APIs)
CN111538659A (en) Interface testing method and system for service scene, electronic device and storage medium
CN111695328B (en) Method, device, equipment and storage medium for generating simulation test message
CN112711640A (en) Method and device for configuring business handling process
CN112561690B (en) Method, system, equipment and storage medium for testing credit card staged service interface
CN114327390A (en) Micro-service generation method and device based on scaffold
CN112788017B (en) Security verification method, device, equipment and medium
CN109857634A (en) Interface testing parameter verification method, apparatus, electronic equipment and storage medium
CN113468212A (en) Event execution method and device and electronic equipment
CN110209442B (en) Plug-in function automatic execution method, electronic device and storage medium
CN109101408B (en) Method and device for detecting service availability in joint debugging environment
CN108632348B (en) Service checking method and device
CN108052842B (en) Signature data storage and verification method and device
CN115905227A (en) Data import method and device, electronic equipment and storage medium
CN116089920A (en) Sensitive field early warning method, system, computer equipment and medium
CN117240746A (en) Method, system, equipment and medium for starting baffle based on contract test
CN112230938B (en) Method and device for configuring rental products of industrial Internet
CN117009205A (en) Interface simulation method, system and computer equipment
CN113704123A (en) Interface test method, device, equipment and storage medium
CN109447806B (en) Front-end control method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination