Mockito.stub(p.getName()).toReturn("alreadylogged"); //$NON-NLS-1$
HashSet<Principal> principals = new HashSet<Principal>();
principals.add(p);
Subject subject = new Subject(false, principals, new HashSet(), new HashSet());
SecurityHelper sh = Mockito.mock(SecurityHelper.class);
Mockito.stub(sh.getSubjectInContext("passthrough")).toReturn(subject); //$NON-NLS-1$
TeiidLoginContext membershipService = new TeiidLoginContext(sh) {
public LoginContext createLoginContext(String domain, CallbackHandler handler) throws LoginException {
LoginContext context = Mockito.mock(LoginContext.class);
return context;