Pragmatists/JUnitParams

Force parameters method to be static

ypconstante opened this issue · 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

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.

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?

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