Last active
December 24, 2015 10:19
-
-
Save youknowjack/6783121 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.google.common.base.Suppliers; | |
import org.example.proctor.ExampleGroups; | |
import org.example.proctor.ExampleGroupsManager; | |
import com.indeed.proctor.common.*; | |
import com.indeed.proctor.common.model.*; | |
... | |
public ExampleGroups getTestGroups(final Proctor proctor, final String userId, | |
final HttpServletRequest request, final HttpServletResponse response) { | |
final ExampleGroupsManager groupsManager = new ExampleGroupsManager(Suppliers.ofInstance(proctor)); | |
final Identifiers identifiers = new Identifiers(TestType.USER, userId); | |
final boolean allowForceGroups = true; // normally you'd only want this to be true in "privileged" conditions | |
final ProctorResult result = groupsManager.determineBuckets( | |
request, response, identifiers, allowForceGroups); | |
final ExampleGroups groups = new ExampleGroups(result); | |
return groups; | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment