use of org.icij.datashare.text.Tag in project datashare by ICIJ.
the class JooqRepositoryTest method test_get_group_tag_of_document.
@Test
public void test_get_group_tag_of_document() {
Date creationDate = new Date();
repository.tag(project("prj"), asList("doc1", "doc2"), new Tag("tag", new User("foo"), creationDate));
assertThat(repository.getTags(project("prj"), "doc1")).contains(tag("tag"));
assertThat(repository.getTags(project("prj"), "doc2")).contains(tag("tag"));
}
use of org.icij.datashare.text.Tag in project datashare by ICIJ.
the class JooqRepositoryTest method test_get_tags_of_document.
@Test
public void test_get_tags_of_document() {
Date creationDate = new Date();
assertThat(repository.tag(project("prj"), "doc_id", tag("tag1"), new Tag("tag2", new User("foo"), creationDate))).isTrue();
assertThat(repository.getTags(project("prj"), "doc_id")).contains(tag("tag1"), tag("tag2"));
assertThat(repository.getTags(project("unknown"), "doc_id")).isEmpty();
assertThat(repository.getTags(project("prj"), "doc_id").get(0).user).isEqualTo(nullUser());
assertThat(repository.getTags(project("prj"), "doc_id").get(0).creationDate).isNotNull();
assertThat(repository.getTags(project("prj"), "doc_id").get(1).user).isEqualTo(new User("foo"));
assertThat(repository.getTags(project("prj"), "doc_id").get(1).creationDate).isEqualTo(creationDate);
}
Aggregations