I use JUnit4 with JUnitParams for testing and I want to know more about the usage of the @TestCaseName annotation. I understand the usage of @TestCaseName with the @Parameters annotation, but I want to know about how to use @TestCaseName with the @FileParmeters annotation.
Usage of @TestCaseName with @FileParameters in JUnitParams
412 views Asked by Balaji Senthil At
1
@TestCaseNameallows you to modify how the name of the test case is presented in reports (eg. in your IDE or in the Maven Surefire report). The default naming is{method}({params}) [{index}]. You can use placeholders to create your own test case names. See Javadoc ofjunitparams.naming.TestCaseName#value:@FileParametersdoes not have any relation to@TestCaseName- it's simply a way to provide parameters to a test method from a file. Using the example above, instead of@Parametersyou could use@FileParameters("/path/to/file.txt")and have a/path/to/file.txtwith contentto achieve the same results.