diff --git a/backend/src/test/java/com/festago/bookmark/application/SchoolBookmarkV1QueryServiceTest.java b/backend/src/test/java/com/festago/bookmark/application/SchoolBookmarkV1QueryServiceTest.java index 15f526194..ad3fe34cc 100644 --- a/backend/src/test/java/com/festago/bookmark/application/SchoolBookmarkV1QueryServiceTest.java +++ b/backend/src/test/java/com/festago/bookmark/application/SchoolBookmarkV1QueryServiceTest.java @@ -1,11 +1,14 @@ package com.festago.bookmark.application; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.SoftAssertions.assertSoftly; import com.festago.bookmark.domain.Bookmark; import com.festago.bookmark.domain.BookmarkType; +import com.festago.bookmark.dto.v1.SchoolBookmarkV1Response; import com.festago.bookmark.repository.BookmarkRepository; import com.festago.member.repository.MemberRepository; +import com.festago.school.dto.v1.SchoolSearchV1Response; import com.festago.school.repository.SchoolRepository; import com.festago.support.ApplicationIntegrationTest; import com.festago.support.MemberFixture; @@ -37,13 +40,11 @@ class SchoolBookmarkV1QueryServiceTest extends ApplicationIntegrationTest { var 회원A_ID = saveMember("socialId_A"); var 회원B_ID = saveMember("socialId_B"); - var 학교A_ID = saveSchool("A대학교", "a.ac.kr"); - var 학교B_ID = saveSchool("B대학교", "b.ac.kr"); - var 학교C_ID = saveSchool("C대학교", "c.ac.kr"); + var 학교A_ID = saveSchool("A대학교", "a.ac.kr", "https://www.festago.com/A.png"); + var 학교B_ID = saveSchool("B대학교", "b.ac.kr", "https://www.festago.com/B.png"); saveBookmark(학교A_ID, 회원A_ID); saveBookmark(학교B_ID, 회원A_ID); - saveBookmark(학교C_ID, 회원A_ID); saveBookmark(학교A_ID, 회원B_ID); saveBookmark(학교B_ID, 회원B_ID); @@ -52,7 +53,15 @@ class SchoolBookmarkV1QueryServiceTest extends ApplicationIntegrationTest { var actual = schoolBookmarkV1QueryService.findAllByMemberId(회원A_ID); // then - assertThat(actual).hasSize(3); + assertSoftly(softly -> { + softly.assertThat(actual).hasSize(2); + softly.assertThat(actual).allSatisfy(it -> assertThat(it).hasNoNullFieldsOrProperties()); + softly.assertThat(actual).map(SchoolBookmarkV1Response::school) + .containsExactly( + new SchoolSearchV1Response(학교A_ID, "A대학교", "https://www.festago.com/A.png"), + new SchoolSearchV1Response(학교B_ID, "B대학교", "https://www.festago.com/B.png") + ); + }); } private Long saveMember(String socialId) { @@ -61,10 +70,11 @@ private Long saveMember(String socialId) { .build()).getId(); } - private Long saveSchool(String name, String domain) { + private Long saveSchool(String name, String domain, String logoUrl) { return schoolRepository.save(SchoolFixture.school() .name(name) .domain(domain) + .logoUrl(logoUrl) .build()).getId(); }