Closed vtintillier closed 8 months ago
Hey @vtintillier - I'm happy for you to make a PR with those changes in it. I'm not sure if they'll solve your problem. You may also need SystemProperties
to be a generic type which takes the subclass type as a parameter to pass down to the impl. Unless you're planning to make MySystemProperties subclass the Impl class instead.
Do you need to subclass SystemProperties in your code? What does that achieve? Composition might be easier. You can create your own system stub objects if you inherit the right interface and have a default constructor...
However, that's potentially off-topic. Please submit the PR and I'll do my best to approve and release it.
Hi @ashleyfrieze
I'm not sure if they'll solve your problem. You may also need SystemProperties to be a generic type which takes the subclass type as a parameter to pass down to the impl. Unless you're planning to make MySystemProperties subclass the Impl class instead.
In fact, in our case, we just need to get a SystemProperties
instance, not our own type. Really just need to have chained methods return the public type and not the Impl
one.
Do you need to subclass SystemProperties in your code? What does that achieve? Composition might be easier. You can create your own system stub objects if you inherit the right interface and have a default constructor...
I think it was historically done like that in our codebase because we migrated from the ProvideSystemProperty
rule from system-rules
, where we extended that JUnit 4 rule. Indeed now with SystemProperties
we could just have some shared method returning a SystemProperties
instead of our own class.
But still method chaining would need fixing.
@vtintillier - thanks for your contribution. I've initiated a release process. The 2.1.6 version should be live in a few hours.
Hello,
This was working before but no longer does:
This is due to the introduction of
SystemPropertiesImpl
and moving theset
implementation there (in #75).It seems given how
SystemPropertiesImpl
is used, we could fix the issue (and the same issue mentioned here), by doing this:Would you agree to this?
Thanks
Thanks a lot.