Closed shafty023 closed 3 years ago
Hi Daniel,
At the moment, your workaround seems to be the best solution for getting a null
value, but I agree it's not ideal.
The following change would make it a lot easier to test for null values:
@Test
fun someTest(@TestParameter(value = ["null", "", "foo"]) param: String) {
// "null" wouldn't be interpreted as String but as null value
...
}
I've implemented this and I'm now re-running all Google tests to see if any existing code is relying on a "null" string being "null". If this turns out to work, I'll push it onto a new release.
This change has been released in v1.3
@nymanjens Thanks! This is exactly what I needed. You rock.
Any tips/suggestions for getting null as a value? I know JSR won't allow null to be passed in because it's not a constant but is there any clean way of doing it besides generating my own TestParameterValuesProvider for every parameter that needs to support null?