Micro-service automatic testing method based on Redis database

An automated testing and database technology, applied in electrical digital data processing, software testing/debugging, error detection/correction, etc., can solve problems such as inflexible baffle programs, separate deployment of baffle programs, and inability to return specific responses, etc. The effect of saving development time and deployment cost, flexible use of scenarios, and convenient writing

Pending Publication Date: 2019-08-20
SICHUAN XW BANK CO LTD
View PDF12 Cites 5 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

But using the baffle program itself has significant limitations
First of all, the bezel program itself is not flexible enough. The result returned by calling the bezel program is a static result, and it is impossible to return a specific answer according to different inputs.
Second, when the in

Method used

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

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Micro-service automatic testing method based on Redis database
  • Micro-service automatic testing method based on Redis database
  • Micro-service automatic testing method based on Redis database

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0023] Such as figure 1 Shown the present invention is based on the microservice automatic testing method of Redis database, comprises:

[0024] A. Set the Mock annotation for the AOP method (aspect-oriented programming, extension of OOP) that needs to be called by the remote service. The Mock annotation class includes the parameter key used to obtain the data in the Redis database, and the corresponding AOP method The remote service name is service, and the remote service name service is used to mark whether the AOP method is allowed to be tested by Mock; the main code is:

[0025]

[0026]

[0027] B. Set the Remote annotation class associated with the class signature to mark the method that contains the remote call in this class; the main code is:

[0028] 1. @Target(ElementType. TYPE)

[0029] 2. @Retention(RetentionPolicy. RUNTIME)

[0030] 3. @Documented

[0031] 4. public@interface Remote{

[0032] 5.}

[0033] C. Switch configuration for Mock test:

[0034]...

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

PUM

No PUM Login to view more

Abstract

The invention relates to a micro-service automatic testing method based on a Redis database. The method comprises the steps of A, setting a Mock annotation for an AOP method needing to be called by aremote service, wherein the Mock annotation class comprises a parameter key used for obtaining data in a Redis database and a remote service name corresponding to the AOP method, and the remote service name is used for marking whether the AOP method is allowed to be tested by Mock or not; B, setting a Remote annotation class associated with the class signature, wherein the Remote annotation classis used for marking a method containing remote calling in the class; and C, setting interception classes used for intercepting all the remote calling AOP methods, and returning corresponding differentresults according to the judgment whether the called AOP method allows the Mock test or not. According to the invention, the micro-service can be subjected to dynamic Mock test, the test flexibilityis greatly improved, and the cost and difficulty of developing a test program are remarkably reduced.

Description

technical field [0001] The invention relates to a testing method of an application program component, in particular to a microservice automatic testing method based on a Redis database. Background technique [0002] In the field of Internet distributed technology, the architecture model of microservices has gradually occupied the mainstream position. After the application module is split into microservices, the dependencies and collaboration network between services become intricate. How to improve the testability of microservices with external dependencies will directly affect the cycle and quality of software delivery. [0003] In the existing microservice testing technology, the way of developing interface baffle program is often used to solve the external dependency problem. But using the baffle procedure itself has significant limitations. First of all, the baffle program itself is not flexible enough. The result returned by calling the baffle program is a static resu...

Claims

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

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F11/36
CPCG06F11/3684G06F11/3688Y02D10/00
Inventor 李家鹏
Owner SICHUAN XW BANK CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products