use of org.nextprot.api.user.domain.UserProteinList in project nextprot-api by calipho-sib.
the class UserProteinListUtilsTest method testCombineNotIn2.
@Test
public void testCombineNotIn2() {
UserProteinList l1 = createUserProteinList("cool1", Sets.newHashSet("NX_P123", "NX_P456"));
UserProteinList l2 = createUserProteinList("cool2", Sets.newHashSet("NX_P123", "NX_P321"));
UserProteinList l3 = UserProteinListUtils.combine(l2, l1, UserProteinListService.Operator.NOT_IN, "bobleponge", "rap", null);
assertEquals("rap", l3.getName());
assertEquals(1, l3.getAccessionNumbers().size());
assertEquals("bobleponge", l3.getOwner());
assertEquals("NX_P321", l3.getAccessionNumbers().iterator().next());
}
use of org.nextprot.api.user.domain.UserProteinList in project nextprot-api by calipho-sib.
the class UserProteinListUtilsTest method testCombineNotIn.
@Test
public void testCombineNotIn() {
UserProteinList l1 = createUserProteinList("cool1", Sets.newHashSet("NX_P123", "NX_P456"));
UserProteinList l2 = createUserProteinList("cool2", Sets.newHashSet("NX_P123", "NX_P321"));
UserProteinList l3 = UserProteinListUtils.combine(l1, l2, UserProteinListService.Operator.NOT_IN, "bobleponge", "rap", null);
assertEquals("rap", l3.getName());
assertEquals(1, l3.getAccessionNumbers().size());
assertEquals("bobleponge", l3.getOwner());
assertEquals("NX_P456", l3.getAccessionNumbers().iterator().next());
}
use of org.nextprot.api.user.domain.UserProteinList in project nextprot-api by calipho-sib.
the class UserProteinListUtilsTest method testCombineAndEmptySetThrowsException.
@Test(expected = NextProtException.class)
public void testCombineAndEmptySetThrowsException() {
UserProteinList l1 = createUserProteinList("cool1", Sets.newHashSet("NX_P123", "NX_P456"));
UserProteinList l2 = createUserProteinList("cool2", Sets.newHashSet("NX_P124", "NX_P455"));
UserProteinListUtils.combine(l1, l2, UserProteinListService.Operator.AND, "bobleponge", "coolio", null);
}
use of org.nextprot.api.user.domain.UserProteinList in project nextprot-api by calipho-sib.
the class UserResourceAuthorizationServiceTest method testUpdateUserProteinListService.
@Test
public void testUpdateUserProteinListService() {
UserProteinList proteinList = Mockito.mock(UserProteinList.class);
dressMockedUserProteinList(proteinList, "bobleponge");
Mockito.when(userProteinListDao.getUserProteinListById(anyLong())).thenReturn(proteinList);
userProteinListService.updateUserProteinList(proteinList);
}
use of org.nextprot.api.user.domain.UserProteinList in project nextprot-api by calipho-sib.
the class UserResourceAuthorizationServiceTest method testUpdateUserProteinListService2.
@Test(expected = NotAuthorizedException.class)
public void testUpdateUserProteinListService2() {
UserProteinList proteinList = Mockito.mock(UserProteinList.class);
dressMockedUserProteinList(proteinList, "bobbylapointe");
Mockito.when(userProteinListDao.getUserProteinListById(anyLong())).thenReturn(proteinList);
userProteinListService.updateUserProteinList(proteinList);
}
Aggregations