Skip to content

Instantly share code, notes, and snippets.

@youknowjack
Last active December 24, 2015 10:19
Show Gist options
  • Save youknowjack/6783121 to your computer and use it in GitHub Desktop.
Save youknowjack/6783121 to your computer and use it in GitHub Desktop.
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