junitparams.naming
Annotation Type TestCaseName


@Retention(value=RUNTIME)
public @interface TestCaseName

Use this annotation to specify the name for individual test case.


Optional Element Summary
 String value
          A template of the individual test case name.
 

value

public abstract String value
A template of the individual test case name. This template can contain macros, which will be substituted by their actual values at runtime.

Supported macros are:

Lets assume, that we are testing Fibonacci sequence generator. We have a test with the following signature

 @Parameters({ "0,1", "8,34" })
 public void testFibonacci(int indexInSequence, int expectedNumber) { ... }
 
Here are some examples, that can be used as a test name template:

Default:
"{method}({params}) [{index}]"


Copyright © 2017 Pragmatists. All rights reserved.