public class JUnitParameterizedTestExtractor extends Object implements TestNameExtractor
For Junit 4 Parameterized Tests
Returns a test name template of the test from a
@Parameters(name = "{a} is equal {b}") annotation.
Requirements:
@RunWith(org.junit.runners.Parameterized.class)"public static Collection<Object[]> data()" annotated
with "@Parameters(name = "{index}: * sort[{0}]={1}")"For Junit 5 Parameterized Tests
Returns test's display name of the test from a @ParameterizedTest annotation.
Requirements:
@ParameterizedTest annotation."@ArgumentsProvider
via @ArgumentsSource or a corresponding composed annotation"| Constructor and Description |
|---|
JUnitParameterizedTestExtractor() |
| Modifier and Type | Method and Description |
|---|---|
String |
getTestNameForMethod(MethodInfo methodInfo)
Returns name of the test corresponding with this test method or
null if such test name could not be
determined. |
static boolean |
isJUnit5ParameterizedTest(MethodSignature methodSignature)
Checks if the given
methodSignature parameter is annotated with @ParameterizedTest annotation. |
static boolean |
isParameterizedClass(ModifiersInfo modifiers) |
@Nullable public String getTestNameForMethod(@NotNull MethodInfo methodInfo)
TestNameExtractornull if such test name could not be
determined.getTestNameForMethod in interface TestNameExtractormethodInfo - test method for which we look for a test namenull if not foundpublic static boolean isParameterizedClass(ModifiersInfo modifiers)
public static boolean isJUnit5ParameterizedTest(@NotNull
MethodSignature methodSignature)
methodSignature parameter is annotated with @ParameterizedTest annotation.methodSignature - Method to check for @ParameterizedTest annotationtrue if the given method is annoted with @ParameterizedTest annotation else falseCopyright © 2024 OpenClover.org. All rights reserved.