A Mock testing method and related equipment
By storing Mock configuration parameters in the Mock test configuration database and using service identification information to determine the configuration parameters of the target service, the problem of the existing Mock test system requiring restart is solved, and the simplification and convenience of the Mock test process is achieved.
Patent Information
- Application Number
- CN202110143431.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-02
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2041-02-02
AI Technical Summary
Since the existing Mock testing system is written in the source code file, the entire system needs to be restarted when the test requirements change. The testing process is cumbersome and complicated, which increases the workload of technicians.
The relevant configuration parameters are pre-stored in the Mock test configuration database, and the configuration parameters of the target service are determined from the database through service identification information, and Mock tests are performed to avoid direct operation of the source code files of the Mock test system.
Different types of tests can be performed without restarting the Mock test system, which simplifies the testing process, reduces the workload of technicians, and improves the convenience and implementability of Mock tests.
Smart Images

Figure CN114840407B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of communications, and in particular to a Mock testing method and related equipment. Background Art
[0002] Mock testing refers to a test method that uses a virtual object to create a test for some objects that are not easy to construct or obtain during the test process. In the Mock test service, you need to use Mock configuration parameters to perform related tests.
[0003] In the prior art, Mock configuration parameters are usually pre-configured in a source code file of a Mock test system. When executing automated testing, the Mock configuration parameters in the source code file of the Mock test system are used for testing.
[0004] In the existing Mock data testing process, since the Mock configuration parameters are written in the source code files of the Mock test system, when the Mock configuration parameters need to be changed due to different test requirements, the entire Mock test system needs to be restarted. The testing process is cumbersome and complicated, which increases the workload of technicians. Summary of the invention
[0005] An embodiment of the present application provides a Mock testing method for a Mock testing process. This solution pre-stores relevant configuration parameters in a Mock testing configuration database, and uses the configuration parameters stored in the Mock testing configuration database to perform testing when testing is required, thereby avoiding the need to operate the source code files of the Mock testing system when the user needs to perform tests with different requirements, so that there is no need to restart the Mock testing system when performing different testing processes, making the Mock testing process easier to implement.
[0006] A first aspect of an embodiment of the present application provides a Mock testing method, including:
[0007] Acquire a service test request sent by a test end, wherein the service test request includes service identification information of a service requested to be tested by the test end;
[0008] Determine configuration parameters of the target service associated with the service identification information from a Mock test configuration database, wherein the configuration parameters include test items that need to be tested for the target service and test results corresponding to the test items;
[0009] Determine a test method corresponding to the test item, and call the test method to perform a mock test on the test item to obtain a test result corresponding to the configuration parameter;
[0010] The test result is returned to the test end.
[0011] Based on the Mock testing method provided in the first aspect of the embodiment of the present application, optionally, the method further includes:
[0012] The configuration parameters of the Mock service are received, and the configuration parameters are stored in the Mock test configuration database, where the configuration parameters of the Mock service include the service identification information.
[0013] Based on the Mock test method provided in the first aspect of the embodiment of the present application, optionally, after obtaining the service test request sent by the test end, the method further includes:
[0014] Determine whether the service test request meets the preset conditions for performing Mock testing;
[0015] If the service test request meets the preset conditions for performing the Mock test, the subsequent steps of determining the test method corresponding to the test item and calling the test method to perform the Mock test on the test item to obtain the test result corresponding to the configuration parameters are executed.
[0016] Based on the Mock testing method provided in the first aspect of the embodiment of the present application, optionally, the method further includes:
[0017] If the service test request does not meet the preset conditions for performing the Mock test, the service test request is forwarded to other services.
[0018] Based on the mock test method provided in the first aspect of the embodiment of the present application, optionally, determining whether the service test request meets the preset conditions for performing the mock test includes:
[0019] Acquire verification information corresponding to the service identification information, the verification information being pre-stored in the Mock test configuration database;
[0020] Determining whether the service identification information is consistent with the verification information;
[0021] If the service identification information is inconsistent with the verification information, then the service test request meets the preset conditions for performing the Mock test;
[0022] If the service identification information is consistent with the verification information, then the service test request does not meet the preset conditions for performing the Mock test.
[0023] Based on the Mock testing method provided in the first aspect of the embodiment of the present application, optionally, the method further includes:
[0024] receiving a configuration parameter deletion request from the test end, wherein the test deletion request includes service identification information;
[0025] Determining, in the Mock test configuration database, configuration parameters associated with the service identification information;
[0026] Delete the configuration parameter.
[0027] A second aspect of an embodiment of the present application provides a Mock testing device, including:
[0028] An acquiring unit, configured to acquire a service test request sent by a test end, wherein the service test request includes service identification information of a service requested to be called by the test end;
[0029] A determination unit, configured to determine configuration parameters of a target service associated with the service identification information from a Mock test configuration database, wherein the configuration parameters include test items that need to be tested for the target service and test results corresponding to the test items;
[0030] A testing unit, used to determine a testing method corresponding to the testing item, and call the testing method to perform a mock test on the testing item to obtain a testing result corresponding to the testing item;
[0031] The returning unit is used to return the test result to the test end.
[0032] A third aspect of an embodiment of the present application provides a Mock testing device, including:
[0033] CPU, memory, input and output interfaces, wired or wireless network interfaces, and power supply;
[0034] The memory is a short-term storage memory or a persistent storage memory;
[0035] The central processing unit is configured to communicate with the memory and execute instruction operations in the memory on the Mock test device to perform any method described in the first aspect of the embodiments of the present application.
[0036] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on a computer, enable the computer to execute a method as described in any one of the first aspects of the embodiment of the present application.
[0037] A fifth aspect of the embodiments of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute a method as described in any one of the first aspects of the embodiments of the present application.
[0038] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages: the embodiments of the present application obtain the service test request sent by the test end, and determine the configuration parameters of the target service associated with it from the Mock test configuration database based on the service identification information included in the service test request, perform corresponding Mock tests based on the configuration parameters, and return the test results to the test section, thereby completing the Mock test process. In this way, the tester does not need to modify the source code files of the Mock test system, but only needs to add the corresponding configuration parameters in the Mock test configuration database to complete different types of tests, and can adjust the configuration parameters without the use of the terminal Mock test system, thereby completing tests with different requirements. This makes the Mock test process more convenient and improves the feasibility of the Mock test process. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0040] Figure 1 A flowchart of an embodiment of the Mock testing method of this application;
[0041] Figure 2 Another flowchart of the Mock testing method embodiment of the present application;
[0042] Figure 3 A structural schematic diagram of an embodiment of a Mock test device of this application;
[0043] Figure 4 This is another structural schematic diagram of the Mock test equipment embodiment of the present application. DETAILED DESCRIPTION
[0044] An embodiment of the present application provides a Mock testing method for a Mock testing process. This solution pre-stores relevant configuration parameters in a Mock testing configuration database, thereby avoiding the need to operate the source code files of the Mock testing system when the user needs to perform tests with different requirements, making the Mock testing process easier to implement.
[0045] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0046] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0047] It should be noted that the descriptions involving "first", "second", etc. in this application are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in this field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0048] Mock testing refers to a test method that uses a virtual object to create a test for some objects that are not easy to construct or obtain during the test process. In the Mock test service, you need to use Mock configuration parameters to perform related tests.
[0049] In the existing Mock data testing process, since the Mock configuration parameters are written in the source code file of the Mock test system, when the Mock configuration parameters need to be changed due to different test requirements, the entire Mock test system needs to be restarted. The testing process is cumbersome and complicated, which increases the workload of technicians and has certain difficulties in implementation.
[0050] To solve the above problems, this application provides a new Mock testing method, please refer to Figure 1, an embodiment of the mock testing method of the present application includes: steps 101 to 104.
[0051] 101. Obtain the service test request sent by the test end.
[0052] Get the service test request sent by the test end. The service test request includes the service identification information of the service requested by the test end. The service test request indicates that the test end needs to request a certain service, and the service actually requested by the test end can be determined based on the service identification information. The specific service identification information can be preset, and different types of services with different settings in the Mock test system can be obtained through different service identifications.
[0053] 102. Determine configuration parameters of the target service associated with the service identification information from a Mock test configuration database.
[0054] Based on the service identification information, a query is made in the Mock test configuration database, and then the configuration parameters of the target service associated with the service identification information are determined from the Mock test configuration database. Specifically, the service identification information can be stored in the Mock test configuration database as a primary key in association with the configuration parameters, so that the configuration parameters can be determined after the Mock test system obtains the service test request. The configuration parameters are pre-stored in the Mock test configuration database, and the configuration parameters include the test items that the target service needs to test and the test results corresponding to the test items. The specific configuration parameters can be set differently based on the different test contents desired to be performed, such as the return content of the interface test, the return time limit of the required test, the delay return seconds, and whether to return multiple requests and other test items, which can be determined according to the actual situation and are not limited here. It can be understood that different test results and test items can be set for performance tests or functional tests that are different from interface tests, which are not limited here.
[0055] 103. Determine a test method corresponding to the test item, and call the test method to perform a mock test on the test item to obtain a test result corresponding to the configuration parameters.
[0056] Determine the test method corresponding to the test item, and call the test method to perform a Mock test on the test item to obtain a test result corresponding to the configuration parameters. Perform a corresponding Mock test based on the configuration parameters obtained from the Mock test configuration database to obtain a test result corresponding to the configuration parameters stored in the configuration parameters. Then complete the Mock test. Specifically, the fields contained in the configuration parameters can be replaced and modified with the current fields in the Mock test system so that the Mock test system can complete the corresponding test items according to the configuration parameters. The specific details can be determined according to the actual situation and are not limited here.
[0057] 104. Return the test result to the test end.
[0058] The Mock test system returns the test result to the test end. Then the Mock test process is completed. Since the test result is obtained based on the service identification information, when performing the Mock test, the user can obtain different types of tests by modifying the service identification information in the service test request. At the same time, the configuration parameters are stored in the Mock test configuration database, so the user can perform different types of tests without adjusting the source code files of the Mock test system. In addition, for multiple users performing tests, the service can be deployed on its own virtual machine and the Mock test configuration database can be requested to obtain the configuration parameters, thereby completing the test process of multiple users at the same time.
[0059] The embodiment of the present application obtains the service test request sent by the test end, and determines the configuration parameters of the target service associated with it from the Mock test configuration database based on the service identification information included in the service test request, performs corresponding Mock tests based on the configuration parameters, and returns the test results to the test section, thereby completing the Mock test process. Through the above-mentioned method, the tester does not need to modify the source code files of the Mock test system, but only needs to add the corresponding configuration parameters in the Mock test configuration database to complete different types of tests, and can adjust the configuration parameters without stopping or interrupting the use process of the terminal Mock test system, thereby completing tests with different requirements. The Mock test process is made more convenient and the feasibility of the Mock test process is improved.
[0060] based on Figure 1 In order to solve the problem, the following is a detailed embodiment of the present invention that can be optionally performed during implementation. Figure 2 , an embodiment of the present application includes: step 201-step 207.
[0061] 201. Receive configuration parameters of a Mock service, and store the configuration parameters in the Mock test configuration database.
[0062] Receive the configuration parameters of the Mock service, and store the configuration parameters in the Mock test configuration database. The user can directly operate the Mock test configuration database and store the configuration parameters directly in the Mock test configuration database. The configuration parameters of the Mock service include the service identification information. It is understandable that the configuration parameters may include other relevant information in addition to the data associated with the Mock test, such as the operator, operation time, etc., which may be determined according to the actual situation and is not limited here.
[0063] 202. Obtain the service test request sent by the test end.
[0064] Obtain a service test request sent by the test end, the service test request including the service identification information of the service requested to be tested by the test end. Figure 1 The corresponding step 101 in the embodiment is similar and will not be described in detail here.
[0065] 203. Determine whether the service test request meets the preset conditions for performing the Mock test.
[0066] The service test request is judged to determine whether it meets the preset conditions for conducting a Mock test. The specific preset conditions can be pre-stored in the Mock test configuration database. If the service test request meets the preset conditions for conducting a Mock test, step 205 is executed to determine the configuration parameters of the target service associated with the service identification information from the Mock test configuration database and conduct a Mock test. If the preset conditions are not met, step 204 is executed to forward the service test request to other services. The preset conditions can be determined based on actual conditions. This scheme is explained by determining whether the service identification information contained in the service test request is consistent with the verification information pre-stored in the Mock test configuration database as a preset condition. It can be understood that in the actual implementation of this scheme, the preset conditions can be set according to one's own needs, and are not specifically limited here.
[0067] Verification information can be obtained from the Mock test configuration database. In this embodiment, verification information is stored in association with service identification information. Therefore, corresponding verification information can be obtained based on service identification information. Verification information is preset by the user. If the service identification information is inconsistent with the verification information, the service test request meets the preset conditions for performing the Mock test; if the service identification information is consistent with the verification information, the service test request does not meet the preset conditions for performing the Mock test, and the test request needs to be forwarded to other services. The purpose of performing the Mock test when the service identification information is inconsistent with the verification information is that in the actual implementation process, the request may not be deliberately set. In most cases, the user needs to perform the Mock test, so only the verification information needs to be adjusted to any form to meet the user's usage needs. When other services need to be requested, the verification information needs to be accurately adjusted to be consistent with the service identification information, so as to achieve the purpose of calling other services, thereby further facilitating the user's use process and improving the feasibility of this solution. It can be understood that in the actual implementation process, the Mock service can also be requested when the service identification information is consistent with the verification information, and other services can be requested when the service identification information is inconsistent with the verification information. The specific situation can be determined according to the actual situation and is not limited here.
[0068] 204. Forward the service test request to other services.
[0069] If the service identification information is consistent with the verification information, the service test request is forwarded to other services. If the service identification information is consistent with the verification information, it means that the service that the user actually wants to request this time is a real service. Therefore, the service test request needs to be forwarded to other services. During the forwarding process, the Mock system can adjust the service test request so that other services can correctly identify the service test request and respond. The specific details can be determined based on actual conditions and are not limited here.
[0070] 205. Determine configuration parameters of the target service associated with the service identification information from a Mock test configuration database.
[0071] Determine the configuration parameters of the target service associated with the service identification information from the Mock test configuration database. It is understandable that the Mock test configuration database can add a corresponding lock mechanism to avoid multiple people modifying the same data at the same time, which is not limited here.
[0072] 206. Determine a test method corresponding to the test item, and call the test method to perform a mock test on the test item to obtain a test result corresponding to the test item.
[0073] 207. Return the test result to the test end.
[0074] The above steps 206 to 207 are Figure 1 Step 103 to step 104 in the corresponding embodiment are similar and will not be described in detail here.
[0075] 208. Receive a configuration parameter deletion request from the test end.
[0076] After obtaining the test results, the Mock test system can also clean up the configuration parameters in the Mock test configuration database. Specifically, it first needs to obtain a configuration parameter deletion request issued by the user. The test deletion request includes service identification information, and the configuration parameters stored corresponding to the service identification information are the configuration parameters that need to be deleted.
[0077] 209. Determine, in the Mock test configuration database, configuration parameters associated with the service identification information.
[0078] Based on the service identification information, a query is performed in the Mock test configuration database to obtain configuration parameters associated with the service identification information, so as to perform a subsequent deletion process.
[0079] 210. Delete the configuration parameters.
[0080] Delete the determined configuration parameters associated with the service identification information, and then complete the cleaning of the Mock test configuration database. Thereby reducing unnecessary data in the Mock test configuration database, facilitating the management of test data, and improving the feasibility of this solution. It can be understood that the above steps 208 to 210 are the cleaning process of the Mock test configuration database, and its implementation process does not conflict with the Mock test process, so it can also be executed independently, which can be determined according to the actual situation and is not limited here.
[0081] This solution judges the service test request to determine whether it meets the conditions for Mock testing. If so, Mock testing is performed. If not, the request is forwarded to other services. At the same time, the preset conditions are stored in the Mock test configuration database. Therefore, the user can only change the preset conditions stored in the Mock test configuration database to enable the test end to obtain other services or Mock services, which improves the simplicity of the testing process and the feasibility of this solution.
[0082] The above describes the Mock test method in the embodiment of the application. The following describes the Mock test device in the embodiment of the present invention. Figure 3 , an embodiment of the present application includes:
[0083] An acquiring unit 301 is configured to acquire a service test request sent by a test end, wherein the service test request includes service identification information of a service requested to be invoked by the test end;
[0084] A determination unit 302 is used to determine configuration parameters of a target service associated with the service identification information from a Mock test configuration database, wherein the configuration parameters include test items that need to be tested for the target service and test results corresponding to the test items;
[0085] The testing unit 303 is used to determine a test method corresponding to the test item, and call the test method to perform a mock test on the test item to obtain a test result corresponding to the test item;
[0086] The returning unit 304 is configured to return the test result to the test end.
[0087] In this embodiment, the process executed by each unit in the Mock test device is the same as the above Figure 1 The method flow described in the corresponding embodiment is similar and will not be repeated here.
[0088] Figure 4It is a structural diagram of a Mock test device provided in an embodiment of the present application. The server 400 may include one or more central processing units (CPU) 401 and a memory 405. The memory 405 stores one or more application programs or data.
[0089] In this embodiment, the specific functional module division in the central processing unit 401 can be the same as the above Figure 3 The functional module division method of each unit described in is similar and will not be repeated here.
[0090] The memory 405 may be a volatile storage or a persistent storage. The program stored in the memory 405 may include one or more modules, each of which may include a series of instruction operations on the server. Furthermore, the central processor 401 may be configured to communicate with the memory 405 and execute a series of instruction operations in the memory 405 on the server 400.
[0091] The server 400 may also include one or more power supplies 402, one or more wired or wireless network interfaces 403, one or more input and output interfaces 404, and / or one or more operating systems, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0092] The CPU 401 can execute the aforementioned Figure 1 The operations performed by the Mock test method in the illustrated embodiment will not be described in detail here.
[0093] The present invention also provides a computer-readable storage medium, which is used to implement the function of the Mock test method, and stores a computer program thereon. When the computer program is executed by a processor, the processor can be used to execute the following steps: Figure 1 The method described.
[0094] It is understandable that if the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a corresponding computer-readable storage medium or integrated into a computer program product to perform the above method. Based on such an understanding, the present invention implements all or part of the processes in the above corresponding embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media does not include electrical carrier signals and telecommunication signals.
[0095] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0096] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0097] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0098] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0099] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0100] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A Mock testing method, characterized in that: include: Acquire a service test request sent by a test end, wherein the service test request includes service identification information of a service requested to be tested by the test end; Determine configuration parameters of the target service associated with the service identification information from a Mock test configuration database, wherein the configuration parameters include test items that need to be tested for the target service and test results corresponding to the test items; Determine a test method corresponding to the test item, and call the test method to perform a mock test on the test item to obtain a test result corresponding to the configuration parameter; Returning the test result to the test end; After obtaining the service test request sent by the test end, the method further includes: Determine whether the service test request meets the preset conditions for performing Mock testing; If the service test request meets the preset conditions for performing the Mock test, the subsequent step of determining the test method corresponding to the test item, calling the test method to perform the Mock test on the test item, and obtaining the test result step corresponding to the configuration parameters; The determining whether the service test request meets the preset conditions for performing the Mock test includes: Acquire verification information corresponding to the service identification information, the verification information being pre-stored in the Mock test configuration database; Determining whether the service identification information is consistent with the verification information; Based on the judgment result, it is determined whether the service test request meets the preset conditions for performing the Mock test.
2. The Mock testing method according to claim 1, characterized in that: The method further comprises: The configuration parameters of the Mock service are received, and the configuration parameters are stored in the Mock test configuration database, where the configuration parameters of the Mock service include the service identification information.
3. The Mock testing method according to claim 1, characterized in that: The method further comprises: If the service test request does not meet the preset conditions for performing the Mock test, the service test request is forwarded to other services.
4. The Mock testing method according to claim 1, characterized in that: The determining, based on the judgment result, whether the service test request meets the preset conditions for performing the Mock test includes: If the service identification information is inconsistent with the verification information, then the service test request meets the preset conditions for performing the Mock test; If the service identification information is consistent with the verification information, then the service test request does not meet the preset conditions for performing the Mock test.
5. The Mock testing method according to claim 1, characterized in that: The method further comprises: receiving a configuration parameter deletion request from the test end, wherein the configuration parameter deletion request includes service identification information; Determining, in the Mock test configuration database, configuration parameters associated with the service identification information; Delete the configuration parameter.
6. A Mock testing device, characterized in that: include: An acquiring unit, configured to acquire a service test request sent by a test end, wherein the service test request includes service identification information of a service requested to be called by the test end; A determination unit, configured to determine configuration parameters of a target service associated with the service identification information from a Mock test configuration database, wherein the configuration parameters include test items that need to be tested for the target service and test results corresponding to the test items; A testing unit, used to determine a testing method corresponding to the testing item, and call the testing method to perform a mock test on the testing item to obtain a testing result corresponding to the testing item; A returning unit, used for returning the test result to the test end; The Mock test equipment also includes: A judging unit, used to judge whether the service test request meets the preset conditions for performing a Mock test; An execution unit, configured to execute the subsequent step of determining a test method corresponding to the test item, and calling the test method to perform a mock test on the test item, and obtaining a test result step corresponding to the configuration parameter if the service test request meets the preset conditions for performing the mock test; The judgment unit is specifically used to obtain verification information corresponding to the service identification information, the verification information is pre-stored in the Mock test configuration database, judge whether the service identification information is consistent with the verification information, and determine whether the service test request meets the preset conditions for performing the Mock test based on the judgment result.
7. A Mock testing device, characterized in that: include: CPU, memory, input and output interfaces, wired or wireless network interfaces, and power supply; The memory is a short-term storage memory or a persistent storage memory; The central processing unit is configured to communicate with the memory, and execute instructions in the memory on the mock test device to perform the method according to any one of claims 1 to 5.
8. A computer-readable storage medium comprising instructions, which, when executed on a computer, enable the computer to execute the method according to any one of claims 1 to 5.
9. A computer program product comprising instructions, which, when executed on a computer, causes the computer to execute the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Test method and device based on Mock and server
CN107329890A
Application program testing method, device, computer device and storage medium
CN108268375A
A data testing method and related equipment
CN109743222A