-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #120 from cvs-go/feature#117
회원 탈퇴 기능 추가
- Loading branch information
Showing
19 changed files
with
188 additions
and
49 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
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
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
6 changes: 4 additions & 2 deletions
6
src/main/java/com/cvsgo/repository/RefreshTokenRepository.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 |
---|---|---|
@@ -1,11 +1,13 @@ | ||
package com.cvsgo.repository; | ||
|
||
import com.cvsgo.entity.RefreshToken; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import com.cvsgo.entity.User; | ||
import java.util.Optional; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface RefreshTokenRepository extends JpaRepository<RefreshToken, Long> { | ||
|
||
Optional<RefreshToken> findByToken(String token); | ||
|
||
void deleteAllByUser(User user); | ||
} |
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
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 |
---|---|---|
|
@@ -133,6 +133,23 @@ void respond_400_when_login_but_user_does_not_exist() throws Exception { | |
.andDo(print()); | ||
} | ||
|
||
@Test | ||
@DisplayName("탈퇴한 계정이면 로그인 API 호출시 HTTP 400를 응답한다") | ||
void respond_400_when_login_but_user_is_deleted() throws Exception { | ||
LoginRequestDto loginRequestDto = LoginRequestDto.builder() | ||
.email("[email protected]") | ||
.password("password1!") | ||
.build(); | ||
|
||
given(authService.login(any())).willThrow(ExceptionConstants.NOT_FOUND_USER); | ||
|
||
mockMvc.perform(post("/api/auth/login") | ||
.contentType(MediaType.APPLICATION_JSON) | ||
.content(objectMapper.writeValueAsString(loginRequestDto))) | ||
.andExpect(status().isNotFound()) | ||
.andDo(print()); | ||
} | ||
|
||
@Test | ||
@DisplayName("비밀번호가 일치하지 않으면 로그인 API 호출시 HTTP 401을 응답한다") | ||
void respond_401_when_password_is_not_correct() throws Exception { | ||
|
Oops, something went wrong.