Corrections de UserManagerTest : tout en vert
This commit is contained in:
@@ -54,7 +54,10 @@ public class UserManagerTest {
|
|||||||
@Before
|
@Before
|
||||||
public void setup()throws PKAlreadyUsedException, UserEMailAlreadyExistsException{
|
public void setup()throws PKAlreadyUsedException, UserEMailAlreadyExistsException{
|
||||||
if(!um.exists("truc")){
|
if(!um.exists("truc")){
|
||||||
um.addUser("truc",User.hashPassword("pw"),"maxime","dagn","ipint", "e@e.fr");
|
um.addUser("truc",User.hashPassword("pw"),"maxime","dagn","ipint", "e@ee.fr");
|
||||||
|
}
|
||||||
|
if(!um.exists("admin")){
|
||||||
|
um.addUser("admin",User.hashPassword("pw"),"Admin","Admin","ipint", "admin@ee.fr");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,7 +82,7 @@ public class UserManagerTest {
|
|||||||
assertFalse(list.isEmpty());
|
assertFalse(list.isEmpty());
|
||||||
Speciality spe = list.get(list.size()-1);
|
Speciality spe = list.get(list.size()-1);
|
||||||
assertEquals("xml", spe.getName());
|
assertEquals("xml", spe.getName());
|
||||||
//test que l'on ne peut pas ajouter 2 fois la meme specialit<69>
|
//test que l'on ne peut pas ajouter 2 fois la meme specialit<69>
|
||||||
int size = list.size();
|
int size = list.size();
|
||||||
um.addSpeciality("xml");
|
um.addSpeciality("xml");
|
||||||
list = um.getSpecialities();
|
list = um.getSpecialities();
|
||||||
@@ -105,7 +108,7 @@ public class UserManagerTest {
|
|||||||
Speciality spe = list.get(list.size()-1);
|
Speciality spe = list.get(list.size()-1);
|
||||||
um.addSpecialityToUser(spe.getId(), "truc");
|
um.addSpecialityToUser(spe.getId(), "truc");
|
||||||
um.removeSpecialityFromUser(spe.getId(), "truc");
|
um.removeSpecialityFromUser(spe.getId(), "truc");
|
||||||
assertTrue(list.isEmpty());
|
assertTrue(um.getSpecialities().isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -139,10 +142,13 @@ public class UserManagerTest {
|
|||||||
cm.addRole(RoleType.PCMEMBER, "truc", conf_id);
|
cm.addRole(RoleType.PCMEMBER, "truc", conf_id);
|
||||||
Article article = am.addArticle("title","topic","url_article","truc",
|
Article article = am.addArticle("title","topic","url_article","truc",
|
||||||
new ArrayList<String>(),Article.State.SUBMITED,conf_id);
|
new ArrayList<String>(),Article.State.SUBMITED,conf_id);
|
||||||
am.delegateArticleToReferee(article.getId(), "truc", "max");
|
am.delegateArticleToReferee(article.getId(), "truc", "admin");
|
||||||
List <User> list = um.getRefereesOFPCMemberForArticle("max",article.getId());
|
List <User> list = um.getRefereesOfPcMemberForArticle("admin",article.getId());
|
||||||
assertFalse("liste vide",list.isEmpty());
|
assertFalse("liste vide",list.isEmpty());
|
||||||
assertEquals("truc",list.get(list.size()-1).getLogin());
|
assertEquals("truc",list.get(list.size()-1).getLogin());
|
||||||
|
am.undelegateArticleToReferee(article.getId(), "truc", "admin");
|
||||||
|
list = um.getRefereesOfPcMemberForArticle("admin",article.getId());
|
||||||
|
assertTrue("liste non vide",list.isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -151,6 +157,9 @@ public class UserManagerTest {
|
|||||||
if(um.exists("truc")){
|
if(um.exists("truc")){
|
||||||
um.removeUser("truc");
|
um.removeUser("truc");
|
||||||
}
|
}
|
||||||
|
if(um.exists("admin")){
|
||||||
|
um.removeUser("admin");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user