← 输入框|github.com|刷新
Skip to content

Get treatments - #278

Merged
ldecheverz-split merged 13 commits into
redis-v2from
get-treatments
Dec 14, 2021
Merged

ldecheverz-split merged 13 commits into
redis-v2from
get-treatments

Conversation

@ldecheverz-split

Copy link
Copy Markdown
Contributor

No description provided.

@ldecheverz-split
ldecheverz-split merged commit ecb2198 into redis-v2 Dec 14, 2021
@stil4m

stil4m commented Jan 20, 2022

Copy link
Copy Markdown

@ldecheverz-split This change removed the AlwaysReturnControlSplitClient.java. What is the expected upgrade path if you are using this?

@ldecheverz-split

Copy link
Copy Markdown
Contributor Author

Hi Mats!
First of all, sorry for the inconvenience. This class should not be part of our Public API. That's the reason we removed it. In case you are using this class for testing, we have a module for it where you can use a class named SpliClientForTest. This class allows you to also add particular treatments result if you want or by default returning CONTROL:

SplitClientForTest splitClientForTest= new SplitClientForTest(); 
String controlTreatment = splitClientForTest.getTreatment("myKey", "mySplit");

Another option is to mock interactions with the SDK via Mockito:

    MyApp myApp = new MyApp(Mockito.mock(SplitClient.class));

    Mockito.when(client.getTreatment(Mockito.anyString(), Mockito.anyString())).thenReturn("CONTROL");

    //Calling method that checks treatments

    myApp.interactWithSplit();

If none of these options work for your use case we would be interested in diving a bit deeper into it. If this is the case it would be great if you can contact us via support@split.io to discuss and potentially book a call.
Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants