AssertJ assertion step integration for Allure Java.
io.qameta.allure:allure-assertj
val aspectjAgent by configurations.creating
dependencies {
testImplementation(platform("io.qameta.allure:allure-bom:<allure-version>"))
testImplementation("io.qameta.allure:allure-assertj")
testRuntimeOnly("org.aspectj:aspectjrt:<aspectj-version>")
aspectjAgent("org.aspectj:aspectjweaver:<aspectj-version>")
}
tasks.test {
doFirst {
jvmArgs("-javaagent:${aspectjAgent.singleFile}")
}
}Enable the AspectJ weaver for the test JVM. The module weaves AssertJ calls and reports assertion chains as Allure steps.
- Works with AssertJ
Assertions.assertThat(...)and BDDthen(...)entry points. - Failed assertions update the corresponding Allure step status.
- For large classpaths, limit weaving with
META-INF/aop.xml.