mirror of
https://github.com/alibaba/testable-mock.git
synced 2024-12-25 20:30:41 +08:00
换种思路写Mock,让单元测试更简单
demo | ||
docs | ||
testable-agent | ||
testable-all | ||
testable-core | ||
testable-maven-plugin | ||
testable-parent | ||
testable-processor | ||
tool | ||
.gitignore | ||
LICENSE | ||
pom.xml | ||
README_EN.md | ||
README.md |
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 @MockInvoke
annotation, everything is done.
Usage Document: https://alibaba.github.io/testable-mock/#/en-us/
Roadmap
TestableMock
is still under heavy development, if you get sucked somehow, just go ahead raise an issue for it.
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
|-- tool ➜ Scripts for project maintain
|-- demo
| |-- java-demo ➜ Java code example
| |-- kotlin-demo ➜ Kotlin code example
| |-- android-demo ➜ Android app code example
| `-- spock-demo ➜ Spock framwork 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 bydocsify
tool, please install nodejs before execution, and runnpm install -g docsify
command to install the tool required.