换种思路写Mock,让单元测试更简单
Go to file
2021-01-04 23:31:58 +08:00
demo add demo for private method without argument 2020-12-31 20:40:42 +08:00
docs add code example for MOCK_CONTEXT in doc 2021-01-03 22:54:38 +08:00
testable-agent also fit for EnhancerBySpringCGLIB 2021-01-02 19:47:12 +08:00
testable-all release version 0.4.7 2020-12-31 07:30:21 +08:00
testable-core add targetClass parameter 2021-01-04 23:31:58 +08:00
testable-maven-plugin release version 0.4.7 2020-12-31 07:30:21 +08:00
testable-parent release version 0.4.7 2020-12-31 07:30:21 +08:00
testable-processor release version 0.4.7 2020-12-31 07:30:21 +08:00
.gitignore add a gradle demo 2020-11-28 22:51:09 +08:00
LICENSE opensourced with MIT license 2020-11-10 14:12:25 +08:00
pom.xml extra common configure to parent pom 2020-12-08 16:22:14 +08:00
README_EN.md complete the english doc 2020-12-24 16:14:18 +08:00
README.md update docs 2021-01-03 21:44:16 +08:00

TestableMock

Write mock faster, make unit testing easier.

Any test framework, no initialization, no matter private method, static method, construction method, or any other method of any class, and no matter how the object created. Write a mock method, add an @MockMethod annotation, everything is done.

Usage Document: https://alibaba.github.io/testable-mock/#/en-us/

Directory Structure

|-- testable-parent       ➜ Provide parent pom file shared by other modules
|-- testable-all          ➜ Dependence aggration, for easily import all modules at once
|-- testable-processor    ➜ Compile-time code preprocessing module, provides test assist functions
|-- testable-agent        ➜ JavaAgent module, provides test mocking related functions
|-- testable-core         ➜ Basic function module, provides mock related class and annotation
|-- testable-maven-plugin ➜ Maven plugin module, for simplify JavaAgent injection
|-- demo
|   |-- java-demo         ➜ Java code example
|   `-- kotlin-demo       ➜ Kotlin code example
`-- docs                  ➜ Source code of usage document

Build project

The project is built using JDK 1.6+ and Maven 3+, except for the demo sub-project requires JDK 1.8+.

mvn clean install

Generate document

docsify serve docs

TestableMock document is generated by docsify tool, please install nodejs before execution, and run npm install -g docsify command to install the tool required.