Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Make FeatureFlagsState builder public #234

Closed
kimayap03 opened this issue Jun 8, 2021 · 6 comments
Closed

Make FeatureFlagsState builder public #234

kimayap03 opened this issue Jun 8, 2021 · 6 comments

Comments

@kimayap03
Copy link

Is your feature request related to a problem? Please describe.
I have some functionality which calls LDClient's getAllFlags api, and gets the FeatureFlagsState. I would like to unit test it.
Since the builder is not public, I am unable to create fake FeatureFlagsState object for unit testing.

Describe the solution you'd like
Please make FeatureFlagsState builder public
https://github.com/launchdarkly/java-server-sdk/compare/master...kimayap03:patch-1?expand=1

Describe alternatives you've considered
No workaround for unit testing.

@eli-darkly
Copy link
Contributor

That's reasonable, and I believe we've already done it in other SDKs. We'll need to make the public API a little different than what it's using internally now, so as not to be referencing implementation details like Evaluator.EvalResult.

@kimayap03
Copy link
Author

kimayap03 commented Jun 8, 2021

Thank you! Is it possible to provide approx ETA?

@eli-darkly
Copy link
Contributor

As we have many SDK development projects ongoing, all I can really say is that we've got it on our list of planned improvements and will try to get it into the next minor version release of this SDK, as soon as it's possible for us to do such a release. It's not a very difficult task, so the writing of the code itself is not the problem and contributing a PR would not speed things up.

This was referenced Jul 2, 2021
@Hazz223
Copy link

Hazz223 commented Aug 4, 2021

Hi! We've just run into the same issue on our team. We have a wrapping class around LD so would like to unit test it. However, we discovered in version 5.6.1 that while the builder is now public, the .build() method isn't and so we cannot build FeatureFlagsState for our testing.
Just wanted to highlight and add our vote for this improvement, as it would be great to have.

Thanks again for all your hard work; we really like using Launch Darkly.

@eli-darkly
Copy link
Contributor

@Hazz223 Oh dear. Well, that's easy enough to fix, but a bit embarrassing. Thanks for pointing it out; we'll fix ASAP.

(I guess that's always a risk of having unit tests be in the same package that they're testing)

@eli-darkly
Copy link
Contributor

@Hazz223 This is fixed in the 5.6.2 release.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants