这是一个示例方法,解释了我想要做什么。
public void myMethod(Method m){
report = new ExtentReports("filename");
test = report.startTest("testName");
String actual = "sssssss";
String expected = "xxxxxxxx";
// what I can do with AssertJ id have a nice readable test
assertThat(actual).isEqualTo(expected).withFailMessage("BOINK!");
// what I can do with ExtentReports
if (!actual.equals(expected)) test.log(LogStatus.FAIL, "BOINK");
// what I want to extend assertJ to do
assertThat(actual).isEqualTo(expected).extentLog(test, LogStatus.FAIL, "BOINK");
}
我的问题是如何用另一个动作扩展 AssertJ, .extentLog(args) 方法?谢谢