Search in sources :

Example 11 with Tag

use of wooteco.prolog.studylog.domain.Tag in project prolog by woowacourse.

the class TagRepositoryTest method findByNameValueIn.

@DisplayName("name 리스트로 Tag 리스트 검색 - 성공")
@Test
void findByNameValueIn() {
    // given
    String name1 = "나는 말하는 감자";
    String name2 = "나는 춤추는 고구마";
    String name3 = "나는 꿈꾸는 옥수수";
    Tag tag1 = 태그를_생성한다(name1);
    Tag tag2 = 태그를_생성한다(name2);
    Tag tag3 = 태그를_생성한다(name3);
    List<String> names = Arrays.asList(name1, name2, name3);
    // when
    List<Tag> tags = tagRepository.findByNameValueIn(names);
    // then
    assertThat(tags).usingFieldByFieldElementComparator().containsExactlyInAnyOrder(tag1, tag2, tag3);
}
Also used : Tag(wooteco.prolog.studylog.domain.Tag) Test(org.junit.jupiter.api.Test) RepositoryTest(wooteco.support.utils.RepositoryTest) DisplayName(org.junit.jupiter.api.DisplayName)

Aggregations

Tag (wooteco.prolog.studylog.domain.Tag)11 DisplayName (org.junit.jupiter.api.DisplayName)10 Test (org.junit.jupiter.api.Test)10 StudylogTag (wooteco.prolog.studylog.domain.StudylogTag)9 RepositoryTest (wooteco.support.utils.RepositoryTest)8 Member (wooteco.prolog.member.domain.Member)5 Mission (wooteco.prolog.session.domain.Mission)4 Session (wooteco.prolog.session.domain.Session)4 Studylog (wooteco.prolog.studylog.domain.Studylog)4 MemberTag (wooteco.prolog.member.domain.MemberTag)1 MemberTags (wooteco.prolog.member.domain.MemberTags)1