1
|
/**
|
2
|
* Copyright (C) 2009 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
|
10
|
package eu.etaxonomy.cdm.persistence.dao.hibernate.common;
|
11
|
|
12
|
import static org.junit.Assert.assertEquals;
|
13
|
import static org.junit.Assert.assertNotNull;
|
14
|
|
15
|
import java.lang.reflect.Array;
|
16
|
|
17
|
import org.junit.Test;
|
18
|
import org.unitils.dbunit.annotation.DataSet;
|
19
|
import org.unitils.spring.annotation.SpringBeanByType;
|
20
|
|
21
|
import eu.etaxonomy.cdm.model.common.User;
|
22
|
import eu.etaxonomy.cdm.persistence.dao.common.IUserDao;
|
23
|
import eu.etaxonomy.cdm.test.integration.CdmIntegrationTest;
|
24
|
|
25
|
@DataSet
|
26
|
public class UserDaoHibernateImplTest extends CdmIntegrationTest {
|
27
|
|
28
|
@SpringBeanByType
|
29
|
IUserDao userDao;
|
30
|
|
31
|
@Test
|
32
|
public void testFindUserByUsername() {
|
33
|
User user = userDao.findUserByUsername("test");
|
34
|
|
35
|
assertNotNull("findUserByUsername should return a user", user);
|
36
|
assertEquals("the user should have had their authorities loaded",2,user.getAuthorities().size());
|
37
|
}
|
38
|
|
39
|
}
|