Can you add a custom message to AssertJ assertThat?

前端 未结 4 1558
北海茫月
北海茫月 2020-12-24 04:17

We have a test suite that primarily uses JUnit assertions with Hamcrest matchers. One of our team started experimenting with AssertJ and impressed people with its syntax, fl

4条回答
  •  无人及你
    2020-12-24 05:06

    Use the inbuilt as() method in AssertJ. For example:

     assertThat(myTest).as("The test microservice is not active").isEqualTo("active");
    

提交回复
热议问题