Skip to content

Commit

Permalink
Google Java Format
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Nov 23, 2023
1 parent 9c01755 commit 65bd663
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ public interface MemberRepository extends JpaRepository<Member, UUID> {
@Query(
"SELECT m FROM Member m WHERE m.oauthInfo.clientId = :oAuthId AND"
+ " m.oauthInfo.authType = :authType")
Optional<Member> findByOAuthIdAndAuthType(@Param("oAuthId") String oAuthId, @Param("authType") AuthType authType);
Optional<Member> findByOAuthIdAndAuthType(
@Param("oAuthId") String oAuthId, @Param("authType") AuthType authType);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.twtw.backend.domain.member.service;

import static org.assertj.core.api.Assertions.assertThat;

import com.twtw.backend.domain.member.dto.request.MemberSaveRequest;
import com.twtw.backend.domain.member.dto.request.OAuthRequest;
import com.twtw.backend.domain.member.dto.response.AfterLoginResponse;
Expand All @@ -11,13 +13,11 @@
import com.twtw.backend.fixture.member.MemberEntityFixture;
import com.twtw.backend.support.database.DatabaseTest;
import com.twtw.backend.support.exclude.ExcludeTest;
import org.junit.jupiter.api.DisplayName;

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;

import static org.assertj.core.api.Assertions.assertThat;

@DatabaseTest
@DisplayName("AuthService의 ")
public class AuthServiceTest extends ExcludeTest {
Expand All @@ -28,19 +28,15 @@ public class AuthServiceTest extends ExcludeTest {

@Autowired private RefreshTokenRepository refreshTokenRepository;


@Test
@DisplayName("Kakao 회원 가입이 수행되는가")
void saveMemberKakao(){
void saveMemberKakao() {
// given
MemberSaveRequest kakaoRequest = new MemberSaveRequest(
"JinJooWon_Kakao",
"TEST_PROFILE_IMAGE",
new OAuthRequest(
"TEST_KAKAO_TOKEN",
AuthType.KAKAO
)
);
MemberSaveRequest kakaoRequest =
new MemberSaveRequest(
"JinJooWon_Kakao",
"TEST_PROFILE_IMAGE",
new OAuthRequest("TEST_KAKAO_TOKEN", AuthType.KAKAO));

// when
AfterLoginResponse response = authService.saveMember(kakaoRequest);
Expand All @@ -51,16 +47,13 @@ void saveMemberKakao(){

@Test
@DisplayName("Apple 회원 가입이 수행되는가")
void saveMemberApple(){
//given
MemberSaveRequest appleRequest = new MemberSaveRequest(
"JinJooWon_Apple",
"TEST_PROFILE_IMAGE",
new OAuthRequest(
"TEST_APPLE_TOKEN",
AuthType.APPLE
)
);
void saveMemberApple() {
// given
MemberSaveRequest appleRequest =
new MemberSaveRequest(
"JinJooWon_Apple",
"TEST_PROFILE_IMAGE",
new OAuthRequest("TEST_APPLE_TOKEN", AuthType.APPLE));

// when
AfterLoginResponse response = authService.saveMember(appleRequest);
Expand All @@ -71,14 +64,13 @@ void saveMemberApple(){

@Test
@DisplayName("로그인 후 회원에 대해 토큰이 재발급되는가")
void getTokenByOAuthSuccess(){
void getTokenByOAuthSuccess() {
// given
final Member member = memberRepository.save(MemberEntityFixture.FIRST_MEMBER.toEntity());

final OAuthRequest request = new OAuthRequest(
member.getOauthInfo().getClientId(),
member.getOauthInfo().getAuthType()
);
final OAuthRequest request =
new OAuthRequest(
member.getOauthInfo().getClientId(), member.getOauthInfo().getAuthType());

// when
AfterLoginResponse response = authService.getTokenByOAuth(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,4 @@ void getResponseByMember() {
// then
assertThat(memberResponse.getId()).isEqualTo(member.getId());
}


}

0 comments on commit 65bd663

Please sign in to comment.