-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Weekly/11/Test/Like] LikeControllerUnitTest 생성 (#141)
* test: Event Unit Test 리팩터링 * feat: Like 리팩터링 * feat: LikeData 추가 * test: LikeControllerUnitTest 생성
- Loading branch information
Showing
10 changed files
with
699 additions
and
282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/main/java/org/ktc2/cokaen/wouldyouin/like/application/dto/LikeResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
package org.ktc2.cokaen.wouldyouin.like.api.dto; | ||
|
||
import java.util.List; | ||
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import org.ktc2.cokaen.wouldyouin.member.persist.LikeableMember; | ||
|
||
@Getter | ||
@RequiredArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Builder | ||
public class LikeResponse { | ||
|
||
private final Long memberId; | ||
private final String nickname; | ||
private final String intro; | ||
private final List<String> hashtags; | ||
private final String profileImageUrl; | ||
|
||
public static LikeResponse from(LikeableMember member) { | ||
return LikeResponse.builder() | ||
.memberId(member.getId()) | ||
.nickname(member.getNickname()) | ||
.intro(member.getIntro()) | ||
.hashtags(member.getHashtags()) | ||
.profileImageUrl(member.getProfileImageUrl()) | ||
.build(); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/org/ktc2/cokaen/wouldyouin/like/application/dto/LikeToggleResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.ktc2.cokaen.wouldyouin.like.application.dto; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
import org.ktc2.cokaen.wouldyouin.member.persist.LikeableMember; | ||
|
||
@Getter | ||
@RequiredArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Builder | ||
public class LikeToggleResponse { | ||
private final boolean isLiked; | ||
|
||
public static LikeToggleResponse from(boolean state) { | ||
return LikeToggleResponse.builder() | ||
.isLiked(state) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.