mirror of
https://github.com/alibaba/testable-mock.git
synced 2026-08-19 09:43:29 +08:00
2.1 KiB
2.1 KiB
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/
Loadmap
TestableMock is still under heavy development, the following version plans may be adjusted during the iteration
v0.4it's the current version, refer to the issue list for the work in progressv0.5implementation mock class inherit mechanism, so that the same mock method can be reused between test classes convenientlyv0.6narrows the default effective scope of mock methods to the class under test, to avoid interaction of mocking cross classesv1.0all functions are stable, a brand-new start
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
TestableMockdocument is generated bydocsifytool, please install nodejs before execution, and runnpm install -g docsifycommand to install the tool required.