Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get treatments #278

Merged
merged 13 commits into from
Dec 14, 2021
Merged

Get treatments #278

merged 13 commits into from
Dec 14, 2021

Conversation

ldecheverz-split
Copy link
Contributor

No description provided.

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

stil4m commented Jan 20, 2022

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

@ldecheverz-split
Copy link
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.

None yet

3 participants