CN116340138A - Test method, system, equipment and storage medium based on service virtualization - Google Patents

Test method, system, equipment and storage medium based on service virtualization Download PDF

Info

Publication number
CN116340138A
CN116340138A CN202211542812.XA CN202211542812A CN116340138A CN 116340138 A CN116340138 A CN 116340138A CN 202211542812 A CN202211542812 A CN 202211542812A CN 116340138 A CN116340138 A CN 116340138A
Authority
CN
China
Prior art keywords
service
service virtualization
virtualization platform
test
micro
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
CN202211542812.XA
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.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank Co 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 Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202211542812.XA priority Critical patent/CN116340138A/en
Publication of CN116340138A publication Critical patent/CN116340138A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a test method, a system, equipment and a storage medium based on service virtualization, and relates to the technical field of software test, wherein the method comprises the following steps: configuring basic information of a plurality of micro-services depending on a test environment to a service virtualization platform; different matching strategies are configured in the service virtualization platform according to test requirements; and sending a test request to the service virtualization platform, wherein the service virtualization platform returns virtual return data or forwards the request based on the matching strategy. The method of the invention realizes flexible configuration of the request return strategy in the test environment by a service virtualization mode, can realize different service demands and can improve the test efficiency.

Description

Test method, system, equipment and storage medium based on service virtualization
Technical Field
The invention relates to the technical field of software testing, in particular to a testing method, a testing system, computer equipment and a nonvolatile computer readable storage medium based on service virtualization.
Background
At present, in the current software development process, a micro-service architecture is largely used in various software architecture designs due to high flexibility and high expansibility, and when testing is performed on large-scale micro-service architecture software, the following problems are caused by adopting a traditional direct construction test environment for testing:
1. the problem of test environment conflict is that the test environment can be used by a plurality of teams at the same time, when one test environment is used by a plurality of teams at the same time, the requirements of the test environment and the test version can be different, so that how to enable different people to take different test data and the performance behavior of the corresponding test API is a great problem.
2. The test environment is unstable and some dependent third party services may cause service unavailability due to network, deployment, or version issues, at which point the entire test environment is not available.
3. The preparation of test data takes a lot of time, and some test data has a relatively strong business relationship between data because of the need of associating upstream and downstream, and the manual preparation of the data takes a lot of time.
Accordingly, there is a need for improvement and advancement in the art.
Disclosure of Invention
In view of the foregoing deficiencies of the prior art, it is an object of the present invention to provide a testing method, system, computer device and non-volatile computer readable storage medium based on service virtualization, which address at least one of the problems of the prior art.
In order to achieve the above purpose, the invention adopts the following technical scheme:
a method of testing based on service virtualization, comprising:
configuring basic information of a plurality of micro-services depending on a test environment to a service virtualization platform;
different matching strategies are configured in the service virtualization platform according to test requirements;
and sending a test request to the service virtualization platform, wherein the service virtualization platform returns virtual return data or forwards the request based on the matching strategy.
In a further technical solution, the service virtualization-based testing method, wherein the configuring the basic information of the plurality of micro services depending on the testing environment to the service virtualization platform includes:
and constructing a service virtualization platform based on the WireMock, and configuring basic information of a plurality of micro services depending on the test environment to the service virtualization platform.
In a further technical solution, the service virtualization-based testing method, before configuring basic information of a plurality of micro services depending on a testing environment to a service virtualization platform, includes:
and acquiring project source codes from a project code warehouse GitLab through a gitcone, constructing an independently-operated jar packet through an mvn clean npackage, acquiring a corresponding micro-service based on the jar packet, and deploying the micro-service to a corresponding test server.
In a further technical solution, the service virtualization-based testing method, after configuring different matching strategies according to testing requirements in the service virtualization platform, includes:
and converting the matching strategy configured in the service virtualization platform into a json file and storing the json file in a map folder.
In a further technical solution, the service virtualization-based testing method, wherein the converting the matching policy configured in the service virtualization platform into json files and storing the json files in maps folders includes:
the newly added and modified configuration files are reloaded to the service virtualization platform via a Curl-d $ { wireck_url }/__ admin/maps/reset command.
In a further technical solution, the service virtualization-based testing method, wherein the sending a testing request to the service virtualization platform, the service virtualization platform returning virtual return data or forwarding a request based on the matching policy, includes:
configuring a real micro-service forwarding address for an API interface in the micro-service in advance;
sending a test request to the service virtualization platform;
if the service virtualization platform can be matched with the corresponding matching strategy, returning corresponding virtual return data according to the corresponding matching strategy;
and if the service virtualization platform cannot be matched with the corresponding matching strategy, requesting a preset real micro-service forwarding address, and returning the acquired request result.
In a further technical scheme, the testing method based on service virtualization, wherein the basic information of a plurality of micro services depending on the testing environment is configured into a service virtualization platform, and the basic information of the micro services comprises a deployment machine, a port, a domain name and a service name.
A service virtualization-based test system, comprising:
the information configuration module is used for configuring basic information of a plurality of micro-services depending on the test environment to the service virtualization platform;
the strategy configuration module is used for configuring different matching strategies according to test requirements in the service virtualization platform;
and the testing module is used for sending a testing request to the service virtualization platform, and the service virtualization platform returns virtual return data or a forwarding request based on the matching strategy.
In a further technical solution, the service virtualization-based test system configures basic information of a plurality of micro services depending on a test environment to a service virtualization platform, including:
and constructing a service virtualization platform based on the WireMock, and configuring basic information of a plurality of micro services depending on the test environment to the service virtualization platform.
In a further technical solution, the service virtualization-based test system, before configuring basic information of a plurality of micro services depending on a test environment to a service virtualization platform, includes:
and acquiring project source codes from a project code warehouse GitLab through a gitcone, constructing an independently-operated jar packet through an mvn clean npackage, acquiring a corresponding micro-service based on the jar packet, and deploying the micro-service to a corresponding test server.
In a further technical solution, the service virtualization-based test system, after the service virtualization platform configures different matching strategies according to test requirements, includes:
and converting the matching strategy configured in the service virtualization platform into a json file and storing the json file in a map folder.
In a further technical solution, the service virtualization-based test system, wherein the converting the matching policy configured in the service virtualization platform into json files and storing the json files in maps folders includes:
the newly added and modified configuration files are reloaded to the service virtualization platform via a Curl-d $ { wireck_url }/__ admin/maps/reset command.
In a further technical solution, the service virtualization-based test system sends a test request to the service virtualization platform, and the service virtualization platform returns virtual return data or a forwarding request based on the matching policy, including:
configuring a real micro-service forwarding address for an API interface in the micro-service in advance;
sending a test request to the service virtualization platform;
if the service virtualization platform can be matched with the corresponding matching strategy, returning corresponding virtual return data according to the corresponding matching strategy;
and if the service virtualization platform cannot be matched with the corresponding matching strategy, requesting a preset real micro-service forwarding address, and returning the acquired request result.
In a further technical scheme, the test system based on service virtualization, wherein the basic information of a plurality of micro services depending on the test environment is configured into a service virtualization platform, and the basic information of the micro services comprises deployment machines, ports, domain names and service names.
A computer device, wherein the computer device comprises at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,,
the memory has stored thereon a computer program executable by the at least one processor, the computer program when executed by the at least one processor being operable to:
configuring basic information of a plurality of micro-services depending on a test environment to a service virtualization platform;
different matching strategies are configured in the service virtualization platform according to test requirements;
and sending a test request to the service virtualization platform, wherein the service virtualization platform returns virtual return data or forwards the request based on the matching strategy.
In a further technical solution, the computer device configures basic information of a plurality of micro services depending on a test environment to a service virtualization platform, including:
and constructing a service virtualization platform based on the WireMock, and configuring basic information of a plurality of micro services depending on the test environment to the service virtualization platform.
In a further technical solution, before the configuring, by the computer device, the basic information of the plurality of micro services that are dependent in the test environment to the service virtualization platform, the method includes:
and acquiring project source codes from a project code warehouse GitLab through a gitcone, constructing an independently-operated jar packet through an mvn clean npackage, acquiring a corresponding micro-service based on the jar packet, and deploying the micro-service to a corresponding test server.
In a further technical solution, the computer device, after configuring different matching policies according to test requirements in the service virtualization platform, includes:
and converting the matching strategy configured in the service virtualization platform into a json file and storing the json file in a map folder.
In a further technical solution, the computer device converts the matching policy configured in the service virtualization platform into a json file, and stores the json file in a maps folder, and then includes:
the newly added and modified configuration files are reloaded to the service virtualization platform via a Curl-d $ { wireck_url }/__ admin/maps/reset command.
In a further technical solution, the computer device sends a test request to the service virtualization platform, where the service virtualization platform returns virtual return data or a forwarding request based on the matching policy, and the method includes:
configuring a real micro-service forwarding address for an API interface in the micro-service in advance;
sending a test request to the service virtualization platform;
if the service virtualization platform can be matched with the corresponding matching strategy, returning corresponding virtual return data according to the corresponding matching strategy;
and if the service virtualization platform cannot be matched with the corresponding matching strategy, requesting a preset real micro-service forwarding address, and returning the acquired request result.
In a further technical scheme, the computer device configures basic information of a plurality of micro services depending on a test environment into a service virtualization platform, wherein the basic information of the micro services comprises deployment machines, ports, domain names and service names.
A non-transitory computer readable storage medium, wherein the non-transitory computer readable storage medium stores a computer program that, when executed by at least one processor, is operable to:
configuring basic information of a plurality of micro-services depending on a test environment to a service virtualization platform;
different matching strategies are configured in the service virtualization platform according to test requirements;
and sending a test request to the service virtualization platform, wherein the service virtualization platform returns virtual return data or forwards the request based on the matching strategy.
In a further aspect, the non-volatile computer readable storage medium, wherein the configuring the basic information of the plurality of micro services that are dependent in the test environment to the service virtualization platform includes:
and constructing a service virtualization platform based on the WireMock, and configuring basic information of a plurality of micro services depending on the test environment to the service virtualization platform.
In a further aspect, the non-volatile computer readable storage medium, before configuring the basic information of the plurality of micro services that are dependent in the test environment to the service virtualization platform, includes:
and acquiring project source codes from a project code warehouse GitLab through a gitcone, constructing an independently-operated jar packet through an mvn clean npackage, acquiring a corresponding micro-service based on the jar packet, and deploying the micro-service to a corresponding test server.
In a further technical solution, the non-volatile computer readable storage medium, after the configuring, in the service virtualization platform, different matching policies according to test requirements, includes:
and converting the matching strategy configured in the service virtualization platform into a json file and storing the json file in a map folder.
In a further aspect, the non-volatile computer readable storage medium, where after converting the matching policy configured in the service virtualization platform into a json file and storing the json file in a maps folder, includes:
the newly added and modified configuration files are reloaded to the service virtualization platform via a Curl-d $ { wireck_url }/__ admin/maps/reset command.
In a further aspect, the non-volatile computer readable storage medium, wherein the sending the test request to the service virtualization platform, the service virtualization platform returning virtual return data or forwarding a request based on the matching policy, includes:
configuring a real micro-service forwarding address for an API interface in the micro-service in advance;
sending a test request to the service virtualization platform;
if the service virtualization platform can be matched with the corresponding matching strategy, returning corresponding virtual return data according to the corresponding matching strategy;
and if the service virtualization platform cannot be matched with the corresponding matching strategy, requesting a preset real micro-service forwarding address, and returning the acquired request result.
In a further technical solution, the non-volatile computer readable storage medium configures basic information of a plurality of micro services depending on the test environment into a service virtualization platform, where the basic information of the micro services includes deployment machine, port, domain name, and service name.
Compared with the prior art, the invention provides a testing method, a testing system, testing equipment and a storage medium based on service virtualization, wherein the testing method comprises the following steps: configuring basic information of a plurality of micro-services depending on a test environment to a service virtualization platform; different matching strategies are configured in the service virtualization platform according to test requirements; and sending a test request to the service virtualization platform, wherein the service virtualization platform returns virtual return data or forwards the request based on the matching strategy. The method of the invention realizes flexible configuration of the request return strategy in the test environment by a service virtualization mode, can realize different service demands and can improve the test efficiency.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments described in the present invention, and other drawings may be obtained according to the drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a testing method based on service virtualization according to an embodiment of the present invention.
Fig. 2 is a schematic diagram of a functional module of a test system based on service virtualization according to an embodiment of the present invention.
Fig. 3 is a schematic hardware structure of the computer device according to the embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and effects of the present invention clearer and more specific, the present invention will be described in further detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
In the description of the present invention, the terms "comprising," "including," "having," "containing," and the like are open-ended terms, meaning including, but not limited to. Reference to the terms "one embodiment," "a particular embodiment," "some embodiments," "for example," etc., means that a particular feature, structure, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. The sequence of steps involved in the embodiments is used to schematically illustrate the practice of the present application, and is not limited thereto and may be appropriately adjusted as desired.
Various non-limiting embodiments of the present invention are described in detail below with reference to the attached drawing figures.
Referring to fig. 1, an embodiment of the present invention provides a testing method based on service virtualization, including the steps of:
s100, configuring basic information of a plurality of micro-services depending on a test environment to a service virtualization platform;
s200, configuring different matching strategies in the service virtualization platform according to test requirements;
and S300, sending a test request to the service virtualization platform, and returning virtual return data or forwarding the request by the service virtualization platform based on the matching strategy.
Further, the testing method based on service virtualization, wherein the basic information of a plurality of micro services depending on the testing environment is configured into a service virtualization platform, and the basic information of the micro services comprises deployment machines, ports, domain names and service names.
Further, the service virtualization-based testing method, wherein the configuring the basic information of the plurality of micro services depending on the testing environment to the service virtualization platform includes:
and constructing a service virtualization platform based on the WireMock, and configuring basic information of a plurality of micro services depending on the test environment to the service virtualization platform.
In a specific implementation, in this embodiment, a service virtualization platform is built based on WireMock, and relevant information such as deployment machines, ports, domain names, service names and the like of a plurality of micro services depending on a test environment is configured to the service virtualization platform.
Further, the service virtualization-based testing method, before configuring the basic information of the plurality of micro services depending on the testing environment to the service virtualization platform, includes:
and acquiring project source codes from a project code warehouse GitLab through a gitcone, constructing an independently-operated jar packet through an mvn clean npackage, acquiring a corresponding micro-service based on the jar packet, and deploying the micro-service to a corresponding test server.
In the embodiment, a project source code is obtained from a project code warehouse GitLab through gitclone, an independently operable jar package is constructed through mvnclean package, a corresponding micro-service is obtained based on the jar package, and the micro-service is deployed on a corresponding test server; and then constructing and deploying a plurality of depending micro-services in the test environment to the corresponding test server in sequence.
Further, the service virtualization-based testing method, after the service virtualization platform configures different matching strategies according to testing requirements, includes:
and converting the matching strategy configured in the service virtualization platform into a json file and storing the json file in a map folder.
In a specific implementation, in this embodiment, each matching policy configured in the service virtualization platform is converted into a json file and stored in a maps folder.
Such as:
Figure SMS_1
further, the service virtualization-based testing method, wherein the converting the matching policy configured in the service virtualization platform into a json file and storing the json file in a maps folder, includes:
the newly added and modified configuration files are reloaded to the service virtualization platform via a Curl-d $ { wireck_url }/__ admin/maps/reset command.
Further, the service virtualization-based testing method, wherein the sending a testing request to the service virtualization platform, the service virtualization platform returning virtual return data or forwarding a request based on the matching policy, includes:
configuring a real micro-service forwarding address for an API interface in the micro-service in advance;
sending a test request to the service virtualization platform;
if the service virtualization platform can be matched with the corresponding matching strategy, returning corresponding virtual return data according to the corresponding matching strategy;
and if the service virtualization platform cannot be matched with the corresponding matching strategy, requesting a preset real micro-service forwarding address, and returning the acquired request result.
In the embodiment, different virtual interfaces are configured to return data according to URL addresses of API interfaces in the micro service and different service request data; meanwhile, a real micro-service forwarding address is configured for an API interface in the micro-service in advance, when a test request is sent to the service virtualization platform, if the service virtualization platform can be matched with a corresponding matching strategy, corresponding virtual return data is returned according to the corresponding matching strategy, if the service virtualization platform cannot be matched with the corresponding matching strategy, the pre-configured real micro-service forwarding address is requested, and an obtained request result is returned.
Further, in this embodiment, virtual return data is configured for the unavailable third party interface, and the third party interface is requested; if the return state is 404, virtual return data is returned from the service virtualization platform, and if the return state is not 404, a real return result of the third party interface is returned.
Further, in this embodiment, the call between micro services is also through the service virtualization platform, and the service virtualization platform is called first, and the through service virtualization platform returns virtual return data or forwards the request according to the configuration.
According to the method embodiment, the service virtualization-based test method provided by the invention realizes flexible configuration of the request return strategy in the test environment in a service virtualization mode, can realize different service demands and can improve the test efficiency; meanwhile, the invention can realize the environment isolation of the access data level, and in the same set of test environment, different teams can obtain different returned data only by setting different request data labels when using the same set of environment; in addition, the invention can also solve the problem of unstable test environment, when the related third-party dependent interface is unavailable, the whole test environment can be ensured to be normally used by setting a return request, and when the third-party interface is recovered to be normal, the request local interface is turned to return to a real return body.
It should be understood that while the present application provides method operational steps as described in the examples or flowcharts, more or less operational steps may be included based on conventional or non-inventive labor, and are not necessarily sequentially performed in the order of the examples or flowcharts. The order of steps set forth in the embodiments or flowcharts is merely one manner of performing the steps in a plurality of sequences and is not intended to represent a unique sequence of steps. Moreover, at least some of the steps in an embodiment or a flowchart may include a plurality of sub-steps or phases that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the sub-steps or phases are performed necessarily occur in sequence, but may be performed alternately, or synchronously with at least a portion of the sub-steps or phases of other steps or other steps.
Based on the foregoing embodiments, referring to fig. 2, another embodiment of the present invention further provides a service virtualization-based test system, which includes:
an information configuration module 11, configured to configure basic information of a plurality of micro services depending on a test environment to a service virtualization platform;
a policy configuration module 12, configured to configure different matching policies according to test requirements in the service virtualization platform;
and the test module 13 is used for sending a test request to the service virtualization platform, and the service virtualization platform returns virtual return data or a forwarding request based on the matching strategy.
Further, the testing system based on service virtualization, wherein the basic information of a plurality of micro services depending on the testing environment is configured in a service virtualization platform, and the basic information of the micro services comprises deployment machines, ports, domain names and service names.
Further, the service virtualization-based test system configures basic information of a plurality of micro services depending on a test environment to a service virtualization platform, and the service virtualization platform comprises:
and constructing a service virtualization platform based on the WireMock, and configuring basic information of a plurality of micro services depending on the test environment to the service virtualization platform.
In a specific implementation, in this embodiment, a service virtualization platform is built based on WireMock, and relevant information such as deployment machines, ports, domain names, service names and the like of a plurality of micro services depending on a test environment is configured to the service virtualization platform.
Further, the service virtualization-based test system, before configuring the basic information of the plurality of micro services depending on the test environment to the service virtualization platform, includes:
and acquiring project source codes from a project code warehouse GitLab through a gitcone, constructing an independently-operated jar packet through an mvn clean npackage, acquiring a corresponding micro-service based on the jar packet, and deploying the micro-service to a corresponding test server.
In the embodiment, a project source code is obtained from a project code warehouse GitLab through gitclone, an independently operable jar package is constructed through mvnclean package, a corresponding micro-service is obtained based on the jar package, and the micro-service is deployed on a corresponding test server; and then constructing and deploying a plurality of depending micro-services in the test environment to the corresponding test server in sequence.
Further, the service virtualization-based test system, after the service virtualization platform configures different matching strategies according to test requirements, includes:
and converting the matching strategy configured in the service virtualization platform into a json file and storing the json file in a map folder.
In a specific implementation, in this embodiment, each matching policy configured in the service virtualization platform is converted into a json file and stored in a maps folder.
Such as:
Figure SMS_2
Figure SMS_3
further, the service virtualization-based test system, wherein the converting the matching policy configured in the service virtualization platform into a json file and storing the json file in a maps folder includes:
the newly added and modified configuration files are reloaded to the service virtualization platform via a Curl-d $ { wireck_url }/__ admin/maps/reset command.
Further, the service virtualization-based test system sends a test request to the service virtualization platform, and the service virtualization platform returns virtual return data or forwards a request based on the matching policy, including:
configuring a real micro-service forwarding address for an API interface in the micro-service in advance;
sending a test request to the service virtualization platform;
if the service virtualization platform can be matched with the corresponding matching strategy, returning corresponding virtual return data according to the corresponding matching strategy;
and if the service virtualization platform cannot be matched with the corresponding matching strategy, requesting a preset real micro-service forwarding address, and returning the acquired request result.
In the embodiment, different virtual interfaces are configured to return data according to URL addresses of API interfaces in the micro service and different service request data; meanwhile, a real micro-service forwarding address is configured for an API interface in the micro-service in advance, when a test request is sent to the service virtualization platform, if the service virtualization platform can be matched with a corresponding matching strategy, corresponding virtual return data is returned according to the corresponding matching strategy, if the service virtualization platform cannot be matched with the corresponding matching strategy, the pre-configured real micro-service forwarding address is requested, and an obtained request result is returned.
Further, in this embodiment, virtual return data is configured for the unavailable third party interface, and the third party interface is requested; if the return state is 404, virtual return data is returned from the service virtualization platform, and if the return state is not 404, a real return result of the third party interface is returned.
Further, in this embodiment, the call between micro services is also through the service virtualization platform, and the service virtualization platform is called first, and the through service virtualization platform returns virtual return data or forwards the request according to the configuration.
According to the system embodiment, the service virtualization-based test system provided by the invention realizes flexible configuration of the request return strategy in the test environment in a service virtualization mode, can realize different service demands and can improve the test efficiency; meanwhile, the invention can realize the environment isolation of the access data level, and in the same set of test environment, different teams can obtain different returned data only by setting different request data labels when using the same set of environment; in addition, the invention can also solve the problem of unstable test environment, when the related third-party dependent interface is unavailable, the whole test environment can be ensured to be normally used by setting a return request, and when the third-party interface is recovered to be normal, the request local interface is turned to return to a real return body.
Based on the above embodiments, referring to fig. 3, another embodiment of the present invention further provides a computer device, where the computer device 10 includes:
the memory 120 and the one or more processors 110 are illustrated in fig. 3 by way of example as one processor 110, and the processor 110 and the memory 120 may be coupled via a communication bus or otherwise, illustrated in fig. 3 by way of example as a communication bus.
The processor 110 is used to implement various control logic of the computer device 10, which may be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), a single-chip microcomputer, ARM (AcornRISCMachine) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. Also, the processor 110 may be any conventional processor, microprocessor, or state machine. The processor 110 may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration.
The memory 120 is used as a non-volatile computer readable storage medium for storing non-volatile software programs, non-volatile computer executable programs and modules, such as computer programs corresponding to the service virtualization-based test method in the embodiment of the present invention. The processor 110 executes various functional applications and data processing of the computer device 10 by running non-volatile software programs, instructions and units stored in the memory 120, i.e. implements the service virtualization based test method in the above-described method embodiments.
The memory 120 may include a storage program area that may store an operating device, an application program required for at least one function, and a storage data area; the storage data area may store data created from the use of the computer device 10, etc. In addition, memory 120 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 120 may optionally include memory located remotely from processor 110, which may be connected to computer device 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
One or more units are stored in memory 120 that, when executed by one or more processors 110, may implement the service virtualization-based test method in any of the method embodiments described above, e.g., may implement method steps S100 through S300 in fig. 1 described above.
It will be appreciated by those skilled in the art that the hardware architecture shown in fig. 3 is merely a schematic illustration of a portion of the architecture associated with the present inventive arrangements and is not limiting as to the computer device to which the present inventive arrangements are applicable, and that a particular computer device may include more components than those shown, or may combine some components, or have a different arrangement of components.
Based on the above embodiments, the present invention further provides a non-volatile computer readable storage medium, where the non-volatile computer readable storage medium stores a computer program, which when executed by at least one processor, may implement a service virtualization based test method as in any of the method embodiments described above, e.g. may implement the method steps S100 to S300 in fig. 1 described above.
By way of example, nonvolatile storage media can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically erasable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM may be available in many forms such as Synchronous RAM (SRAM), dynamic RAM, (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchlinkDRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The disclosed memory components or memories of the operating environments described herein are intended to comprise one or more of these and/or any other suitable types of memory.
Another embodiment of the present invention provides a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a processor, enable a service virtualization based test method as in any one of the method embodiments described above, e.g. enable the method steps S100 to S300 in fig. 1 described above.
The embodiments described above are merely illustrative, wherein elements illustrated as separate elements may or may not be physically separate, and elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
From the above description of embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus a general purpose hardware platform, or may be implemented by hardware. Based on such understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the related art in the form of a software product, which may exist in a computer-readable storage medium such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method of the respective embodiments or some parts of the embodiments.
Conditional language such as "capable," "possible," or "may," among others, is generally intended to convey that a particular embodiment can include (but other embodiments do not include) particular features, elements, and/or operations unless specifically stated otherwise or otherwise understood within the context of as used. Thus, such conditional language is also generally intended to imply that features, elements and/or operations are in any way required for one or more embodiments or that one or more embodiments must include logic for deciding, with or without input or prompting, whether these features, elements and/or operations are included or are to be performed in any particular embodiment.
What has been described herein in this specification and the drawings includes examples of test methods, systems, computer devices, and non-volatile computer-readable storage media capable of providing service-based virtualization. It is, of course, not possible to describe every conceivable combination of components and/or methodologies for purposes of describing the various features of the present disclosure, but it may be appreciated that many further combinations and permutations of the disclosed features are possible. It is therefore evident that various modifications may be made thereto without departing from the scope or spirit of the disclosure, but all such modifications are intended to be within the scope of the appended claims. Further, or in the alternative, other embodiments of the disclosure may be apparent from consideration of the specification and drawings, and practice of the disclosure as presented herein. It is intended that the examples set forth in this specification and figures be considered illustrative in all respects as illustrative and not limiting. Although specific terms are employed herein, they are used in a generic and descriptive sense only and not for purposes of limitation.

Claims (10)

1. A method of testing based on service virtualization, comprising:
configuring basic information of a plurality of micro-services depending on a test environment to a service virtualization platform;
different matching strategies are configured in the service virtualization platform according to test requirements;
and sending a test request to the service virtualization platform, wherein the service virtualization platform returns virtual return data or forwards the request based on the matching strategy.
2. The service virtualization-based testing method of claim 1, wherein configuring the base information of the plurality of micro-services relied upon in the testing environment to the service virtualization platform comprises:
and constructing a service virtualization platform based on the WireMock, and configuring basic information of a plurality of micro services depending on the test environment to the service virtualization platform.
3. The service virtualization-based testing method of claim 2, wherein before configuring the basic information of the plurality of micro services relied on in the testing environment to the service virtualization platform, the method comprises:
and acquiring project source codes from a project code warehouse GitLab through a gitcone, constructing an independently-operated jar packet through an mvn clean npackage, acquiring a corresponding micro-service based on the jar packet, and deploying the micro-service to a corresponding test server.
4. A service virtualization-based testing method according to claim 3, wherein after said configuring different matching policies in said service virtualization platform according to testing requirements, comprising:
and converting the matching strategy configured in the service virtualization platform into a json file and storing the json file in a map folder.
5. The service virtualization-based testing method of claim 4, wherein converting the matching policy configured in the service virtualization platform into json file for storage in maps folder comprises:
the newly added and modified configuration files are reloaded to the service virtualization platform via a Curl-d $ { wireck_url }/__ admin/maps/reset command.
6. The service virtualization-based test method of any one of claims 1-5, wherein the sending a test request to the service virtualization platform, the service virtualization platform returning virtual return data or forwarding a request based on the matching policy, comprises:
configuring a real micro-service forwarding address for an API interface in the micro-service in advance;
sending a test request to the service virtualization platform;
if the service virtualization platform can be matched with the corresponding matching strategy, returning corresponding virtual return data according to the corresponding matching strategy;
and if the service virtualization platform cannot be matched with the corresponding matching strategy, requesting a preset real micro-service forwarding address, and returning the acquired request result.
7. The method of claim 6, wherein the basic information of the plurality of micro services depending on the test environment is configured into a service virtualization platform, and the basic information of the micro services includes deployment machine, port, domain name and service name.
8. A service virtualization-based test system, comprising:
the information configuration module is used for configuring basic information of a plurality of micro-services depending on the test environment to the service virtualization platform;
the strategy configuration module is used for configuring different matching strategies according to test requirements in the service virtualization platform;
and the testing module is used for sending a testing request to the service virtualization platform, and the service virtualization platform returns virtual return data or a forwarding request based on the matching strategy.
9. A computer device, the computer device comprising at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,,
the memory has stored thereon a computer program executable by the at least one processor, which computer program, when executed by the at least one processor, implements the service virtualization based test method of any of claims 1-7.
10. A non-transitory computer readable storage medium storing a computer program which, when executed by at least one processor, implements a service virtualization based test method as claimed in any one of claims 1 to 7.
CN202211542812.XA 2022-12-02 2022-12-02 Test method, system, equipment and storage medium based on service virtualization Pending CN116340138A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211542812.XA CN116340138A (en) 2022-12-02 2022-12-02 Test method, system, equipment and storage medium based on service virtualization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211542812.XA CN116340138A (en) 2022-12-02 2022-12-02 Test method, system, equipment and storage medium based on service virtualization

Publications (1)

Publication Number Publication Date
CN116340138A true CN116340138A (en) 2023-06-27

Family

ID=86886388

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211542812.XA Pending CN116340138A (en) 2022-12-02 2022-12-02 Test method, system, equipment and storage medium based on service virtualization

Country Status (1)

Country Link
CN (1) CN116340138A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117493219A (en) * 2023-12-29 2024-02-02 深圳蔓延科技有限公司 Test method for electronic warranty quick docking and electronic device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117493219A (en) * 2023-12-29 2024-02-02 深圳蔓延科技有限公司 Test method for electronic warranty quick docking and electronic device
CN117493219B (en) * 2023-12-29 2024-04-02 深圳蔓延科技有限公司 Test method for electronic warranty quick docking and electronic device

Similar Documents

Publication Publication Date Title
CN111278031B (en) PDU type setting method, UE strategy setting method, entity and storage medium
CN106533992B (en) PCI express fabric routing for fully connected mesh topologies
CN111917649B (en) Virtual private cloud communication and configuration method and related device
CN107832329B (en) Page resource obtaining method and terminal equipment
CN106503058B (en) A kind of data load method, terminal and computing cluster
KR970013889A (en) NETWORK-BASED MIGRATING USER AGENTS FOR PERSONAL COMMUNICATION SERVICES ASSOCIATED WITH A NETWORK-
CN116340138A (en) Test method, system, equipment and storage medium based on service virtualization
CN110213392B (en) Data distribution method and device, computer equipment and storage medium
CN110333880A (en) A kind of configuration update method, device, equipment and storage medium
CN112306380A (en) Storage management method and device and computer storage medium
CN114281263A (en) Storage resource processing method, system and equipment of container cluster management system
CN108595280A (en) Method for interface adaptation, device, computer equipment and storage medium
CN114567584A (en) Routing information processing method and device, computer equipment and storage medium
US10558726B2 (en) Method and apparatus for executing application
US20100100955A1 (en) System and method for secure os access in an ecma-script virtual machine
CN117591294A (en) Service dynamic load access method and device, internet of things platform and medium
CN109491614A (en) Based on the quick suspend mode of Nonvolatile memory reservoir and the method and apparatus of wake-up
CN109376028A (en) A kind of PCIE device error correction method and device
CN106027354A (en) Backflow method and device for VPN (Virtual Private Network) client
CN103907094A (en) Serialization of access to data in multi-mainframe computing environments
CN108418857B (en) Zookeeper cluster system and connection method and device thereof
CN106843895B (en) Method, system and readable storage medium for processing requests
CN114071488B (en) Policy configuration method, device, equipment and storage medium
WO2022133827A1 (en) Method and apparatus for processing task processing request, and blockchain node device
WO2021217246A1 (en) Tiered application pattern

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