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.
xxxxxxxxxx
1
import org.junit.jupiter.api.Test;
2
import org.junit.jupiter.api.DisplayName;
3
4
public class ClassName {
5
6
// ...
7
8
9
"Test description here ...") (
10
public void methodName() {
11
// ...
12
}
13
14
// ...
15
}
0 commentsShow commentsAdd comment