use of org.nextprot.api.user.domain.UserProteinList in project nextprot-api by calipho-sib.
the class UserProteinListDaoTest method testCreateUserProteinListAccessions.
@Test
public void testCreateUserProteinListAccessions() {
proteinListDao.createUserProteinListItems(156, Sets.newHashSet("prot1", "prot2"));
UserProteinList list = proteinListDao.getUserProteinListById(156);
assertExpectedProteinList(list, 156, "mylist", "my proteins", username, 23, 5, Sets.newHashSet("NX_Q14249", "NX_Q8N5Z0", "NX_P05165", "prot1", "prot2"), "ZZZZZU8V");
}
use of org.nextprot.api.user.domain.UserProteinList in project nextprot-api by calipho-sib.
the class UserProteinListDaoTest method testGetUserProteinListByPublicId.
@Test
public void testGetUserProteinListByPublicId() {
UserProteinList list = proteinListDao.getUserProteinListByPublicId("ZZZZZU8V");
assertExpectedProteinList(list, 156, "mylist", "my proteins", username, 23, 3, Sets.newHashSet("NX_Q14249", "NX_Q8N5Z0", "NX_P05165"), "ZZZZZU8V");
}
use of org.nextprot.api.user.domain.UserProteinList in project nextprot-api by calipho-sib.
the class UserProteinListDaoTest method testGetUserProteinListByName.
@Test
public void testGetUserProteinListByName() {
UserProteinList list = proteinListDao.getUserProteinListByName(username, "mylist");
assertNotNull(list);
assertExpectedProteinList(list, 156, "mylist", "my proteins", username, 23, 3, Sets.newHashSet("NX_Q14249", "NX_Q8N5Z0", "NX_P05165"), "ZZZZZU8V");
}
use of org.nextprot.api.user.domain.UserProteinList in project nextprot-api by calipho-sib.
the class UserProteinListDaoTest method testCreate2UserProteinListsWithDuplicatePublicIdFail.
@Test(expected = DuplicateKeyException.class)
public void testCreate2UserProteinListsWithDuplicatePublicIdFail() {
UserProteinList list = new UserProteinList();
list.setOwnerId(24);
list.setPublicId("00000001");
long id = proteinListDao.createUserProteinList(list);
assertTrue(id > 0);
list = new UserProteinList();
list.setOwnerId(124);
list.setPublicId("00000001");
proteinListDao.createUserProteinList(list);
}
use of org.nextprot.api.user.domain.UserProteinList in project nextprot-api by calipho-sib.
the class UserProteinListDaoTest method testUpdateUserProteinList.
@Test
public void testUpdateUserProteinList() {
UserProteinList l = new UserProteinList();
l.setId(156);
l.setName("ma liste");
l.setDescription("la liste de bob leponge");
proteinListDao.updateUserProteinListMetadata(l);
UserProteinList l2 = proteinListDao.getUserProteinListById(l.getId());
assertTrue(156 == l2.getId());
assertEquals(l.getName(), l2.getName());
assertEquals(l.getDescription(), l2.getDescription());
}
Aggregations