Declare test methods in different styles in Junit5
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.Test
class Test{
@Test
fun itShouldPass(){}
@Test
fun it_should_pass(){}
@Test
fun `it should pass`(){}
@Test
@DisplayName("it should pass")
fun test(){}
}
Use test method signature that works best for you and your team. To have test names more readable, consider putting test method name in `backticks`, or use @DisplayName annotation
Enjoy KotlinTesting.com quick tips?
Share it to fellow developers on social media!