use of org.wso2.carbon.apimgt.core.dao.UserMappingDAO in project carbon-apimgt by wso2.
the class UserDataMappingImplTestCase method testGetIdOfUser.
@Test
public void testGetIdOfUser() throws Exception {
UserMappingDAO userMappingDAO = Mockito.mock(UserMappingDAO.class);
Mockito.when(userMappingDAO.getPseudoNameByUserID("test_user")).thenReturn("XXXXX");
UserNameMapper userNameMapper = new UserNameMapperImpl(userMappingDAO);
String pseudoName = userNameMapper.getLoggedInPseudoNameFromUserID("test_user");
Assert.assertNotNull(pseudoName);
Assert.assertEquals("XXXXX", pseudoName);
userNameMapper.getLoggedInUserIDFromPseudoName("XXXXX");
}
use of org.wso2.carbon.apimgt.core.dao.UserMappingDAO in project carbon-apimgt by wso2.
the class UserMappingDAOImplIT method testUserNameMapping.
@Test(description = "Get user name mapping test")
public void testUserNameMapping() throws APIManagementException {
UserMappingDAO userMappingDAO = DAOFactory.getUserMappingDAO();
String pseudoName = userMappingDAO.getPseudoNameByUserID("test_user");
Assert.assertNotNull(pseudoName);
Assert.assertTrue(userMappingDAO.getUserIDByPseudoName(pseudoName).equalsIgnoreCase("test_user"));
}
Aggregations