AssertJ摘要

来源:互联网 发布:淘宝贷款入口在哪里 编辑:程序博客网 时间:2024/04/30 14:58

AssertJ使用指南:

整理自AssertJ官网

重要概念

  • Assertion Generator
    自动生成Assert类
    • 模板(类,方法)
      定义生成的类或方法的格式
    • 构建
      Generator
      这里写图片描述
      生成Assert类的方法
  • Assert类
    模板生成或者使用API
  • 入口类
    工厂类,用于产生不同类型的Assert类
  • SoftAssert

    Using soft assertions, AssertJ collects all assertion errors instead of stopping at the first one.
    JUnitSoftAssertions:use in JUnit

  • Condition

    Assertions provided by AssertJ can be extended by using conditions

  • Highlight

  • API
    UriAssert,ListAssert,DateAssert,MapAssert,Condition

QuickStart
Gradle
testCompile 'org.assertj:assertj-core:2.2.0'

0 0
原创粉丝点击