diff --git a/backend/baton/src/main/java/touch/baton/domain/common/exception/ClientErrorCode.java b/backend/baton/src/main/java/touch/baton/domain/common/exception/ClientErrorCode.java index 44f1e229a..4b172e3c2 100644 --- a/backend/baton/src/main/java/touch/baton/domain/common/exception/ClientErrorCode.java +++ b/backend/baton/src/main/java/touch/baton/domain/common/exception/ClientErrorCode.java @@ -25,7 +25,7 @@ public enum ClientErrorCode { JWT_SIGNATURE_IS_WRONG(HttpStatus.BAD_REQUEST, "JW001", "시그니처가 다른 잘못된 JWT 입니다."), JWT_FORM_IS_WRONG(HttpStatus.BAD_REQUEST, "JW002", "잘못 생성된 JWT 로 디코딩 할 수 없습니다."), JWT_CLAIM_IS_WRONG(HttpStatus.BAD_REQUEST, "JW003", "JWT 에 기대한 정보를 모두 포함하고 있지 않습니다."), - JWT_CLAIM_EMAIL_IS_WRONG(HttpStatus.BAD_REQUEST, "JW004", "사용자의 잘못된 이메일 정보를 가진 JWT 입니다."); + JWT_CLAIM_SOCIAL_ID_IS_WRONG(HttpStatus.BAD_REQUEST, "JW004", "사용자의 잘못된 소셜 아이디(SocialId) 정보를 가진 JWT 입니다."); private final HttpStatus httpStatus; private final String errorCode; diff --git a/backend/baton/src/main/java/touch/baton/domain/member/Member.java b/backend/baton/src/main/java/touch/baton/domain/member/Member.java index 1837de092..0734b5e51 100644 --- a/backend/baton/src/main/java/touch/baton/domain/member/Member.java +++ b/backend/baton/src/main/java/touch/baton/domain/member/Member.java @@ -10,7 +10,7 @@ import touch.baton.domain.common.BaseEntity; import touch.baton.domain.member.exception.MemberDomainException; import touch.baton.domain.member.vo.Company; -import touch.baton.domain.member.vo.Email; +import touch.baton.domain.member.vo.SocialId; import touch.baton.domain.member.vo.GithubUrl; import touch.baton.domain.member.vo.ImageUrl; import touch.baton.domain.member.vo.MemberName; @@ -34,7 +34,7 @@ public class Member extends BaseEntity { private MemberName memberName; @Embedded - private Email email; + private SocialId socialId; @Embedded private OauthId oauthId; @@ -50,27 +50,27 @@ public class Member extends BaseEntity { @Builder private Member(final MemberName memberName, - final Email email, + final SocialId socialId, final OauthId oauthId, final GithubUrl githubUrl, final Company company, final ImageUrl imageUrl ) { - this(null, memberName, email, oauthId, githubUrl, company, imageUrl); + this(null, memberName, socialId, oauthId, githubUrl, company, imageUrl); } private Member(final Long id, final MemberName memberName, - final Email email, + final SocialId socialId, final OauthId oauthId, final GithubUrl githubUrl, final Company company, final ImageUrl imageUrl ) { - validateNotNull(memberName, email, oauthId, githubUrl, company, imageUrl); + validateNotNull(memberName, socialId, oauthId, githubUrl, company, imageUrl); this.id = id; this.memberName = memberName; - this.email = email; + this.socialId = socialId; this.oauthId = oauthId; this.githubUrl = githubUrl; this.company = company; @@ -78,7 +78,7 @@ private Member(final Long id, } private void validateNotNull(final MemberName memberName, - final Email email, + final SocialId socialId, final OauthId oauthId, final GithubUrl githubUrl, final Company company, @@ -88,8 +88,8 @@ private void validateNotNull(final MemberName memberName, throw new MemberDomainException("Member 의 name 은 null 일 수 없습니다."); } - if (Objects.isNull(email)) { - throw new MemberDomainException("Member 의 email 은 null 일 수 없습니다."); + if (Objects.isNull(socialId)) { + throw new MemberDomainException("Member 의 socialId 은 null 일 수 없습니다."); } if (Objects.isNull(oauthId)) { diff --git a/backend/baton/src/main/java/touch/baton/domain/member/vo/Email.java b/backend/baton/src/main/java/touch/baton/domain/member/vo/SocialId.java similarity index 70% rename from backend/baton/src/main/java/touch/baton/domain/member/vo/Email.java rename to backend/baton/src/main/java/touch/baton/domain/member/vo/SocialId.java index 1236bf876..f4ce90f3d 100644 --- a/backend/baton/src/main/java/touch/baton/domain/member/vo/Email.java +++ b/backend/baton/src/main/java/touch/baton/domain/member/vo/SocialId.java @@ -14,19 +14,19 @@ @Getter @NoArgsConstructor(access = PROTECTED) @Embeddable -public class Email { +public class SocialId { - @Column(name = "email", nullable = false) + @Column(name = "social_id", nullable = false) private String value; - public Email(final String value) { + public SocialId(final String value) { validateNotNull(value); this.value = value; } private void validateNotNull(final String value) { if (Objects.isNull(value)) { - throw new IllegalArgumentException("Email 객체 내부에 email 은 null 일 수 없습니다."); + throw new IllegalArgumentException("SocialId 객체 내부에 value 은 null 일 수 없습니다."); } } } diff --git a/backend/baton/src/main/java/touch/baton/domain/oauth/OauthInformation.java b/backend/baton/src/main/java/touch/baton/domain/oauth/OauthInformation.java index 374d31b92..4cff68cfc 100644 --- a/backend/baton/src/main/java/touch/baton/domain/oauth/OauthInformation.java +++ b/backend/baton/src/main/java/touch/baton/domain/oauth/OauthInformation.java @@ -5,7 +5,7 @@ import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.NoArgsConstructor; -import touch.baton.domain.member.vo.Email; +import touch.baton.domain.member.vo.SocialId; import touch.baton.domain.member.vo.GithubUrl; import touch.baton.domain.member.vo.ImageUrl; import touch.baton.domain.member.vo.MemberName; @@ -24,7 +24,7 @@ public class OauthInformation { private MemberName memberName; - private Email email; + private SocialId socialId; private GithubUrl githubUrl; @@ -34,14 +34,14 @@ public class OauthInformation { private OauthInformation(final SocialToken socialToken, final OauthId oauthId, final MemberName memberName, - final Email email, + final SocialId socialId, final GithubUrl githubUrl, final ImageUrl imageUrl ) { this.socialToken = socialToken; this.oauthId = oauthId; this.memberName = memberName; - this.email = email; + this.socialId = socialId; this.githubUrl = githubUrl; this.imageUrl = imageUrl; } diff --git a/backend/baton/src/main/java/touch/baton/domain/oauth/controller/resolver/AuthRunnerPrincipalArgumentResolver.java b/backend/baton/src/main/java/touch/baton/domain/oauth/controller/resolver/AuthRunnerPrincipalArgumentResolver.java index 181218803..6b0661f48 100644 --- a/backend/baton/src/main/java/touch/baton/domain/oauth/controller/resolver/AuthRunnerPrincipalArgumentResolver.java +++ b/backend/baton/src/main/java/touch/baton/domain/oauth/controller/resolver/AuthRunnerPrincipalArgumentResolver.java @@ -49,9 +49,9 @@ public Object resolveArgument(final MethodParameter parameter, final String token = authHeader.substring(BEARER.length()); final Claims claims = jwtDecoder.parseJwtToken(token); - final String email = claims.get("email", String.class); - final Runner foundRunner = oauthRunnerRepository.joinByMemberEmail(email) - .orElseThrow(() -> new OauthRequestException(ClientErrorCode.JWT_CLAIM_EMAIL_IS_WRONG)); + final String socialId = claims.get("socialId", String.class); + final Runner foundRunner = oauthRunnerRepository.joinByMemberSocialId(socialId) + .orElseThrow(() -> new OauthRequestException(ClientErrorCode.JWT_CLAIM_SOCIAL_ID_IS_WRONG)); return foundRunner; } diff --git a/backend/baton/src/main/java/touch/baton/domain/oauth/controller/resolver/AuthSupporterPrincipalArgumentResolver.java b/backend/baton/src/main/java/touch/baton/domain/oauth/controller/resolver/AuthSupporterPrincipalArgumentResolver.java index f43e076ef..118cebfd3 100644 --- a/backend/baton/src/main/java/touch/baton/domain/oauth/controller/resolver/AuthSupporterPrincipalArgumentResolver.java +++ b/backend/baton/src/main/java/touch/baton/domain/oauth/controller/resolver/AuthSupporterPrincipalArgumentResolver.java @@ -49,9 +49,9 @@ public Object resolveArgument(final MethodParameter parameter, final String token = authHeader.substring(BEARER.length()); final Claims claims = jwtDecoder.parseJwtToken(token); - final String email = claims.get("email", String.class); - final Supporter foundSupporter = oauthSupporterRepository.joinByMemberEmail(email) - .orElseThrow(() -> new OauthRequestException(ClientErrorCode.JWT_CLAIM_EMAIL_IS_WRONG)); + final String socialId = claims.get("socialId", String.class); + final Supporter foundSupporter = oauthSupporterRepository.joinByMemberSocialId(socialId) + .orElseThrow(() -> new OauthRequestException(ClientErrorCode.JWT_CLAIM_SOCIAL_ID_IS_WRONG)); return foundSupporter; } diff --git a/backend/baton/src/main/java/touch/baton/domain/oauth/repository/OauthRunnerRepository.java b/backend/baton/src/main/java/touch/baton/domain/oauth/repository/OauthRunnerRepository.java index bc63b8c4e..14f9c343f 100644 --- a/backend/baton/src/main/java/touch/baton/domain/oauth/repository/OauthRunnerRepository.java +++ b/backend/baton/src/main/java/touch/baton/domain/oauth/repository/OauthRunnerRepository.java @@ -13,7 +13,7 @@ public interface OauthRunnerRepository extends JpaRepository { select r, r.member from Runner r join fetch Member m on m.id = r.member.id - where m.email.value = :email + where m.socialId.value = :socialId """) - Optional joinByMemberEmail(@Param("email") final String email); + Optional joinByMemberSocialId(@Param("socialId") final String socialId); } diff --git a/backend/baton/src/main/java/touch/baton/domain/oauth/repository/OauthSupporterRepository.java b/backend/baton/src/main/java/touch/baton/domain/oauth/repository/OauthSupporterRepository.java index 7cdfe555c..05105a3e3 100644 --- a/backend/baton/src/main/java/touch/baton/domain/oauth/repository/OauthSupporterRepository.java +++ b/backend/baton/src/main/java/touch/baton/domain/oauth/repository/OauthSupporterRepository.java @@ -13,7 +13,7 @@ public interface OauthSupporterRepository extends JpaRepository select s, s.member from Supporter s join fetch Member m on m.id = s.member.id - where m.email.value = :email + where m.socialId.value = :socialId """) - Optional joinByMemberEmail(@Param("email") final String email); + Optional joinByMemberSocialId(@Param("socialId") final String socialId); } diff --git a/backend/baton/src/main/java/touch/baton/domain/oauth/service/OauthService.java b/backend/baton/src/main/java/touch/baton/domain/oauth/service/OauthService.java index 71cef1178..21ef99738 100644 --- a/backend/baton/src/main/java/touch/baton/domain/oauth/service/OauthService.java +++ b/backend/baton/src/main/java/touch/baton/domain/oauth/service/OauthService.java @@ -51,14 +51,14 @@ public String login(final OauthType oauthType, final String code) { } return jwtEncoder.jwtToken(Map.of( - "email", oauthInformation.getEmail().getValue()) + "socialId", oauthInformation.getSocialId().getValue()) ); } private Member signUpMember(final OauthInformation oauthInformation) { final Member newMember = Member.builder() .memberName(oauthInformation.getMemberName()) - .email(oauthInformation.getEmail()) + .socialId(oauthInformation.getSocialId()) .oauthId(oauthInformation.getOauthId()) .githubUrl(oauthInformation.getGithubUrl()) .company(new Company("")) diff --git a/backend/baton/src/main/java/touch/baton/infra/auth/oauth/github/response/GithubMemberResponse.java b/backend/baton/src/main/java/touch/baton/infra/auth/oauth/github/response/GithubMemberResponse.java index 7d2de6ca1..de1ce5853 100644 --- a/backend/baton/src/main/java/touch/baton/infra/auth/oauth/github/response/GithubMemberResponse.java +++ b/backend/baton/src/main/java/touch/baton/infra/auth/oauth/github/response/GithubMemberResponse.java @@ -1,7 +1,7 @@ package touch.baton.infra.auth.oauth.github.response; import com.fasterxml.jackson.databind.annotation.JsonNaming; -import touch.baton.domain.member.vo.Email; +import touch.baton.domain.member.vo.SocialId; import touch.baton.domain.member.vo.GithubUrl; import touch.baton.domain.member.vo.ImageUrl; import touch.baton.domain.member.vo.MemberName; @@ -14,7 +14,7 @@ @JsonNaming(SnakeCaseStrategy.class) public record GithubMemberResponse(String id, String name, - String email, + String login, String htmlUrl, String avatarUrl ) { @@ -24,7 +24,7 @@ public OauthInformation toOauthInformation(final String accessToken) { .socialToken(new SocialToken(accessToken)) .oauthId(new OauthId(id)) .memberName(new MemberName(name)) - .email(new Email(email)) + .socialId(new SocialId(login)) .githubUrl(new GithubUrl(htmlUrl)) .imageUrl(new ImageUrl(avatarUrl)) .build(); diff --git a/backend/baton/src/test/java/touch/baton/domain/member/MemberTest.java b/backend/baton/src/test/java/touch/baton/domain/member/MemberTest.java index d6ad5122f..89e7bc16d 100644 --- a/backend/baton/src/test/java/touch/baton/domain/member/MemberTest.java +++ b/backend/baton/src/test/java/touch/baton/domain/member/MemberTest.java @@ -5,7 +5,7 @@ import org.junit.jupiter.api.Test; import touch.baton.domain.member.exception.MemberDomainException; import touch.baton.domain.member.vo.Company; -import touch.baton.domain.member.vo.Email; +import touch.baton.domain.member.vo.SocialId; import touch.baton.domain.member.vo.GithubUrl; import touch.baton.domain.member.vo.ImageUrl; import touch.baton.domain.member.vo.MemberName; @@ -25,7 +25,7 @@ class Create { void success() { assertThatCode(() -> Member.builder() .memberName(new MemberName("헤에디주")) - .email(new Email("test@test.co.kr")) + .socialId(new SocialId("testSocialId")) .oauthId(new OauthId("dsigjh98gh230gn2oinv913bcuo23nqovbvu93b12voi3bc31j")) .githubUrl(new GithubUrl("github.com/hyena0608")) .company(new Company("우아한형제들")) @@ -39,7 +39,7 @@ void success() { void fail_if_name_is_null() { assertThatThrownBy(() -> Member.builder() .memberName(null) - .email(new Email("test@test.co.kr")) + .socialId(new SocialId("testSocialId")) .oauthId(new OauthId("dsigjh98gh230gn2oinv913bcuo23nqovbvu93b12voi3bc31j")) .githubUrl(new GithubUrl("github.com/hyena0608")) .company(new Company("우아한형제들")) @@ -49,19 +49,19 @@ void fail_if_name_is_null() { .hasMessage("Member 의 name 은 null 일 수 없습니다."); } - @DisplayName("이메일에 null 이 들어갈 경우 예외가 발생한다.") + @DisplayName("socialId에 null 이 들어갈 경우 예외가 발생한다.") @Test - void fail_if_email_is_null() { + void fail_if_socialId_is_null() { assertThatThrownBy(() -> Member.builder() .memberName(new MemberName("에단")) - .email(null) + .socialId(null) .oauthId(new OauthId("dsigjh98gh230gn2oinv913bcuo23nqovbvu93b12voi3bc31j")) .githubUrl(new GithubUrl("github.com/hyena0608")) .company(new Company("우아한형제들")) .imageUrl(new ImageUrl("imageUrl")) .build() ).isInstanceOf(MemberDomainException.class) - .hasMessage("Member 의 email 은 null 일 수 없습니다."); + .hasMessage("Member 의 socialId 은 null 일 수 없습니다."); } @DisplayName("oauth id 에 null 이 들어갈 경우 예외가 발생한다.") @@ -69,7 +69,7 @@ void fail_if_email_is_null() { void fail_if_oauth_id_is_null() { assertThatThrownBy(() -> Member.builder() .memberName(new MemberName("에단")) - .email(new Email("test@test.co.kr")) + .socialId(new SocialId("testSocialId")) .oauthId(null) .githubUrl(new GithubUrl("github.com/hyena0608")) .company(new Company("우아한형제들")) @@ -84,7 +84,7 @@ void fail_if_oauth_id_is_null() { void fail_if_github_url_is_null() { assertThatThrownBy(() -> Member.builder() .memberName(new MemberName("에단")) - .email(new Email("test@test.co.kr")) + .socialId(new SocialId("testSocialId")) .oauthId(new OauthId("dsigjh98gh230gn2oinv913bcuo23nqovbvu93b12voi3bc31j")) .githubUrl(null) .company(new Company("우아한형제들")) @@ -99,7 +99,7 @@ void fail_if_github_url_is_null() { void fail_if_company_is_null() { assertThatThrownBy(() -> Member.builder() .memberName(new MemberName("에단")) - .email(new Email("test@test.co.kr")) + .socialId(new SocialId("testSocialId")) .oauthId(new OauthId("dsigjh98gh230gn2oinv913bcuo23nqovbvu93b12voi3bc31j")) .githubUrl(new GithubUrl("github.com/hyena0608")) .company(null) @@ -114,7 +114,7 @@ void fail_if_company_is_null() { void fail_if_imageUrl_is_null() { assertThatThrownBy(() -> Member.builder() .memberName(new MemberName("에단")) - .email(new Email("test@test.co.kr")) + .socialId(new SocialId("testSocialId")) .oauthId(new OauthId("dsigjh98gh230gn2oinv913bcuo23nqovbvu93b12voi3bc31j")) .githubUrl(new GithubUrl("github.com/hyena0608")) .company(new Company("우아한형제들")) diff --git a/backend/baton/src/test/java/touch/baton/domain/member/vo/EmailTest.java b/backend/baton/src/test/java/touch/baton/domain/member/vo/SocialIdTest.java similarity index 83% rename from backend/baton/src/test/java/touch/baton/domain/member/vo/EmailTest.java rename to backend/baton/src/test/java/touch/baton/domain/member/vo/SocialIdTest.java index 6873af9f8..818617c06 100644 --- a/backend/baton/src/test/java/touch/baton/domain/member/vo/EmailTest.java +++ b/backend/baton/src/test/java/touch/baton/domain/member/vo/SocialIdTest.java @@ -5,12 +5,12 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; -class EmailTest { +class SocialIdTest { @DisplayName("value 가 null 이면 예외가 발생한다.") @Test void fail_if_value_is_null() { - assertThatThrownBy(() -> new Email(null)) + assertThatThrownBy(() -> new SocialId(null)) .isInstanceOf(IllegalArgumentException.class); } } diff --git a/backend/baton/src/test/java/touch/baton/domain/runner/RunnerTest.java b/backend/baton/src/test/java/touch/baton/domain/runner/RunnerTest.java index 03dbca75a..04c99ccae 100644 --- a/backend/baton/src/test/java/touch/baton/domain/runner/RunnerTest.java +++ b/backend/baton/src/test/java/touch/baton/domain/runner/RunnerTest.java @@ -7,7 +7,7 @@ import touch.baton.domain.common.vo.TotalRating; import touch.baton.domain.member.Member; import touch.baton.domain.member.vo.Company; -import touch.baton.domain.member.vo.Email; +import touch.baton.domain.member.vo.SocialId; import touch.baton.domain.member.vo.GithubUrl; import touch.baton.domain.member.vo.ImageUrl; import touch.baton.domain.member.vo.MemberName; @@ -25,7 +25,7 @@ class Create { private final Member member = Member.builder() .memberName(new MemberName("헤에디주")) - .email(new Email("test@test.co.kr")) + .socialId(new SocialId("testSocialId")) .oauthId(new OauthId("dsigjh98gh230gn2oinv913bcuo23nqovbvu93b12voi3bc31j")) .githubUrl(new GithubUrl("github.com/hyena0608")) .company(new Company("우아한형제들")) diff --git a/backend/baton/src/test/java/touch/baton/domain/runner/repository/RunnerRepositoryTest.java b/backend/baton/src/test/java/touch/baton/domain/runner/repository/RunnerRepositoryTest.java index 78a25ad2e..baf5489b6 100644 --- a/backend/baton/src/test/java/touch/baton/domain/runner/repository/RunnerRepositoryTest.java +++ b/backend/baton/src/test/java/touch/baton/domain/runner/repository/RunnerRepositoryTest.java @@ -10,7 +10,7 @@ import touch.baton.domain.member.Member; import touch.baton.domain.member.repository.MemberRepository; import touch.baton.domain.member.vo.Company; -import touch.baton.domain.member.vo.Email; +import touch.baton.domain.member.vo.SocialId; import touch.baton.domain.member.vo.GithubUrl; import touch.baton.domain.member.vo.ImageUrl; import touch.baton.domain.member.vo.MemberName; @@ -25,7 +25,7 @@ class RunnerRepositoryTest extends RepositoryTestConfig { private static final MemberName memberName = new MemberName("헤에디주"); - private static final Email email = new Email("test@test.co.kr"); + private static final SocialId socialId = new SocialId("testSocialId"); private static final OauthId oauthId = new OauthId("dsigjh98gh230gn2oinv913bcuo23nqovbvu93b12voi3bc31j"); private static final GithubUrl githubUrl = new GithubUrl("github.com/hyena0608"); private static final Company company = new Company("우아한형제들"); @@ -45,7 +45,7 @@ class RunnerRepositoryTest extends RepositoryTestConfig { void setUp() { final Member member = Member.builder() .memberName(memberName) - .email(email) + .socialId(socialId) .oauthId(oauthId) .githubUrl(githubUrl) .company(company) @@ -76,7 +76,7 @@ void findByIdJoinMember() { () -> assertThat(actualMember.getId()).isNotNull(), () -> assertThat(actualMember.getMemberName()).isEqualTo(memberName), () -> assertThat(actualMember.getCompany()).isEqualTo(company), - () -> assertThat(actualMember.getEmail()).isEqualTo(email), + () -> assertThat(actualMember.getSocialId()).isEqualTo(socialId), () -> assertThat(actualMember.getOauthId()).isEqualTo(oauthId), () -> assertThat(actualMember.getGithubUrl()).isEqualTo(githubUrl) ); diff --git a/backend/baton/src/test/java/touch/baton/domain/runner/service/RunnerServiceReadTest.java b/backend/baton/src/test/java/touch/baton/domain/runner/service/RunnerServiceReadTest.java index 5b532395a..672f548f7 100644 --- a/backend/baton/src/test/java/touch/baton/domain/runner/service/RunnerServiceReadTest.java +++ b/backend/baton/src/test/java/touch/baton/domain/runner/service/RunnerServiceReadTest.java @@ -12,7 +12,7 @@ import touch.baton.domain.member.Member; import touch.baton.domain.member.repository.MemberRepository; import touch.baton.domain.member.vo.Company; -import touch.baton.domain.member.vo.Email; +import touch.baton.domain.member.vo.SocialId; import touch.baton.domain.member.vo.GithubUrl; import touch.baton.domain.member.vo.ImageUrl; import touch.baton.domain.member.vo.MemberName; @@ -36,7 +36,7 @@ class RunnerServiceReadTest { @Autowired private MemberRepository memberRepository; private static final MemberName memberName = new MemberName("헤에디주"); - private static final Email email = new Email("test@test.co.kr"); + private static final SocialId socialId = new SocialId("testSocialId"); private static final OauthId oauthId = new OauthId("dsigjh98gh230gn2oinv913bcuo23nqovbvu93b12voi3bc31j"); private static final GithubUrl githubUrl = new GithubUrl("github.com/hyena0608"); private static final Company company = new Company("우아한형제들"); @@ -52,7 +52,7 @@ void setUp() { final Member member = Member.builder() .memberName(memberName) - .email(email) + .socialId(socialId) .oauthId(oauthId) .githubUrl(githubUrl) .company(company) diff --git a/backend/baton/src/test/java/touch/baton/domain/runnerpost/RunnerPostTest.java b/backend/baton/src/test/java/touch/baton/domain/runnerpost/RunnerPostTest.java index be975ef88..da9a776e4 100644 --- a/backend/baton/src/test/java/touch/baton/domain/runnerpost/RunnerPostTest.java +++ b/backend/baton/src/test/java/touch/baton/domain/runnerpost/RunnerPostTest.java @@ -11,7 +11,7 @@ import touch.baton.domain.common.vo.WatchedCount; import touch.baton.domain.member.Member; import touch.baton.domain.member.vo.Company; -import touch.baton.domain.member.vo.Email; +import touch.baton.domain.member.vo.SocialId; import touch.baton.domain.member.vo.GithubUrl; import touch.baton.domain.member.vo.ImageUrl; import touch.baton.domain.member.vo.MemberName; @@ -40,7 +40,7 @@ class RunnerPostTest { private final Member runnerMember = Member.builder() .memberName(new MemberName("러너 사용자")) - .email(new Email("test@test.co.kr")) + .socialId(new SocialId("testSocialId")) .oauthId(new OauthId("ads7821iuqjkrhadsioh1f1r4efsoi3bc31j")) .githubUrl(new GithubUrl("github.com/hyena0608")) .company(new Company("우아한테크코스")) @@ -49,7 +49,7 @@ class RunnerPostTest { private final Member supporterMember = Member.builder() .memberName(new MemberName("서포터 사용자")) - .email(new Email("test@test.co.kr")) + .socialId(new SocialId("testSocialId")) .oauthId(new OauthId("dsigjh98gh230gn2oinv913bcuo23nqovbvu93b12voi3bc31j")) .githubUrl(new GithubUrl("github.com/pobi")) .company(new Company("우아한형제들")) diff --git a/backend/baton/src/test/java/touch/baton/domain/runnerpost/controller/RunnerPostControllerCreateTest.java b/backend/baton/src/test/java/touch/baton/domain/runnerpost/controller/RunnerPostControllerCreateTest.java index 07cca5e9f..e642281f5 100644 --- a/backend/baton/src/test/java/touch/baton/domain/runnerpost/controller/RunnerPostControllerCreateTest.java +++ b/backend/baton/src/test/java/touch/baton/domain/runnerpost/controller/RunnerPostControllerCreateTest.java @@ -16,7 +16,7 @@ import touch.baton.domain.member.Member; import touch.baton.domain.member.repository.MemberRepository; import touch.baton.domain.member.vo.Company; -import touch.baton.domain.member.vo.Email; +import touch.baton.domain.member.vo.SocialId; import touch.baton.domain.member.vo.GithubUrl; import touch.baton.domain.member.vo.ImageUrl; import touch.baton.domain.member.vo.MemberName; @@ -47,7 +47,7 @@ void setUp(@LocalServerPort int port) { final Member member = Member.builder() .memberName(new MemberName("헤에디주")) - .email(new Email("test@test.co.kr")) + .socialId(new SocialId("testSocialId")) .oauthId(new OauthId("dsigjh98gh230gn2oinv913bcuo23nqovbvu93b12voi3bc31j")) .githubUrl(new GithubUrl("github.com/hyena0608")) .company(new Company("우아한형제들")) diff --git a/backend/baton/src/test/java/touch/baton/domain/runnerpost/controller/read/RunnerPostControllerReadTest.java b/backend/baton/src/test/java/touch/baton/domain/runnerpost/controller/read/RunnerPostControllerReadTest.java index 89a3c80ba..57bf53761 100644 --- a/backend/baton/src/test/java/touch/baton/domain/runnerpost/controller/read/RunnerPostControllerReadTest.java +++ b/backend/baton/src/test/java/touch/baton/domain/runnerpost/controller/read/RunnerPostControllerReadTest.java @@ -20,7 +20,7 @@ import touch.baton.domain.member.Member; import touch.baton.domain.member.repository.MemberRepository; import touch.baton.domain.member.vo.Company; -import touch.baton.domain.member.vo.Email; +import touch.baton.domain.member.vo.SocialId; import touch.baton.domain.member.vo.GithubUrl; import touch.baton.domain.member.vo.ImageUrl; import touch.baton.domain.member.vo.MemberName; @@ -70,7 +70,7 @@ class RunnerPostControllerReadTest { private final Member runnerMember = Member.builder() .memberName(new MemberName("러너 사용자")) - .email(new Email("test@test.co.kr")) + .socialId(new SocialId("testSocialId")) .oauthId(new OauthId("ads7821iuqjkrhadsioh1f1r4efsoi3bc31j")) .githubUrl(new GithubUrl("github.com/hyena0608")) .company(new Company("우아한테크코스")) @@ -79,7 +79,7 @@ class RunnerPostControllerReadTest { private final Member supporterMember = Member.builder() .memberName(new MemberName("서포터 사용자")) - .email(new Email("test@test.co.kr")) + .socialId(new SocialId("testSocialId")) .oauthId(new OauthId("dsigjh98gh230gn2oinv913bcuo23nqovbvu93b12voi3bc31j")) .githubUrl(new GithubUrl("github.com/pobi")) .company(new Company("우아한형제들")) diff --git a/backend/baton/src/test/java/touch/baton/domain/runnerpost/repository/RunnerPostRepositoryDeleteTest.java b/backend/baton/src/test/java/touch/baton/domain/runnerpost/repository/RunnerPostRepositoryDeleteTest.java index c70917346..c9b8cb2d1 100644 --- a/backend/baton/src/test/java/touch/baton/domain/runnerpost/repository/RunnerPostRepositoryDeleteTest.java +++ b/backend/baton/src/test/java/touch/baton/domain/runnerpost/repository/RunnerPostRepositoryDeleteTest.java @@ -13,7 +13,7 @@ import touch.baton.domain.member.Member; import touch.baton.domain.member.repository.MemberRepository; import touch.baton.domain.member.vo.Company; -import touch.baton.domain.member.vo.Email; +import touch.baton.domain.member.vo.SocialId; import touch.baton.domain.member.vo.GithubUrl; import touch.baton.domain.member.vo.ImageUrl; import touch.baton.domain.member.vo.MemberName; @@ -49,7 +49,7 @@ void success_deleteByRunnerPostId() { // given final Member member = Member.builder() .memberName(new MemberName("헤에디주")) - .email(new Email("test@test.co.kr")) + .socialId(new SocialId("testSocialId")) .oauthId(new OauthId("dsigjh98gh230gn2oinv913bcuo23nqovbvu93b12voi3bc31j")) .githubUrl(new GithubUrl("github.com/hyena0608")) .company(new Company("우아한형제들")) diff --git a/backend/baton/src/test/java/touch/baton/domain/runnerpost/repository/RunnerPostRepositoryReadTest.java b/backend/baton/src/test/java/touch/baton/domain/runnerpost/repository/RunnerPostRepositoryReadTest.java new file mode 100644 index 000000000..8345350fe --- /dev/null +++ b/backend/baton/src/test/java/touch/baton/domain/runnerpost/repository/RunnerPostRepositoryReadTest.java @@ -0,0 +1,89 @@ +package touch.baton.domain.runnerpost.repository; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import touch.baton.config.RepositoryTestConfig; +import touch.baton.domain.common.vo.ChattingCount; +import touch.baton.domain.common.vo.Contents; +import touch.baton.domain.common.vo.Grade; +import touch.baton.domain.common.vo.Title; +import touch.baton.domain.common.vo.TotalRating; +import touch.baton.domain.common.vo.WatchedCount; +import touch.baton.domain.member.Member; +import touch.baton.domain.member.repository.MemberRepository; +import touch.baton.domain.member.vo.Company; +import touch.baton.domain.member.vo.SocialId; +import touch.baton.domain.member.vo.GithubUrl; +import touch.baton.domain.member.vo.ImageUrl; +import touch.baton.domain.member.vo.MemberName; +import touch.baton.domain.member.vo.OauthId; +import touch.baton.domain.runner.Runner; +import touch.baton.domain.runner.repository.RunnerRepository; +import touch.baton.domain.runnerpost.RunnerPost; +import touch.baton.domain.runnerpost.vo.Deadline; +import touch.baton.domain.runnerpost.vo.PullRequestUrl; +import touch.baton.domain.runnerpost.vo.ReviewStatus; +import touch.baton.domain.tag.RunnerPostTags; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Optional; + +import static org.assertj.core.api.Assertions.assertThat; + +class RunnerPostRepositoryReadTest extends RepositoryTestConfig { + + @Autowired + private MemberRepository memberRepository; + + @Autowired + private RunnerRepository runnerRepository; + + @Autowired + private RunnerPostRepository runnerPostRepository; + + @DisplayName("RunnerPost 식별자값으로 RunnerPost 을 삭제한다.") + @Test + void success_deleteByRunnerPostId() { + // given + final Member member = Member.builder() + .memberName(new MemberName("헤에디주")) + .socialId(new SocialId("testSocialId")) + .oauthId(new OauthId("dsigjh98gh230gn2oinv913bcuo23nqovbvu93b12voi3bc31j")) + .githubUrl(new GithubUrl("github.com/hyena0608")) + .company(new Company("우아한형제들")) + .imageUrl(new ImageUrl("홍혁준")) + .build(); + final Member saveMember = memberRepository.saveAndFlush(member); + + final Runner runner = Runner.builder() + .totalRating(new TotalRating(100)) + .grade(Grade.BARE_FOOT) + .member(saveMember) + .build(); + final Runner saveRunner = runnerRepository.saveAndFlush(runner); + + final RunnerPost runnerPost = RunnerPost.builder() + .title(new Title("제 코드 리뷰 좀 해주세요!!")) + .contents(new Contents("제 코드는 클린코드가 맞을까요?")) + .deadline(new Deadline(LocalDateTime.now())) + .pullRequestUrl(new PullRequestUrl("https://")) + .watchedCount(new WatchedCount(1)) + .chattingCount(new ChattingCount(1)) + .runnerPostTags(new RunnerPostTags(new ArrayList<>())) + .reviewStatus(ReviewStatus.NOT_STARTED) + .runner(saveRunner) + .supporter(null) + .build(); + final Long saveRunnerPostId = runnerPostRepository.saveAndFlush(runnerPost).getId(); + + // when + runnerPostRepository.deleteById(saveRunnerPostId); + + final Optional maybeRunnerPost = runnerPostRepository.findById(saveRunnerPostId); + + // then + assertThat(maybeRunnerPost).isNotPresent(); + } +} diff --git a/backend/baton/src/test/java/touch/baton/domain/runnerpost/service/RunnerPostServiceDeleteTest.java b/backend/baton/src/test/java/touch/baton/domain/runnerpost/service/RunnerPostServiceDeleteTest.java index 85f9ef025..072b151b6 100644 --- a/backend/baton/src/test/java/touch/baton/domain/runnerpost/service/RunnerPostServiceDeleteTest.java +++ b/backend/baton/src/test/java/touch/baton/domain/runnerpost/service/RunnerPostServiceDeleteTest.java @@ -14,7 +14,7 @@ import touch.baton.domain.common.vo.WatchedCount; import touch.baton.domain.member.Member; import touch.baton.domain.member.vo.Company; -import touch.baton.domain.member.vo.Email; +import touch.baton.domain.member.vo.SocialId; import touch.baton.domain.member.vo.GithubUrl; import touch.baton.domain.member.vo.MemberName; import touch.baton.domain.member.vo.OauthId; @@ -49,7 +49,7 @@ void success_deleteByRunnerPostId() { // given final Member member = Member.builder() .memberName(new MemberName("헤에디주")) - .email(new Email("test@test.co.kr")) + .socialId(new SocialId("testSocialId")) .oauthId(new OauthId("dsigjh98gh230gn2oinv913bcuo23nqovbvu93b12voi3bc31j")) .githubUrl(new GithubUrl("github.com/hyena0608")) .company(new Company("우아한형제들")) diff --git a/backend/baton/src/test/java/touch/baton/domain/runnerpost/service/RunnerPostServiceReadTest.java b/backend/baton/src/test/java/touch/baton/domain/runnerpost/service/RunnerPostServiceReadTest.java index 183ee153f..167116969 100644 --- a/backend/baton/src/test/java/touch/baton/domain/runnerpost/service/RunnerPostServiceReadTest.java +++ b/backend/baton/src/test/java/touch/baton/domain/runnerpost/service/RunnerPostServiceReadTest.java @@ -13,7 +13,7 @@ import touch.baton.domain.common.vo.WatchedCount; import touch.baton.domain.member.Member; import touch.baton.domain.member.vo.Company; -import touch.baton.domain.member.vo.Email; +import touch.baton.domain.member.vo.SocialId; import touch.baton.domain.member.vo.GithubUrl; import touch.baton.domain.member.vo.ImageUrl; import touch.baton.domain.member.vo.MemberName; @@ -55,7 +55,7 @@ void success_findByRunnerPostId() { // given final Member member = Member.builder() .memberName(new MemberName("헤에디주")) - .email(new Email("test@test.co.kr")) + .socialId(new SocialId("testSocialId")) .oauthId(new OauthId("dsigjh98gh230gn2oinv913bcuo23nqovbvu93b12voi3bc31j")) .githubUrl(new GithubUrl("github.com/hyena0608")) .company(new Company("우아한형제들")) diff --git a/backend/baton/src/test/java/touch/baton/domain/supporter/SupporterTest.java b/backend/baton/src/test/java/touch/baton/domain/supporter/SupporterTest.java index f9d46f32d..23327cf50 100644 --- a/backend/baton/src/test/java/touch/baton/domain/supporter/SupporterTest.java +++ b/backend/baton/src/test/java/touch/baton/domain/supporter/SupporterTest.java @@ -8,7 +8,7 @@ import touch.baton.domain.common.vo.TotalRating; import touch.baton.domain.member.Member; import touch.baton.domain.member.vo.Company; -import touch.baton.domain.member.vo.Email; +import touch.baton.domain.member.vo.SocialId; import touch.baton.domain.member.vo.GithubUrl; import touch.baton.domain.member.vo.ImageUrl; import touch.baton.domain.member.vo.MemberName; @@ -33,7 +33,7 @@ class SupporterTest { private final Member member = Member.builder() .memberName(new MemberName("헤에디주")) - .email(new Email("test@test.co.kr")) + .socialId(new SocialId("testSocialId")) .oauthId(new OauthId("dsigjh98gh230gn2oinv913bcuo23nqovbvu93b12voi3bc31j")) .githubUrl(new GithubUrl("github.com/hyena0608")) .company(new Company("우아한형제들")) diff --git a/backend/baton/src/test/java/touch/baton/domain/tag/RunnerPostTagTest.java b/backend/baton/src/test/java/touch/baton/domain/tag/RunnerPostTagTest.java index 14ba127c1..c4ba57ad2 100644 --- a/backend/baton/src/test/java/touch/baton/domain/tag/RunnerPostTagTest.java +++ b/backend/baton/src/test/java/touch/baton/domain/tag/RunnerPostTagTest.java @@ -12,7 +12,7 @@ import touch.baton.domain.common.vo.WatchedCount; import touch.baton.domain.member.Member; import touch.baton.domain.member.vo.Company; -import touch.baton.domain.member.vo.Email; +import touch.baton.domain.member.vo.SocialId; import touch.baton.domain.member.vo.GithubUrl; import touch.baton.domain.member.vo.ImageUrl; import touch.baton.domain.member.vo.MemberName; @@ -44,7 +44,7 @@ class Create { private final Member runnerMember = Member.builder() .memberName(new MemberName("러너 사용자")) - .email(new Email("test@test.co.kr")) + .socialId(new SocialId("testSocialId")) .oauthId(new OauthId("ads7821iuqjkrhadsioh1f1r4efsoi3bc31j")) .githubUrl(new GithubUrl("github.com/hyena0608")) .company(new Company("우아한테크코스")) @@ -53,7 +53,7 @@ class Create { private final Member supporterMember = Member.builder() .memberName(new MemberName("서포터 사용자")) - .email(new Email("test@test.co.kr")) + .socialId(new SocialId("testSocialId")) .oauthId(new OauthId("dsigjh98gh230gn2oinv913bcuo23nqovbvu93b12voi3bc31j")) .githubUrl(new GithubUrl("github.com/pobi")) .company(new Company("우아한형제들")) diff --git a/backend/baton/src/test/java/touch/baton/domain/tag/RunnerPostTagsTest.java b/backend/baton/src/test/java/touch/baton/domain/tag/RunnerPostTagsTest.java index 210e0a3fb..dbf0ff651 100644 --- a/backend/baton/src/test/java/touch/baton/domain/tag/RunnerPostTagsTest.java +++ b/backend/baton/src/test/java/touch/baton/domain/tag/RunnerPostTagsTest.java @@ -6,7 +6,7 @@ import touch.baton.domain.common.vo.TotalRating; import touch.baton.domain.member.Member; import touch.baton.domain.member.vo.Company; -import touch.baton.domain.member.vo.Email; +import touch.baton.domain.member.vo.SocialId; import touch.baton.domain.member.vo.GithubUrl; import touch.baton.domain.member.vo.ImageUrl; import touch.baton.domain.member.vo.MemberName; @@ -28,7 +28,7 @@ void addAllRunnerPostTags() { RunnerPostTags postTags = new RunnerPostTags(); Member member = Member.builder() .memberName(new MemberName("러너 사용자")) - .email(new Email("test@test.co.kr")) + .socialId(new SocialId("testSocialId")) .oauthId(new OauthId("ads7821iuqjkrhadsioh1f1r4efsoi3bc31j")) .githubUrl(new GithubUrl("github.com/hyena0608")) .company(new Company("우아한테크코스")) diff --git a/backend/baton/src/test/java/touch/baton/domain/tag/repository/RunnerPostTagRepositoryTest.java b/backend/baton/src/test/java/touch/baton/domain/tag/repository/RunnerPostTagRepositoryTest.java index b98e590ee..373730449 100644 --- a/backend/baton/src/test/java/touch/baton/domain/tag/repository/RunnerPostTagRepositoryTest.java +++ b/backend/baton/src/test/java/touch/baton/domain/tag/repository/RunnerPostTagRepositoryTest.java @@ -14,7 +14,7 @@ import touch.baton.domain.member.Member; import touch.baton.domain.member.repository.MemberRepository; import touch.baton.domain.member.vo.Company; -import touch.baton.domain.member.vo.Email; +import touch.baton.domain.member.vo.SocialId; import touch.baton.domain.member.vo.GithubUrl; import touch.baton.domain.member.vo.ImageUrl; import touch.baton.domain.member.vo.MemberName; @@ -60,7 +60,7 @@ void success_joinTagByRunnerPostIds() { // given final Member member = Member.builder() .memberName(new MemberName("헤에디주")) - .email(new Email("test@test.co.kr")) + .socialId(new SocialId("testSocialId")) .oauthId(new OauthId("dsigjh98gh230gn2oinv913bcuo23nqovbvu93b12voi3bc31j")) .githubUrl(new GithubUrl("github.com/hyena0608")) .company(new Company("우아한형제들")) @@ -116,7 +116,7 @@ void success_joinTagByRunnerPostIds_if_tag_is_empty() { // given final Member member = Member.builder() .memberName(new MemberName("헤에디주")) - .email(new Email("test@test.co.kr")) + .socialId(new SocialId("testSocialId")) .oauthId(new OauthId("dsigjh98gh230gn2oinv913bcuo23nqovbvu93b12voi3bc31j")) .githubUrl(new GithubUrl("github.com/hyena0608")) .company(new Company("우아한형제들")) diff --git a/backend/baton/src/test/java/touch/baton/fixture/domain/MemberFixture.java b/backend/baton/src/test/java/touch/baton/fixture/domain/MemberFixture.java index 22e0a7a05..8c254c200 100644 --- a/backend/baton/src/test/java/touch/baton/fixture/domain/MemberFixture.java +++ b/backend/baton/src/test/java/touch/baton/fixture/domain/MemberFixture.java @@ -2,14 +2,14 @@ import touch.baton.domain.member.Member; import touch.baton.domain.member.vo.Company; -import touch.baton.domain.member.vo.Email; +import touch.baton.domain.member.vo.SocialId; import touch.baton.domain.member.vo.GithubUrl; import touch.baton.domain.member.vo.ImageUrl; import touch.baton.domain.member.vo.MemberName; import touch.baton.domain.member.vo.OauthId; import static touch.baton.fixture.vo.CompanyFixture.company; -import static touch.baton.fixture.vo.EmailFixture.email; +import static touch.baton.fixture.vo.SocialIdFixture.socialId; import static touch.baton.fixture.vo.GithubUrlFixture.githubUrl; import static touch.baton.fixture.vo.ImageUrlFixture.imageUrl; import static touch.baton.fixture.vo.MemberNameFixture.memberName; @@ -21,7 +21,7 @@ private MemberFixture() { } public static Member create(final MemberName memberName, - final Email email, + final SocialId socialId, final OauthId oauthId, final GithubUrl githubUrl, final Company company, @@ -29,7 +29,7 @@ public static Member create(final MemberName memberName, ) { return Member.builder() .memberName(memberName) - .email(email) + .socialId(socialId) .oauthId(oauthId) .githubUrl(githubUrl) .company(company) @@ -40,7 +40,7 @@ public static Member create(final MemberName memberName, public static Member createHyena() { return create( memberName("헤나"), - email("email_hyena@test.com"), + socialId("hyenaSocialId"), oauthId("oauth_hyena"), githubUrl("https://github.com/"), company("우아한테크코스 5기 백엔드"), @@ -50,7 +50,7 @@ public static Member createHyena() { public static Member createEthan() { return create( memberName("에단"), - email("email_ethan@test.com"), + socialId("ethanSocialId"), oauthId("oauth_ethan"), githubUrl("https://github.com/"), company("우아한테크코스 5기 백엔드"), @@ -60,7 +60,7 @@ public static Member createEthan() { public static Member createDitoo() { return create( memberName("디투"), - email("email_ditoo@test.com"), + socialId("ditooSocialId"), oauthId("oauth_ditoo"), githubUrl("https://github.com/"), company("우아한테크코스 5기 백엔드"), @@ -70,7 +70,7 @@ public static Member createDitoo() { public static Member createJudy() { return create( memberName("주디"), - email("email_judy@test.com"), + socialId("judySocialId"), oauthId("oauth_judy"), githubUrl("https://github.com/"), company("우아한테크코스 5기 백엔드"), diff --git a/backend/baton/src/test/java/touch/baton/fixture/vo/EmailFixture.java b/backend/baton/src/test/java/touch/baton/fixture/vo/EmailFixture.java deleted file mode 100644 index f720a84d7..000000000 --- a/backend/baton/src/test/java/touch/baton/fixture/vo/EmailFixture.java +++ /dev/null @@ -1,13 +0,0 @@ -package touch.baton.fixture.vo; - -import touch.baton.domain.member.vo.Email; - -public abstract class EmailFixture { - - private EmailFixture() { - } - - public static Email email(final String value) { - return new Email(value); - } -} diff --git a/backend/baton/src/test/java/touch/baton/fixture/vo/SocialIdFixture.java b/backend/baton/src/test/java/touch/baton/fixture/vo/SocialIdFixture.java new file mode 100644 index 000000000..2552b5314 --- /dev/null +++ b/backend/baton/src/test/java/touch/baton/fixture/vo/SocialIdFixture.java @@ -0,0 +1,13 @@ +package touch.baton.fixture.vo; + +import touch.baton.domain.member.vo.SocialId; + +public abstract class SocialIdFixture { + + private SocialIdFixture() { + } + + public static SocialId socialId(final String value) { + return new SocialId(value); + } +} diff --git a/backend/baton/src/test/java/touch/baton/infra/auth/jwt/JwtEncoderAndDecoderTest.java b/backend/baton/src/test/java/touch/baton/infra/auth/jwt/JwtEncoderAndDecoderTest.java index 6368d72e2..6418f8a76 100644 --- a/backend/baton/src/test/java/touch/baton/infra/auth/jwt/JwtEncoderAndDecoderTest.java +++ b/backend/baton/src/test/java/touch/baton/infra/auth/jwt/JwtEncoderAndDecoderTest.java @@ -30,25 +30,25 @@ void setUp() { this.jwtEncoder = new JwtEncoder(this.jwtConfig); } - @DisplayName("Claim 으로 email 을 넣어 인코딩한 JWT 를 디코드했을 때 email 을 구할 수 있다.") + @DisplayName("Claim 으로 socialId 를 넣어 인코딩한 JWT 를 디코드했을 때 socialId 을 구할 수 있다.") @Test void encode_and_decode() { // given - final String encodedJwt = jwtEncoder.jwtToken(Map.of("email", "test@test.com")); + final String encodedJwt = jwtEncoder.jwtToken(Map.of("socialId", "testSocialId")); // when final Claims claims = jwtDecoder.parseJwtToken(encodedJwt); - final String email = claims.get("email", String.class); + final String socialId = claims.get("socialId", String.class); // then - assertThat(email).isEqualTo("test@test.com"); + assertThat(socialId).isEqualTo("testSocialId"); } @DisplayName("인코드할 때 사용한 secretKey 가 디코드할 때 사용할 secretKey 와 다를 경우 예외가 발생한다.") @Test void fail_decode_with_wrong_secretKey() { // given - final String encodedJwt = jwtEncoder.jwtToken(Map.of("email", "test@test.com")); + final String encodedJwt = jwtEncoder.jwtToken(Map.of("socialId", "testSocialId")); // when final JwtConfig wrongJwtConfig = new JwtConfig("wrongSecretKeywrongSecretKeywrongSecretKey", "hyena");