EN
JUnit 5 - how to add text description to test method?
1
answers
6
points
I am looking for easy way to add custom text description for executed test methods. When test fails or successes, I want to see my own text instead of generated one.
Is there some extension or parameter to get it?
1 answer
5
points
Use @DisplayName annotation.
e.g.
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.DisplayName;
public class ClassName {
// ...
@Test
@DisplayName("Test description here ...")
public void methodName() {
// ...
}
// ...
}
0 comments
Add comment