Skip to content

Commit

Permalink
[#16] refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jinyoungchoi95 committed Aug 28, 2021
1 parent 6bb273f commit c1fbfad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ void getCurrentUserTest() throws Exception {
.email(new Email("[email protected]"))
.password(new Password("password"))
.build();
when(userService.findById(1L)).thenReturn(Optional.ofNullable(user));
when(userService.findById(any())).thenReturn(Optional.ofNullable(user));
SecurityContextHolder.getContext().setAuthentication(new JwtAuthentication(1L, "token"));

// given
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void successJoinTest() {
when(passwordEncoder.encode(password.getPassword())).thenReturn("encoded_password");
User input = User.Builder()
.username(new Username("username"))
.email(new Email("email"))
.email(new Email("[email protected]"))
.password(password)
.bio("bio")
.image("image")
Expand All @@ -97,7 +97,7 @@ void successJoinTest() {
// then
assertThat(user.getId()).isEqualTo(1L);
assertThat(user.getUsername()).isEqualTo(new Username("username"));
assertThat(user.getEmail()).isEqualTo(new Email("email"));
assertThat(user.getEmail()).isEqualTo(new Email("[email protected]"));
assertThat(user.getPassword().getPassword())
.isEqualTo("encoded_password");
assertThat(user.getBio()).isEqualTo("bio");
Expand Down Expand Up @@ -207,7 +207,7 @@ void updateFailByNotFoundUserTest() {
Long userId = 2L;
UserUpdateModel userUpdateModel = new UserUpdateModel(
new Username("username"),
new Email("email"),
new Email("[email protected]"),
new Password("password"),
"bio",
"image"
Expand Down

0 comments on commit c1fbfad

Please sign in to comment.