junit-json-params
junit-json-params copied to clipboard
Suport method automatic parameter conversions
I'm of two minds on this on whether to shade the JsonP library.
Rather than having to manually pull keys and values out of a JsonObject parameter, It might be neat to support automatically filling parameters. E.g:
@ParameterizedTest
@JsonSource("{'itemA':'1','itemB':'2'}")
void test(int itemA, String itemB) {
assertEquals(1, itemA);
assertEquals("2", itemB);
}
This would require pulling the parameter names of the test method from the execution context, and a major version bump to 2.0.0 due to a non compatible change in the public interface.
Decided not to shade the library for now, as I assume a test dependency is usually fairly simple to satisfy (where a production one might be less so). I will do the other part of this (enable automatically filling parameters, but currently have to resort to annotations for this to work.
See https://github.com/joshka/junit-json-params/issues/177