Package org.mitre.openid.connect.model

Examples of org.mitre.openid.connect.model.UserInfo


    Mockito.when(userInfoRepository.getByUsername(regularUsername)).thenReturn(userInfoRegular);

    Mockito.verify(pairwiseIdentiferService, Mockito.never()).getIdentifier(Matchers.any(UserInfo.class), Matchers.any(ClientDetailsEntity.class));

    UserInfo user1 = service.getByUsernameAndClientId(regularUsername, publicClientId1);
    UserInfo user2 = service.getByUsernameAndClientId(regularUsername, publicClientId2);

    assertEquals(regularSub, user1.getSub());
    assertEquals(regularSub, user2.getSub());
  }
View Full Code Here


    Mockito.when(clientDetailsEntityService.loadClientByClientId(pairwiseClientId4)).thenReturn(pairwiseClient4);

    Mockito.when(userInfoRepository.getByUsername(regularUsername)).thenAnswer(new Answer<UserInfo>() {
      @Override
      public UserInfo answer(InvocationOnMock invocation) throws Throwable {
        UserInfo userInfo = new DefaultUserInfo();
        userInfo.setPreferredUsername(regularUsername);
        userInfo.setSub(regularSub);

        return userInfo;
      }
    });

    Mockito.when(pairwiseIdentiferService.getIdentifier(userInfoRegular, pairwiseClient1)).thenReturn(pairwiseSub12);
    Mockito.when(pairwiseIdentiferService.getIdentifier(userInfoRegular, pairwiseClient2)).thenReturn(pairwiseSub12);
    Mockito.when(pairwiseIdentiferService.getIdentifier(userInfoRegular, pairwiseClient3)).thenReturn(pairwiseSub3);
    Mockito.when(pairwiseIdentiferService.getIdentifier(userInfoRegular, pairwiseClient4)).thenReturn(pairwiseSub4);

    UserInfo user1 = service.getByUsernameAndClientId(regularUsername, pairwiseClientId1);
    UserInfo user2 = service.getByUsernameAndClientId(regularUsername, pairwiseClientId2);
    UserInfo user3 = service.getByUsernameAndClientId(regularUsername, pairwiseClientId3);
    UserInfo user4 = service.getByUsernameAndClientId(regularUsername, pairwiseClientId4);

    assertEquals(pairwiseSub12, user1.getSub());
    assertEquals(pairwiseSub12, user2.getSub());
    assertEquals(pairwiseSub3, user3.getSub());
    assertEquals(pairwiseSub4, user4.getSub());

  }
View Full Code Here

TOP

Related Classes of org.mitre.openid.connect.model.UserInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.