diff --git a/src/main/java/com/bamdoliro/sinabro/domain/user/domain/User.java b/src/main/java/com/bamdoliro/sinabro/domain/user/domain/User.java index 9cd9b1b..6792885 100644 --- a/src/main/java/com/bamdoliro/sinabro/domain/user/domain/User.java +++ b/src/main/java/com/bamdoliro/sinabro/domain/user/domain/User.java @@ -40,7 +40,7 @@ public class User extends BaseTimeEntity { public User(String email, String name, String password, Authority authority) { this.email = email; this.name = name; - this.password = new Password(PasswordUtil.encode(password)); + this.password = password == null ? null : new Password(PasswordUtil.encode(password)); this.authority = authority; } } diff --git a/src/test/java/com/bamdoliro/sinabro/shared/fixture/UserFixture.java b/src/test/java/com/bamdoliro/sinabro/shared/fixture/UserFixture.java index 73cfd4c..8cee71f 100644 --- a/src/test/java/com/bamdoliro/sinabro/shared/fixture/UserFixture.java +++ b/src/test/java/com/bamdoliro/sinabro/shared/fixture/UserFixture.java @@ -6,10 +6,18 @@ public class UserFixture { public static User createUser() { - return new User("bamdoliro@gmail.com", "김밤돌", Authority.USER); + return User.builder() + .email("bamdoliro@gmail.com") + .name("김밤돌") + .authority(Authority.USER) + .build(); } public static User createAdmin() { - return new User("bamdoliro@gmail.com", "어드민", Authority.ADMIN); + return User.builder() + .email("bamdoliro@gmail.com") + .name("어드민") + .authority(Authority.ADMIN) + .build(); } } diff --git a/src/test/java/com/bamdoliro/sinabro/shared/util/ControllerTest.java b/src/test/java/com/bamdoliro/sinabro/shared/util/ControllerTest.java index 811ad71..0d37d0b 100644 --- a/src/test/java/com/bamdoliro/sinabro/shared/util/ControllerTest.java +++ b/src/test/java/com/bamdoliro/sinabro/shared/util/ControllerTest.java @@ -20,6 +20,9 @@ import com.bamdoliro.sinabro.application.notification.SendNotificationToAllUserUseCase; import com.bamdoliro.sinabro.application.notification.SendNotificationUseCase; import com.bamdoliro.sinabro.application.question.*; +import com.bamdoliro.sinabro.application.user.SendVerificationUseCase; +import com.bamdoliro.sinabro.application.user.SignUpUseCase; +import com.bamdoliro.sinabro.application.user.VerifyUseCase; import com.bamdoliro.sinabro.domain.auth.service.TokenService; import com.bamdoliro.sinabro.presentation.answer.AnswerController; import com.bamdoliro.sinabro.presentation.auth.AuthController; @@ -71,6 +74,9 @@ public abstract class ControllerTest { // UseCase // Auth + @MockBean + protected LogInUseCase logInUseCase; + @MockBean protected GoogleAuthLinkUseCase googleAuthLinkUseCase; @@ -86,6 +92,16 @@ public abstract class ControllerTest { @MockBean protected LogOutUseCase logOutUseCase; + // User + @MockBean + protected SignUpUseCase signUpUseCase; + + @MockBean + protected SendVerificationUseCase sendVerificationUseCase; + + @MockBean + protected VerifyUseCase verifyUseCase; + // Diary @MockBean protected CreateDiaryUseCase createDiaryUseCase;