JUnit test description

In JUnit 5, there is @DisplayName annotation:

@DisplayName is used to declare a custom display name for the annotated test class or test method. Display names are typically used for test reporting in IDEs and build tools and may contain spaces, special characters, and even emoji.

Example:

@Test
@DisplayName("Test if true holds")
public void checkTrue() {
    assertEquals(true, true);
}

TestNG does it like this, which to me is the neatest solution:

@Test(description="My funky test")  
public void testFunk() {  
    ...  
}  

See http://testng.org/javadocs/org/testng/annotations/Test.html for more information.


Not exactly what you are looking for, but you can provide a description on any assert methods.

Something like:

@Test
public void testTrue() {
    assertTrue("Testing if true holds", true);
}