JUnit Jupiter assertion step integration for Allure Java.
io.qameta.allure:allure-jupiter-assert
val aspectjAgent by configurations.creating
dependencies {
testImplementation(platform("io.qameta.allure:allure-bom:<allure-version>"))
testImplementation("io.qameta.allure:allure-jupiter")
testImplementation("io.qameta.allure:allure-jupiter-assert")
testRuntimeOnly("org.aspectj:aspectjrt:<aspectj-version>")
aspectjAgent("org.aspectj:aspectjweaver:<aspectj-version>")
}
tasks.test {
useJUnitPlatform()
doFirst {
jvmArgs("-javaagent:${aspectjAgent.singleFile}")
}
}Enable the AspectJ weaver for the test JVM. The module weaves JUnit Jupiter assertions and reports them as nested Allure steps.
- Use this only when assertion-level reporting is desired.
allure-jupiteris enough for ordinary JUnit Jupiter reporting. - The old
allure-junit5-assertalias is removed in Allure Java 3.x. - For large classpaths, consider an AspectJ
META-INF/aop.xmlthat limits weaving to Allure, JUnit, and your test packages.