-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Merge] main <- hyungjun#105-fix-url-http-method
[Fix] url 수정, userUpdate http 메서드 변경, getUserProfile에서 팔로우 여부를 리턴합니다
- Loading branch information
Showing
11 changed files
with
52 additions
and
45 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
6 changes: 1 addition & 5 deletions
6
.../snaptime/user/dto/req/UserUpdateDto.java → ...aptime/user/dto/req/UserUpdateReqDto.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,28 +1,24 @@ | ||
package me.snaptime.user.dto.req; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.NotBlank; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public record UserUpdateDto( | ||
public record UserUpdateReqDto( | ||
@Schema( | ||
example = "홍길순", | ||
description = "유저의 이름을 입력해주세요" | ||
) | ||
@NotBlank(message = "유저 이름 입력은 필수입니다.") | ||
String name, | ||
@Schema( | ||
example = "[email protected]", | ||
description = "유저의 이메일을 입력해주세요" | ||
) | ||
@NotBlank(message = "유저 이메일 입력은 필수입니다.") | ||
String email, | ||
@Schema( | ||
example = "1999-10-29", | ||
description = "유저의 생년월일을 입력해주세요" | ||
) | ||
@NotBlank(message = "유저 생년월일 입력은 필수입니다.") | ||
String birthDay | ||
|
||
){} |
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,11 @@ | ||
package me.snaptime.user.service; | ||
|
||
import me.snaptime.user.dto.req.UserUpdateDto; | ||
import me.snaptime.user.dto.req.UserUpdateReqDto; | ||
import me.snaptime.user.dto.res.UserResDto; | ||
|
||
public interface UserService { | ||
public UserResDto getUser(String loginId); | ||
public UserResDto updateUser(String loginId, UserUpdateDto userUpdateDto); | ||
public UserResDto updateUser(String loginId, UserUpdateReqDto userUpdateDto); | ||
public void deleteUser(String loginId); | ||
public void updatePassword(String loginId, String password); | ||
} |
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
import me.snaptime.jwt.UserDetailsServiceImpl; | ||
import me.snaptime.profile.service.impl.ProfileServiceImpl; | ||
import me.snaptime.user.dto.req.UserReqDto; | ||
import me.snaptime.user.dto.req.UserUpdateDto; | ||
import me.snaptime.user.dto.req.UserUpdateReqDto; | ||
import me.snaptime.user.dto.res.UserResDto; | ||
import me.snaptime.user.service.impl.SignServiceImpl; | ||
import me.snaptime.user.service.impl.UserServiceImpl; | ||
|
@@ -121,13 +121,13 @@ void signUpTest() throws Exception{ | |
void updateUserTest() throws Exception{ | ||
|
||
//given | ||
UserUpdateDto userUpdateDto = UserUpdateDto.builder() | ||
UserUpdateReqDto userUpdateDto = UserUpdateReqDto.builder() | ||
.name("홍길순") | ||
.email("[email protected]") | ||
.birthDay("1999-10-29") | ||
.build(); | ||
|
||
given(userService.updateUser(eq("kang4746"),any(UserUpdateDto.class))) | ||
given(userService.updateUser(eq("kang4746"),any(UserUpdateReqDto.class))) | ||
.willReturn(UserResDto.builder() | ||
.loginId("kang4746") | ||
.name("홍길순") | ||
|
@@ -139,7 +139,7 @@ void updateUserTest() throws Exception{ | |
String content = gson.toJson(userUpdateDto); | ||
|
||
//when | ||
mockMvc.perform(put("/users") | ||
mockMvc.perform(patch("/users") | ||
.content(content).contentType(MediaType.APPLICATION_JSON)) | ||
.andExpect(jsonPath("$.msg").exists()) | ||
.andExpect(jsonPath("$.result.loginId").exists()) | ||
|
@@ -148,7 +148,7 @@ void updateUserTest() throws Exception{ | |
.andDo(print()); | ||
|
||
//then | ||
verify(userService,times(1)).updateUser(eq("kang4746"),any(UserUpdateDto.class)); | ||
verify(userService,times(1)).updateUser(eq("kang4746"),any(UserUpdateReqDto.class)); | ||
} | ||
|
||
@Test | ||
|
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
import me.snaptime.user.domain.User; | ||
import me.snaptime.user.dto.req.SignInReqDto; | ||
import me.snaptime.user.dto.req.UserReqDto; | ||
import me.snaptime.user.dto.req.UserUpdateDto; | ||
import me.snaptime.user.dto.req.UserUpdateReqDto; | ||
import me.snaptime.user.dto.res.SignInResDto; | ||
import me.snaptime.user.dto.res.UserResDto; | ||
import me.snaptime.user.repository.UserRepository; | ||
|
@@ -165,7 +165,7 @@ public void deleteUser() { | |
@DisplayName("given_when_then 방식으로 updateUser 서비스 성공 테스트") | ||
public void updateUser() { | ||
//given | ||
UserUpdateDto userUpdateDto = UserUpdateDto.builder() | ||
UserUpdateReqDto userUpdateDto = UserUpdateReqDto.builder() | ||
.name("") | ||
.email("[email protected]") | ||
.birthDay("") | ||
|