JUnitParams icon indicating copy to clipboard operation
JUnitParams copied to clipboard

Force parameters method to be static

Open ypconstante opened this issue 7 years ago • 3 comments

It would be interesting if JUnitParams had some way to force all or to configure the method used as source of the parameters to be static, making it easier to users to prepare for the migration to JUnit 5 @MethodSource

ypconstante avatar Sep 29 '17 15:09 ypconstante

I guess you want to point out all the places where you don't have static methods by some failing tests to be sure that all places are ready to migration. Unfortunately we miss such feature.

zbychupragmatists avatar Oct 30 '17 13:10 zbychupragmatists

I've made a custom annotation to implement this behavior using the junitparams.custom.CustomParameters annotation. Currently it's not the most beautiful code because I had to copy a lot of code from ParamsFromMethodCommon, but it works like the JUnit 5 equivalent. Should I make a pull request or there is no plan to add this kind of functionality to JUnitParams?

ypconstante avatar Oct 30 '17 19:10 ypconstante

Please make a pull request and we will see how it looks.

zbychupragmatists avatar Oct 31 '17 08:10 zbychupragmatists