9.2. spring-restdocs-asciidoctor

我在百度找了很多资料,基本上都是对官网文档的翻译,或则是很古老的版本; 这次是spring boot2版本;

其实原理很简单:

  • 使用mockMvc进行测试用例的编写
  • 增加文档的配置描述
  • 使用插件把文档api生成的.adoc文件转换成 html

github教程示例项目: https://github.com/zq99299/spring-restdocs-example

学习这个的使用有几点别搞混了:

  1. asciidoctor 和 markdown 类似,与gitbook更类似,都是需要转换器进行转换
  2. 无侵入源代码,只是在测试用例的时候 附加生成文档
© All Rights Reserved            updated 2019-01-22 06:20:44

results matching ""

    No results matching ""