换种思路写Mock,让单元测试更简单
Go to file
2021-12-17 14:39:20 +08:00
demo release v0.7.2 2021-12-17 14:39:20 +08:00
docs release v0.7.2 2021-12-17 14:39:20 +08:00
testable-agent release v0.7.2 2021-12-17 14:39:20 +08:00
testable-all release v0.7.2 2021-12-17 14:39:20 +08:00
testable-core release v0.7.2 2021-12-17 14:39:20 +08:00
testable-maven-plugin release v0.7.2 2021-12-17 14:39:20 +08:00
testable-parent release v0.7.2 2021-12-17 14:39:20 +08:00
testable-processor release v0.7.2 2021-12-17 14:39:20 +08:00
tool small fix for android demo 2021-05-03 09:30:23 +08:00
.gitignore add a tiny demo for spock 2021-04-04 15:31:18 +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 use MockInvoke and MockNew 2021-11-03 11:44:44 +08:00
README.md add upgrade guide for 0.7.0 2021-11-07 11:06:37 +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 @MockInvoke annotation, everything is done.

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

Roadmap

TestableMock is still under heavy development, the following version plans may be adjusted during the iteration

  • v0.6 it's the current version, refer to the issue list for the work in progress
  • v0.7 better anti-refactoring support of mocking, allow quick mock all method in specified class
  • v1.0 all 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
|-- tool                  ➜ Scripts for project maintain
|-- 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.