CN110191013A - Electronic device, the Mock test method of more capital's interfaces and storage medium - Google Patents
Electronic device, the Mock test method of more capital's interfaces and storage medium Download PDFInfo
- Publication number
- CN110191013A CN110191013A CN201910316533.3A CN201910316533A CN110191013A CN 110191013 A CN110191013 A CN 110191013A CN 201910316533 A CN201910316533 A CN 201910316533A CN 110191013 A CN110191013 A CN 110191013A
- Authority
- CN
- China
- Prior art keywords
- mock
- interface
- test
- capital
- request
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/10—Active monitoring, e.g. heartbeat, ping or trace-route
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/50—Testing arrangements
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Health & Medical Sciences (AREA)
- Cardiology (AREA)
- General Health & Medical Sciences (AREA)
- Debugging And Monitoring (AREA)
Abstract
The present invention relates to functional tests, propose the Mock test method of more capital's interfaces, comprising: receive capital's interface Mock test request that test terminal is sent, include capital's interface Mock test information in capital's interface Mock test request;Information is tested according to capital's interface Mock and generates Mock request message to be processed, and the Mock request message includes task identification;Corresponding interface Mock object is matched from built-in Mock object set according to the task identification in the Mock request message;Based on the interface Mock simulating processing interface Mock test request, obtains Mock and respond and be back to the test terminal.It is able to solve more capital's interface testings to be obstructed, improves testing efficiency.In addition, the present invention also proposes a kind of electronic device and storage medium.
Description
Technical field
The present invention relates to interface testing field more particularly to the Mock test methods of a kind of electronic device, more capital's interfaces
And storage medium.
Background technique
Financial company is during developing, it usually needs and more capitals carry out the interaction of information, such as flow in loan
Cheng Zhong, it usually needs dock more capital's systems, this just needs to test the interface capability to capital's system.And with capital
Increase, in more capital's interface test process, often will appear test wrapper border it is unstable or have capital's response error the problem of,
And test is caused to be obstructed.Therefore, more capital's interface testings how to be solved to be obstructed, testing efficiency is improved and is a problem to be solved.
Summary of the invention
In view of this, the present invention proposes the Mock test method and storage medium of a kind of electronic device, more capital's interfaces, energy
It enough solves more capital's interface testings to be obstructed, improves testing efficiency.
Firstly, to achieve the above object, the present invention proposes a kind of electronic device, the electronic device include memory and
The processor connecting with the memory, the processor are used to execute the Mock of the more capital's interfaces stored on the memory
The Mock test program of test program, more capital's interfaces realizes following steps when being executed by the processor:
A1, it receives and tests capital's interface Mock test request that terminal is sent, in capital's interface Mock test request
It include capital's interface Mock test information;
A2, Mock request message to be processed, the Mock request message are generated according to capital's interface Mock test information
It include task identification;
A3, matched from built-in Mock object set according to the task identification in the Mock request message it is corresponding
Interface Mock object;
A4, the interface Mock test request is handled based on the interface Mock simulating, obtains Mock and responds and return
It is back to the test terminal.
Preferably, the step A2 includes:
Interface Mock test information in the interface Mock test request is preset as Mock request message to be processed;
Corresponding task identification is arranged to the Mock request message and by the end of the test terminal of the Mock test request
End mark is added in the Mock message request, generates the Mock request message to be processed.
Preferably, in the step A3, the Mock object set is corresponding between task identification and Mock object
The set of relationship, the Mock object are the service logic of execution task.
Preferably, described that the interface Mock survey is handled based on the interface Mock simulating in the step A4
The step of examination request, comprising:
Interface Mock test request described in the direct simulation process of interface Mock object, if Mock pairs of the interface
As in other task statuses are executed, then the Mock test request being stored into database, and by the Mock test request report
Task identification in text is sent to the interface Mock object, so that the interface Mock object is according to the task identification, from number
According to reading corresponding Mock test request in library.
Preferably, when the Mock test program of more capital's interfaces is executed by the processor, following steps are also realized:
Mock object is obtained to the implementing result of Mock test request, Mock test request is modified according to the implementing result
Processing status.
In addition, to achieve the goals above, the present invention also proposes a kind of Mock test method of more capital's interfaces, the side
Method includes the following steps:
S1, it receives and tests capital's interface Mock test request that terminal is sent, in capital's interface Mock test request
It include capital's interface Mock test information;
S2, Mock request message to be processed, the Mock request message are generated according to capital's interface Mock test information
It include task identification;
S3, matched from built-in Mock object set according to the task identification in the Mock request message it is corresponding
Interface Mock object;
S4, the interface Mock test request is handled based on the interface Mock simulating, obtains Mock and responds and return
It is back to the test terminal.
Preferably, include: in the step S2
Interface Mock test information in the interface Mock test request is preset as Mock request message to be processed;
Corresponding task identification is arranged to the Mock request message and by the end of the test terminal of the Mock test request
End mark is added in the Mock message request, generates the Mock request message to be processed.
Preferably, in the step S3, the Mock object set is corresponding between task identification and Mock object
The set of relationship, the Mock object are the service logic of execution task.
Preferably, described that the interface Mock survey is handled based on the interface Mock simulating in the step S4
The step of examination request, comprising:
Interface Mock test request described in the direct simulation process of interface Mock object, if Mock pairs of the interface
As in other task statuses are executed, then the Mock test request being stored into database, and by the Mock test request report
Task identification in text is sent to the interface Mock object, so that the interface Mock object is according to the task identification, from number
According to reading corresponding Mock test request in library.
In addition, to achieve the above object, the present invention also proposes a kind of computer readable storage medium, described computer-readable
Storage medium is stored with the Mock test program of more capital's interfaces, and the Mock test program of more capital's interfaces can be by least one
A processor executes, so that at least one described processor executes the step of the Mock test method of more capital's interfaces as described above
Suddenly.
The Mock test method and storage medium of electronic device, more capital's interfaces proposed by the invention are surveyed by receiving
Capital's interface Mock test request that terminal is sent is tried, includes capital's interface Mock in capital's interface Mock test request
Test information;Information, which is tested, according to capital's interface Mock generates Mock request message to be processed, the Mock request message packet
Contain task identification;Correspondence is matched from built-in Mock object set according to the task identification in the Mock request message
Interface Mock object;Based on the interface Mock simulating processing interface Mock test request, Mock response is obtained
And it is back to the test terminal.It is able to solve more capital's interface testings to be obstructed, improves testing efficiency.
Detailed description of the invention
Fig. 1 is the schematic diagram of the optional hardware structure of electronic device one proposed by the present invention;
Fig. 2 is the program module signal of the Mock test program of more capital's interfaces in one embodiment of electronic device of the present invention
Figure;
Fig. 3 is the implementation flow chart of the Mock test method preferred embodiment of the more capital's interfaces of the present invention.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right
The present invention is further elaborated.It should be appreciated that described herein, specific examples are only used to explain the present invention, not
For limiting the present invention.Based on the embodiments of the present invention, those of ordinary skill in the art are not before making creative work
Every other embodiment obtained is put, shall fall within the protection scope of the present invention.
It should be noted that the description for being related to " first ", " second " etc. in the present invention is used for description purposes only, and cannot
It is interpreted as its relative importance of indication or suggestion or implicitly indicates the quantity of indicated technical characteristic.Define as a result, " the
One ", the feature of " second " can explicitly or implicitly include at least one of the features.In addition, the skill between each embodiment
Art scheme can be combined with each other, but must be based on can be realized by those of ordinary skill in the art, when technical solution
Will be understood that the combination of this technical solution is not present in conjunction with there is conflicting or cannot achieve when, also not the present invention claims
Protection scope within.
As shown in fig.1, being the optional hardware structure schematic diagram of electronic device one proposed by the present invention.In the present embodiment,
Electronic device 10 may include, but be not limited only to, and connection memory 11, processor 12, net can be in communication with each other by communication bus 14
Network interface 13.It should be pointed out that Fig. 1 illustrates only the electronic device 10 with component 11-14, it should be understood that simultaneously
All components shown realistic are not applied, the implementation that can be substituted is more or less component.
Wherein, memory 11 includes at least a type of computer readable storage medium, computer readable storage medium
Including flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory etc.), random access storage device (RAM), quiet
State random access storage device (SRAM), electrically erasable programmable read-only memory (EEPROM), can be compiled read-only memory (ROM)
Journey read-only memory (PROM), magnetic storage, disk, CD etc..In some embodiments, memory 11 can be electronics dress
Set 10 internal storage unit, such as the hard disk or memory of electronic device 10.In further embodiments, memory 11 can also be with
It is the outer packet storage device of electronic device 10, such as the plug-in type hard disk being equipped on electronic device 10, intelligent memory card (Smart
Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash Card) etc..Certainly, it stores
Device 11 can also both including electronic device 10 internal storage unit and also including its outer packet storage device.In the present embodiment, storage
Device 11 is installed on the operating system and types of applications software of electronic device 10, such as the Mock of more capital's interfaces commonly used in storage
Test program etc..In addition, memory 11 can be also used for temporarily storing the Various types of data that has exported or will export.
Processor 12 can be in some embodiments central processing unit (Central Processing Unit, CPU),
Controller, microcontroller, microprocessor or other data processing chips.Processor 12 is commonly used in control electronic device 10
Overall operation.In the present embodiment, program code or processing data of the processor 12 for being stored in run memory 11, such as
The Mock test program etc. of more capital's interfaces of operation.
Network interface 13 may include radio network interface or wired network interface, and network interface 13 is commonly used in filling in electronics
It sets and establishes communication connection between 10 and other electronic equipments.
Communication bus 14 is for realizing the communication connection between component 11-13.
Fig. 1 illustrates only the electronic device 10 of the Mock test program with component 11-14 and more capital's interfaces, still
It should be understood that, it is not required that implement all components shown, the implementation that can be substituted is more or less component.
Optionally, electronic device 10 can also include user interface (not shown in figure 1), and user interface may include display
Device, input unit such as keyboard, wherein user interface can also be including standard wireline interface and wireless interface etc..
Optionally, in some embodiments, display can be light-emitting diode display, liquid crystal display, touch control type LCD and show
Device and OLED touch device etc..Further, display is alternatively referred to as display screen or display unit, for being shown in electronic device
Information is handled in 10 and for showing visual user interface.
Optionally, in some embodiments, electronic device 10 can also include that audio unit (does not show in audio unit Fig. 1
Out), audio unit can be in call signal reception pattern, call mode, logging mode, speech recognition mould in electronic device 10
When under the isotypes such as formula, broadcast reception mode, received or storage audio data is converted into audio signal;Further
Ground, electronic device 10 can also include audio output unit, and the audio signal that audio output unit converts audio unit exports,
And audio output unit can also provide the relevant audio output of specific function that executes to electronic device 10 (such as calling is believed
Number receive sound, message sink sound etc.), audio output unit may include loudspeaker, buzzer etc..
Optionally, in some embodiments, electronic device 10 can also include alarm unit (not shown), alarm list
Member can provide output and the generation of event is notified electron device 10.Typical event may include calling reception, message
Reception, key signals input, touch input etc..Other than audio or video export, alarm unit can be with different sides
Formula provides output with the generation of notification event.For example, alarm unit can provide output in the form of vibration, exhaled when receiving
Cry, message or it is some other can make electronic device 10 enter communication pattern when, alarm unit can provide tactile output (that is,
Vibration) to notify to user.
In one embodiment, the Mock test program of the more capital's interfaces stored in memory 11 is executed by processor 12
When, realize following operation:
A1, it receives and tests capital's interface Mock test request that terminal is sent, in capital's interface Mock test request
It include capital's interface Mock test information.
In the present embodiment, test terminal is the operational terminal for needing to carry out corresponding capital's interface Mock test, and test is eventually
It may be provided with capital's interface Mock administration page on end, and by receiving behaviour of the user on capital's interface Mock administration page
It instructs, generates corresponding capital's interface Mock test information.Further, user can be managed by capital's interface Mock
Page configuration interface message, and automatically generate interface index and stored.Such as in the loan flow testing to financial company,
When needing to test more capital's interfaces, interface message can be carried out by interface of capital's interface Mock administration page to capital to be measured and matched
It sets, generates the interface Mock test information of capital to be measured.It can be to avoid since capital's system testing environment is unstable or response goes out
Problem of being obstructed is tested caused by mistake.
A2, Mock request message to be processed, the Mock request message are generated according to capital's interface Mock test information
It include task identification;
Specifically, the interface Mock in the interface Mock test request can be tested to information directly as to be processed
Mock request message, and be that corresponding task identification and the test end by the Mock test request is arranged in the Mock request message
The terminal iidentification at end is also added in the Mock message request, so that Mock object can identify test eventually according to the terminal iidentification
End.
A3, matched from built-in Mock object set according to the task identification in the Mock request message it is corresponding
Interface Mock object;
Specifically, in the present embodiment, preparatory Dynamic injection Mock service end, the Mock in electronic device 10 can be passed through
Mock object set is built-in in server-side, the Mock object set is the corresponding relationship between task identification and Mock object
Set, the Mock object in the Mock object set can be electronic device 10 execute task interior business logic and/
Or external business logic, and its quantity determines according to specific needs.It therefore, can be according to the task in the Mock request message
Mark matches corresponding interface Mock object from built-in Mock object set, to carry out service analogue.
Further, in this embodiment, a Dynamic injection generation being deployed in the electronic device 10 can be first passed through in advance
It manages module (agent program), the Mock service end is injected into the electronic device 10.The Dynamic injection proxy module
It can be used for receiving the injection instruction of Mock service end.In an embodiment of the present embodiment, the Mock service end can be preparatory
The Dynamic injection proxy module is sent to by default platform.It is also available in the another embodiment of the present embodiment
Some tool-class generate the injection instruction of Mock service end.In addition, Dynamic injection proxy module is receiving the injection of Mock service end
After instruction, Mock service end can be extracted from the information that instruction is injected at Mock service end, then can passed through
Javainstrumentation interface is Mock service end Dynamic injection to electronic device 10.
A4, the interface Mock test request is handled based on the interface Mock simulating, obtains Mock and responds and return
It is back to the test terminal.
Specifically, the interface Mock object can direct interface Mock test request described in simulation process, if described
When interface Mock object is in other task statuses of execution, the Mock test request can also be stored into database, and should
Task identification in Mock test request message (TRM) is sent to the interface Mock object, so that the interface Mock object is according to this
Task identification reads corresponding Mock test request from database.
In one embodiment, after step A4, the Mock test program of more capital's interfaces is executed by the processor
When, also realize following operating procedure:
Mock object is obtained to the implementing result of Mock test request, the place of Mock test request is modified according to implementing result
Reason state.
In the present embodiment, electronic device 10 can also actively obtain Mock object to the execution knot of Mock test request in real time
Processing result actively can be sent to electronic device 10, be connect by electronic device 10 by fruit or Mock object after processing is completed
Receive the implementing result.Implementing result include the result that runs succeeded and execute failure as a result, corresponding processing status is also distinguished
To handle successfully and processing failure, processing status further include to be processed and processing in state.It carries and corresponds in implementing result
The task identification of Mock task, electronic device 10 can identify that the test of Mock corresponding to the implementing result is asked according to the task identification
It asks.By being arranged and modifying the processing status of Mock test request, the management to Mock test assignment can be further standardized, has been mentioned
The convenience of the high management to multiple Mock test assignments.
By above-mentioned thing embodiment it is found that electronic device proposed by the present invention, is connect by receiving the capital that test terminal is sent
Mouthful Mock test request includes capital's interface Mock test information in capital's interface Mock test request;According to capital
Interface Mock test information generates Mock request message to be processed, and the Mock request message includes task identification;According to
Task identification in the Mock request message matches corresponding interface Mock object from built-in Mock object set;Base
In the interface Mock simulating processing interface Mock test request, obtains Mock and respond and be back to the test eventually
End.It is able to solve more capital's interface testings to be obstructed, improves testing efficiency.
In addition, the Mock test program of more capital's interfaces of the invention is different according to the function that its each section is realized, it can
It is described with program module with the same function.It please refers to shown in Fig. 2, is more moneys in one embodiment of electronic device of the present invention
The program module schematic diagram of the Mock test program of square interface.In the present embodiment, the Mock test program foundation of more capital's interfaces
The difference for the function that its each section is realized, can be divided into receiving module 201, generation module 202, matching module 203 with
And return module 204.By above description it is found that the so-called program module of the present invention is the system for referring to complete specific function
Column count machine program instruction section, than program more suitable for describing the Mock test program of more capital's interfaces in electronic device 10
Implementation procedure.The functions or operations step that the module 201-204 is realized is similar as above, and and will not be described here in detail, example
Property, such as wherein:
Receiving module 201 is used to receive capital's interface Mock test request that test terminal is sent, capital's interface
It include capital's interface Mock test information in Mock test request;
Generation module 202, which is used to test information according to capital's interface Mock, generates Mock request message to be processed, described
Mock request message includes task identification;
Matching module 203 is used for according to the task identification in the Mock request message from built-in Mock object set
Match corresponding interface Mock object;
Return module 204 is used to handle the interface Mock test request based on the interface Mock simulating, obtains
Mock is responded and is back to the test terminal.
In addition, the present invention also proposes a kind of Mock test method of more capital's interfaces, please refer to shown in Fig. 3, more moneys
The Mock test method of square interface includes the following steps:
S301, capital's interface Mock test request that test terminal is sent, capital's interface Mock test request are received
In include capital's interface Mock test information.
In the present embodiment, test terminal is the operational terminal for needing to carry out corresponding capital's interface Mock test, and test is eventually
It may be provided with capital's interface Mock administration page on end, and by receiving behaviour of the user on capital's interface Mock administration page
It instructs, generates corresponding capital's interface Mock test information.Further, user can be managed by capital's interface Mock
Page configuration interface message, and automatically generate interface index and stored.Such as in the loan flow testing to financial company,
When needing to test more capital's interfaces, interface message can be carried out by interface of capital's interface Mock administration page to capital to be measured and matched
It sets, generates the interface Mock test information of capital to be measured.It can be to avoid since capital's system testing environment is unstable or response goes out
Problem of being obstructed is tested caused by mistake.
S302, Mock request message to be processed, the Mock request report are generated according to capital's interface Mock test information
Text includes task identification;
Specifically, the interface Mock in the interface Mock test request can be tested to information directly as to be processed
Mock request message, and be that corresponding task identification and the test end by the Mock test request is arranged in the Mock request message
The terminal iidentification at end is also added in the Mock message request, so that Mock object can identify test eventually according to the terminal iidentification
End.
S303, correspondence is matched from built-in Mock object set according to the task identification in the Mock request message
Interface Mock object;
Specifically, in the present embodiment, the preparatory Dynamic injection Mock service end in electronic device, the Mock clothes can be passed through
Business is built-in with Mock object set in end, and the Mock object set is the corresponding relationship between task identification and Mock object
Set, the Mock object in the Mock object set can be electronic device and execute the interior business logic of task and/or outer
Portion's service logic, and its quantity determines according to specific needs.It therefore, can be according to the task identification in the Mock request message
Corresponding interface Mock object is matched, from built-in Mock object set to carry out service analogue.
Further, in this embodiment, the Dynamic injection agency being deployed in the electronic device can be first passed through in advance
Module (agent program), the Mock service end is injected into the electronic device.The Dynamic injection proxy module is available
It is instructed in receiving the injection of Mock service end.In an embodiment of the present embodiment, the Mock service end can first pass through in advance
Default platform is sent to the Dynamic injection proxy module.In the another embodiment of the present embodiment, also using some
Tool-class generates the injection instruction of Mock service end.In addition, Dynamic injection proxy module is receiving the injection instruction of Mock service end
Afterwards, Mock service end can be extracted from the information that instruction is injected at Mock service end, then can passed through
Javainstrumentation interface is Mock service end Dynamic injection to electronic device.
S304, the interface Mock test request is handled based on the interface Mock simulating, obtains Mock response simultaneously
It is back to the test terminal.
Specifically, the interface Mock object can direct interface Mock test request described in simulation process, if described
When interface Mock object is in other task statuses of execution, the Mock test request can also be stored into database, and should
Task identification in Mock test request message (TRM) is sent to the interface Mock object, so that the interface Mock object is according to this
Task identification reads corresponding Mock test request from database.
In one embodiment, further include following steps after step S304:
Mock object is obtained to the implementing result of Mock test request, the place of Mock test request is modified according to implementing result
Reason state.
In the present embodiment, Mock object can be actively obtained in real time to the implementing result of Mock test request or Mock pairs
As that processing result actively can be sent to electronic device after processing is completed, receive the implementing result by electronic device.It executes
As a result include the result that runs succeeded and execute failure as a result, corresponding processing status be also respectively handle successfully with handle mistake
It loses, processing status further includes the state to be processed in processing.The task identification of corresponding Mock task, electricity are carried in implementing result
Sub-device can identify Mock test request corresponding to the implementing result according to the task identification.It is surveyed by being arranged and modifying Mock
The processing status for trying request, can further standardize the management to Mock test assignment, improve to multiple Mock test assignments
Management convenience.
By above-mentioned thing embodiment it is found that the Mock test method of more capital's interfaces proposed by the present invention, is tested by receiving
Capital's interface Mock test request that terminal is sent includes that capital's interface Mock is surveyed in capital's interface Mock test request
Try information;Information is tested according to capital's interface Mock and generates Mock request message to be processed, and the Mock request message includes
There is task identification;It is matched from built-in Mock object set according to the task identification in the Mock request message corresponding
Interface Mock object;Based on the interface Mock simulating processing interface Mock test request, Mock response is obtained simultaneously
It is back to the test terminal.It is able to solve more capital's interface testings to be obstructed, improves testing efficiency.
In addition, the present invention also proposes a kind of computer readable storage medium, stored on the computer readable storage medium
There is the Mock test program of more capital's interfaces, is realized when the Mock test program of more capital's interfaces is executed by processor as follows
Operation:
Capital's interface Mock test request that test terminal is sent is received, includes in capital's interface Mock test request
There is capital's interface Mock to test information;
Information is tested according to capital's interface Mock and generates Mock request message to be processed, and the Mock request message includes
There is task identification;
Corresponding connect is matched from built-in Mock object set according to the task identification in the Mock request message
Mouth Mock object;
Based on the interface Mock simulating processing interface Mock test request, obtains Mock and respond and be back to
The test terminal.
By above-mentioned analysis it is found that computer readable storage medium proposed by the present invention, is sent by receiving test terminal
Capital's interface Mock test request, include capital's interface Mock test information in capital's interface Mock test request;
Information is tested according to capital's interface Mock and generates Mock request message to be processed, and the Mock request message includes task mark
Know;Corresponding interface Mock is matched from built-in Mock object set according to the task identification in the Mock request message
Object;Based on the interface Mock simulating processing interface Mock test request, obtains Mock and respond and be back to institute
State test terminal.It is able to solve more capital's interface testings to be obstructed, improves testing efficiency.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in a storage medium
In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, computer, clothes
Business device, air conditioner or the network equipment etc.) execute method described in each embodiment of the present invention.The above is only of the invention excellent
Embodiment is selected, is not intended to limit the scope of the invention, it is all using made by description of the invention and accompanying drawing content etc.
Structure or equivalent process transformation are imitated, is applied directly or indirectly in other relevant technical fields, and is similarly included in the present invention
Scope of patent protection in.
Claims (10)
1. a kind of electronic device, which is characterized in that the electronic device includes memory and the processing that connect with the memory
Device, the processor are used to execute the Mock test program of the more capital's interfaces stored on the memory, and more capitals connect
The Mock test program of mouth realizes following steps when being executed by the processor:
A1, capital's interface Mock test request that test terminal is sent is received, includes in capital's interface Mock test request
There is capital's interface Mock to test information;
A2, Mock request message to be processed is generated according to capital's interface Mock test information, the Mock request message includes
There is task identification;
A3, corresponding interface is matched from built-in Mock object set according to the task identification in the Mock request message
Mock object;
A4, the interface Mock test request is handled based on the interface Mock simulating, obtains Mock and responds and be back to
The test terminal.
2. electronic device as described in claim 1, which is characterized in that the step A2 includes:
Interface Mock test information in the interface Mock test request is preset as Mock request message to be processed;
Corresponding task identification is arranged to the Mock request message and by the terminal mark of the test terminal of the Mock test request
Knowledge is added in the Mock message request, generates the Mock request message to be processed.
3. electronic device as described in claim 1, which is characterized in that in the step A3, the Mock object set is
The set of corresponding relationship between task identification and Mock object, the Mock object are the service logic of execution task.
4. electronic device as described in claim 1, which is characterized in that described to be based on the interface in the step A4
Mock simulating handles the step of interface Mock test request, comprising:
Interface Mock test request described in the direct simulation process of interface Mock object, if at the interface Mock object
In executing other task statuses, then the Mock test request is stored into database, and will be in the Mock test request message (TRM)
Task identification be sent to the interface Mock object so that the interface Mock object is according to the task identification, from database
It is middle to read corresponding Mock test request.
5. the electronic device as described in claim 1-4 is any, which is characterized in that the Mock test program of more capital's interfaces
When being executed by the processor, following steps are also realized:
Mock object is obtained to the implementing result of Mock test request, the place of Mock test request is modified according to the implementing result
Reason state.
6. a kind of Mock test method of more capital's interfaces, which is characterized in that described method includes following steps:
S1, capital's interface Mock test request that test terminal is sent is received, includes in capital's interface Mock test request
There is capital's interface Mock to test information;
S2, Mock request message to be processed is generated according to capital's interface Mock test information, the Mock request message includes
There is task identification;
S3, corresponding interface is matched from built-in Mock object set according to the task identification in the Mock request message
Mock object;
S4, the interface Mock test request is handled based on the interface Mock simulating, obtains Mock and responds and be back to
The test terminal.
7. the Mock test method of more capital's interfaces as claimed in claim 6, which is characterized in that include: in the step S2
Interface Mock test information in the interface Mock test request is preset as Mock request message to be processed;
Corresponding task identification is arranged to the Mock request message and by the terminal mark of the test terminal of the Mock test request
Knowledge is added in the Mock message request, generates the Mock request message to be processed.
8. the Mock test method of more capital's interfaces as claimed in claim 6, which is characterized in that in the step S3, institute
The set that Mock object set is the corresponding relationship between task identification and Mock object is stated, the Mock object is execution task
Service logic.
9. the Mock test method of more capital's interfaces as claimed in claim 6, which is characterized in that in the step S4, institute
State the step of interface Mock test request is handled based on the interface Mock simulating, comprising:
Interface Mock test request described in the direct simulation process of interface Mock object, if at the interface Mock object
In executing other task statuses, then the Mock test request is stored into database, and will be in the Mock test request message (TRM)
Task identification be sent to the interface Mock object so that the interface Mock object is according to the task identification, from database
It is middle to read corresponding Mock test request.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has the Mock of more capital's interfaces to survey
Program is tried, the Mock test program of more capital's interfaces can execute by least one processor, so that described at least one
The step of managing the Mock test method of more capital's interfaces of the device execution as described in any one of claim 6-9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910316533.3A CN110191013A (en) | 2019-04-19 | 2019-04-19 | Electronic device, the Mock test method of more capital's interfaces and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910316533.3A CN110191013A (en) | 2019-04-19 | 2019-04-19 | Electronic device, the Mock test method of more capital's interfaces and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110191013A true CN110191013A (en) | 2019-08-30 |
Family
ID=67714784
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910316533.3A Pending CN110191013A (en) | 2019-04-19 | 2019-04-19 | Electronic device, the Mock test method of more capital's interfaces and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110191013A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112019558A (en) * | 2020-09-03 | 2020-12-01 | 深圳壹账通智能科技有限公司 | Universal baffle testing method, device, equipment and computer storage medium |
CN113630468A (en) * | 2021-08-16 | 2021-11-09 | 上海观安信息技术股份有限公司 | Dynamic proxy method |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106528400A (en) * | 2016-09-22 | 2017-03-22 | 深圳峰创智诚科技有限公司 | MOCK testing method and device |
CN106970873A (en) * | 2017-01-10 | 2017-07-21 | 阿里巴巴集团控股有限公司 | Mock method of testings, apparatus and system on line |
CN107179984A (en) * | 2016-03-10 | 2017-09-19 | 北京京东尚科信息技术有限公司 | A kind of interface mock methods and interface test method |
CN108427644A (en) * | 2018-03-27 | 2018-08-21 | 深圳市买买提信息科技有限公司 | Service test method, service testing system and service testing device |
CN109446075A (en) * | 2018-09-30 | 2019-03-08 | 北京金山安全软件有限公司 | Interface testing method and device |
-
2019
- 2019-04-19 CN CN201910316533.3A patent/CN110191013A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107179984A (en) * | 2016-03-10 | 2017-09-19 | 北京京东尚科信息技术有限公司 | A kind of interface mock methods and interface test method |
CN106528400A (en) * | 2016-09-22 | 2017-03-22 | 深圳峰创智诚科技有限公司 | MOCK testing method and device |
CN106970873A (en) * | 2017-01-10 | 2017-07-21 | 阿里巴巴集团控股有限公司 | Mock method of testings, apparatus and system on line |
CN108427644A (en) * | 2018-03-27 | 2018-08-21 | 深圳市买买提信息科技有限公司 | Service test method, service testing system and service testing device |
CN109446075A (en) * | 2018-09-30 | 2019-03-08 | 北京金山安全软件有限公司 | Interface testing method and device |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112019558A (en) * | 2020-09-03 | 2020-12-01 | 深圳壹账通智能科技有限公司 | Universal baffle testing method, device, equipment and computer storage medium |
CN113630468A (en) * | 2021-08-16 | 2021-11-09 | 上海观安信息技术股份有限公司 | Dynamic proxy method |
CN113630468B (en) * | 2021-08-16 | 2023-12-22 | 上海观安信息技术股份有限公司 | Dynamic proxy method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109558290B (en) | Server, interface automatic test method and storage medium | |
CN110058999A (en) | Electronic device, application exception localization method and storage medium | |
CN109634841A (en) | Electronic device, automatic interface testing method and storage medium | |
CN108427644A (en) | Service test method, service testing system and service testing device | |
CN105303112B (en) | The detection method and device of component call loophole | |
CN109302522A (en) | Test method, device and computer system and medium | |
CN105787364B (en) | Automatic testing method, device and system for tasks | |
CN101502047B (en) | A method and system for storing configuration information for network nodes in a network management system | |
CN113672441B (en) | Method and device for testing intelligent equipment | |
CN110287093A (en) | Mobile terminal, data-interface test method and storage medium | |
CN105589805B (en) | Method and device for generating code coverage rate report | |
US8855961B2 (en) | Binary definition files | |
CN107526676B (en) | Cross-system test method and device | |
CN107958365B (en) | Material information changing method and device, storage medium and electronic equipment | |
CN110069177A (en) | Electronic device, application program guiding method of operating and storage medium | |
CN109634813A (en) | Electronic device, cloud platform exception confirmation method and storage medium | |
CN110163481A (en) | Electronic device, user's air control auditing system test method and storage medium | |
CN111190825A (en) | Automatic test method, system and robot | |
CN109684073A (en) | Electronic device, cloud service resource allocation methods and storage medium | |
CN109144869A (en) | Automated testing method, device, computer equipment and storage medium | |
CN110191013A (en) | Electronic device, the Mock test method of more capital's interfaces and storage medium | |
CN112631924A (en) | Automatic testing method and device, computer equipment and storage medium | |
CN114116078A (en) | Application data processing method, device, equipment and medium based on micro front end | |
CN115827436A (en) | Data processing method, device, equipment and storage medium | |
CN109683856A (en) | Electronic device, Faas stage function creation method and storage medium |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190830 |
|
RJ01 | Rejection of invention patent application after publication |