Support keys and configs in SplitClientForTest#596
Support keys and configs in SplitClientForTest#596GreyTeardrop wants to merge 3 commits intosplitio:masterfrom
Conversation
SplitClientForTest can be useful for unit-testing code that depends on SplitClient, especially in dynamic scenarios where a static config per test class won't work. As of now, SplitClientForTest doesn't support customization of split keys or configs - it always returns the same treatment for all keys of a feature flag and always returns null as a split config. This change extends SplitClientForTest, so it's possible to set treatments for each feature flag and key, and also possible to set split config in addition to the treatment name.
|
@chillaq is this a change you might be interested in reviewing? |
|
@nmayorsplit any chance you could take a look at this change? |
|
Hello @GreyTeardrop ! I'm Nico from Harness FME and I work with the SDK team. First of all I'd like to apologize for the lack of response from our end. Then also thank you for your contribution! I agree this would be useful for unit testing and a good addition to this submodule. Most likely will ask the team to make a few changes like avoiding the type change on the return for .tests() method for backwards compatibility and once we have it in good shape, we'll most likely merge it in! Once more, thank you for your contribution and feedback! Best regards, |
Fix compatibility for the SplitClientForTest.tests() method. Keep it with the old signature, expose new complete mappings via testMappings() method.
|
Thank you, @NicoZelaya! I've adjusted the code a bit to keep it as compatible as possible. There should no longer be breaking changes in method signatures. There's technically still a potentially breaking change, as previously |
SplitClientForTestcan be useful for unit-testing code that depends onSplitClient, especially in dynamic scenarios where a static config per test class won't work. As of now,SplitClientForTestdoesn't support customization of split keys or configs - it always returns the same treatment for all keys of a feature flag and always returns null as a split config.This change extends
SplitClientForTest, so it's possible to set treatments for each feature flag and key, and also possible to set split config in addition to the treatment name.