use of org.nextprot.api.user.domain.UserQuery in project nextprot-api by calipho-sib.
the class UserQueryDaoTest method testGetUserQueryById.
@Test
public void testGetUserQueryById() {
UserQuery userQuery = userQueryDao.getUserQueryById(15);
assertExpectedUserQuery(userQuery, 15, "spongebob", "myquery", "my first query", false, "sparql query", "00000001", new HashSet<String>());
}
use of org.nextprot.api.user.domain.UserQuery in project nextprot-api by calipho-sib.
the class UserQueryDaoTest method testDeleteUserQueryTags2.
@Test
public void testDeleteUserQueryTags2() {
Set<String> accs = new HashSet<String>();
accs.add("pim");
accs.add("pam");
accs.add("poum");
int count = userQueryDao.deleteUserQueryTags(16, accs);
UserQuery query = userQueryDao.getUserQueryById(16);
assertEquals(0, count);
assertExpectedUserQuery(query, 16, "spongebob", "myquery2", "my second query", true, "another sparql query", "ZZZZZU8V", Sets.newHashSet("public"));
}
use of org.nextprot.api.user.domain.UserQuery in project nextprot-api by calipho-sib.
the class UserQueryDaoTest method testCreateUserQueryAllField.
@Test
public void testCreateUserQueryAllField() {
UserQuery query = new UserQuery();
query.setTitle("ma requete");
query.setDescription("une simple requete");
query.setSparql("yet another sparql query");
query.setPublished(true);
query.setPublicId("00000003");
query.setOwnerId(24);
long id = userQueryDao.createUserQuery(query);
assertTrue(id > 0);
UserQuery query2 = userQueryDao.getUserQueryById(id);
assertExpectedUserQuery(query2, id, "tahitibob", "ma requete", "une simple requete", true, "yet another sparql query", "00000003", Sets.<String>newHashSet());
}
use of org.nextprot.api.user.domain.UserQuery in project nextprot-api by calipho-sib.
the class UserQueryServiceTest method createUserQuery.
public static UserQuery createUserQuery(String title, String desc, String sparql, boolean published) {
UserQuery query = new UserQuery();
query.setTitle(title);
query.setDescription(desc);
query.setSparql(sparql);
query.setPublished(published);
return query;
}
use of org.nextprot.api.user.domain.UserQuery in project nextprot-api by calipho-sib.
the class UserQueryServiceTest method testCreateUserQuery.
@Test
public void testCreateUserQuery() {
final UserQuery userQuery = createUserQuery("ma requete", "une simple requete", "yet another sparql query", true);
dressMockedUserQueryDao(userQuery, 10);
UserQuery created = userQueryService.createUserQuery(userQuery);
assertEquals(10, created.getUserQueryId());
assertEquals("ma requete", created.getTitle());
Mockito.verify(stringGenerator, times(1)).generateString();
}
Aggregations