Skip to content

Commit

Permalink
🎨 fix: 생성자 수정에 따른 테스트 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
woosung1223 committed Sep 29, 2024
1 parent cf2a3d5 commit 8f90124
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class EventServiceTest {
void 연월로_이벤트를_조회할__있다() {
// given
LocalDate baseDate = LocalDate.of(2024, 9, 15);
User user1 = new User("name", baseDate, "introduction", "picture_url");
User user2 = new User("name", baseDate.minus(1, ChronoUnit.DAYS), "introduction", "picture_url");
User user1 = new User("name", baseDate, "introduction", "picture_url", null);
User user2 = new User("name", baseDate.minus(1, ChronoUnit.DAYS), "introduction", "picture_url", null);
Event event1 = new Event("name", baseDate, EventType.BIRTHDAY, "description", user1);
Event event2 = new Event("name", baseDate.minus(1, ChronoUnit.DAYS), EventType.BIRTHDAY, "description", user2);

Expand All @@ -65,8 +65,8 @@ class EventServiceTest {
// given
LocalDate baseDate = LocalDate.of(2024, 9, 15);
LocalDate beforeDate = LocalDate.of(2023, 9, 15);
User user1 = new User("name", baseDate, "introduction", "picture_url");
User user2 = new User("name", beforeDate, "introduction", "picture_url");
User user1 = new User("name", baseDate, "introduction", "picture_url", null);
User user2 = new User("name", beforeDate, "introduction", "picture_url", null);
Event event1 = new Event("name", baseDate, EventType.BIRTHDAY, "description", user1);
Event event2 = new Event("name", beforeDate, EventType.BIRTHDAY, "description", user2);

Expand All @@ -91,8 +91,8 @@ class EventServiceTest {
// given
LocalDate baseDate = LocalDate.of(2024, 9, 15);
LocalDate beforeDate = LocalDate.of(2024, 8, 15);
User user1 = new User("name", baseDate, "introduction", "picture_url");
User user2 = new User("name", beforeDate, "introduction", "picture_url");
User user1 = new User("name", baseDate, "introduction", "picture_url", null);
User user2 = new User("name", beforeDate, "introduction", "picture_url", null);
Event event1 = new Event("name", baseDate, EventType.BIRTHDAY, "description", user1);
Event event2 = new Event("name", beforeDate, EventType.BIRTHDAY, "description", user2);

Expand All @@ -117,8 +117,8 @@ class EventServiceTest {
// given
LocalDate baseDate = LocalDate.of(2024, 9, 15);
LocalDate beforeDate = LocalDate.of(2024, 8, 15);
User user1 = new User("name", baseDate, "introduction", "picture_url");
User user2 = new User("name", beforeDate, "introduction", "picture_url");
User user1 = new User("name", baseDate, "introduction", "picture_url", null);
User user2 = new User("name", beforeDate, "introduction", "picture_url", null);
Event event1 = new Event("name", baseDate, EventType.BIRTHDAY, "description", user1);
Event event2 = new Event("name", beforeDate, EventType.BIRTHDAY, "description", user2);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.springframework.transaction.annotation.Transactional;
import slvtwn.khu.toyouserver.domain.Group;
import slvtwn.khu.toyouserver.domain.Member;
import slvtwn.khu.toyouserver.domain.SocialAuthProvider;
import slvtwn.khu.toyouserver.domain.User;
import slvtwn.khu.toyouserver.dto.GroupCreateRequest;
import slvtwn.khu.toyouserver.dto.GroupMemberResponse;
Expand Down Expand Up @@ -49,7 +50,7 @@ class GroupServiceTest {
@Test
void 유저는_그룹에_가입할__있다() {
// given
User user = new User("name", LocalDate.now(), "introduction", "profile_pic");
User user = new User("name", LocalDate.now(), "introduction", "profile_pic", null);
Group group = new Group("group_name");

entityManager.persist(user);
Expand All @@ -63,7 +64,7 @@ class GroupServiceTest {
@Test
void 그룹이_존재하지_않는다면_가입이_능하다() {
// given
User user = new User("name", LocalDate.now(), "introduction", "profile_pic");
User user = new User("name", LocalDate.now(), "introduction", "profile_pic", null);
long groupIdNonExists = 1L;

entityManager.persist(user);
Expand All @@ -76,8 +77,8 @@ class GroupServiceTest {
@Test
void 그룹에_속한_멤버들을_찾을__있다() {
// given
User user1 = new User("name1", LocalDate.now(), "introduction", "profile_pic");
User user2 = new User("name2", LocalDate.now(), "introduction", "profile_pic");
User user1 = new User("name1", LocalDate.now(), "introduction", "profile_pic", null);
User user2 = new User("name2", LocalDate.now(), "introduction", "profile_pic", null);

Group group = new Group("group_name");

Expand All @@ -101,7 +102,7 @@ class GroupServiceTest {
@Test
void 유저는_가입한_그룹을_조회할__있다() {
// given
User user = new User("name", LocalDate.now(), "introduction", "profile_pic");
User user = new User("name", LocalDate.now(), "introduction", "profile_pic", null);
Group group1 = new Group("group_name1");
Group group2 = new Group("group_name2");
Member member1 = new Member(user, group1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import slvtwn.khu.toyouserver.domain.Group;
import slvtwn.khu.toyouserver.domain.Member;
import slvtwn.khu.toyouserver.domain.RollingPaper;
import slvtwn.khu.toyouserver.domain.SocialAuthProvider;
import slvtwn.khu.toyouserver.domain.User;
import slvtwn.khu.toyouserver.dto.CoverRequest;
import slvtwn.khu.toyouserver.dto.RollingPaperRequest;
Expand All @@ -44,7 +45,7 @@ class RollingPaperServiceTest {
void 커버_이미지를_생성하면_롤링페이퍼_커버가_업데이트된다() {
// given
Group group = new Group("name");
User user = new User("name", LocalDate.now(), "introduction", "profile_picture");
User user = new User("name", LocalDate.now(), "introduction", "profile_picture", null);
Member member = new Member(user, group);
RollingPaper rollingPaper = new RollingPaper(null, "title", "content", 1L, member);

Expand All @@ -70,8 +71,8 @@ class RollingPaperServiceTest {
void 롤링페이퍼를_전송할__있다() {
// given
Group group = new Group("name");
User user1 = new User("name", LocalDate.now(), "introduction", "profile_picture");
User user2 = new User("name", LocalDate.now(), "introduction", "profile_picture");
User user1 = new User("name", LocalDate.now(), "introduction", "profile_picture", null);
User user2 = new User("name", LocalDate.now(), "introduction", "profile_picture", null);
Member member1 = new Member(user1, group);
Member member2 = new Member(user2, group);

Expand All @@ -94,7 +95,7 @@ class RollingPaperServiceTest {
void 롤링페이퍼를_조회할__있다() {
// given
Group group = new Group("name");
User user = new User("name", LocalDate.now(), "introduction", "profile_picture");
User user = new User("name", LocalDate.now(), "introduction", "profile_picture", null);
Member member = new Member(user, group);
RollingPaper rollingPaper = new RollingPaper(null, "title", "content", 1L, member);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class UserServiceTest {
@Test
void 같은_그룹의_유저들을_키워드로_검색할__있다() {
// given
User user1 = new User("name1", LocalDate.now(), "introduction", "profile_picture");
User user2 = new User("name2", LocalDate.now(), "introduction", "profile_picture");
User user1 = new User("name1", LocalDate.now(), "introduction", "profile_picture", null);
User user2 = new User("name2", LocalDate.now(), "introduction", "profile_picture", null);
Group group = new Group("name");
Member member1 = new Member(user1, group);
Member member2 = new Member(user2, group);
Expand All @@ -57,8 +57,8 @@ class UserServiceTest {
@Test
void 다른_그룹의_유저들을_키워드로_검색할__있다() {
// given
User user1 = new User("name1", LocalDate.now(), "introduction", "profile_picture");
User user2 = new User("name2", LocalDate.now(), "introduction", "profile_picture");
User user1 = new User("name1", LocalDate.now(), "introduction", "profile_picture", null);
User user2 = new User("name2", LocalDate.now(), "introduction", "profile_picture", null);
Group group1 = new Group("name");
Group group2 = new Group("name");
Member member1 = new Member(user1, group1);
Expand All @@ -82,7 +82,7 @@ class UserServiceTest {
@Test
void 유저_정보를_업데이트___있다() {
// given
User user = new User("name", LocalDate.now(), "introduction", "profile_picture");
User user = new User("name", LocalDate.now(), "introduction", "profile_picture", null);
Group group1 = new Group("name");
Group group2 = new Group("name");
Member member = new Member(user, group1);
Expand All @@ -101,7 +101,7 @@ class UserServiceTest {
userService.updateUser(user.getId(), request);

// then
User expectedUser = new User(request.name(), request.birthday(), request.introduction(), request.imageUrl());
User expectedUser = new User(request.name(), request.birthday(), request.introduction(), request.imageUrl(), null);

assertThat(user).usingRecursiveComparison()
.ignoringFields("id", "createdDate", "lastModifiedDate")
Expand Down

0 comments on commit 8f90124

Please sign in to comment.