File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
src/test/java/com/somemore/user Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -97,4 +97,20 @@ void findByInvalidId() {
9797 // then
9898 assertThat (findUser ).isEmpty ();
9999 }
100+
101+ @ DisplayName ("유저 계정 아이디로 유저를 조회할 수 있다." )
102+ @ Test
103+ void findByAccountId () {
104+ // given
105+ UserAuthInfo userAuthInfo =
new UserAuthInfo (
"[email protected] " ,
"test" );
106+ User user = User .from (userAuthInfo , UserRole .CENTER );
107+ User savedUser = userRepository .save (user );
108+
109+ // when
110+ Optional <User > findUser = userRepository .findByAccountId (savedUser .getAccountId ());
111+
112+ // then
113+ assertThat (findUser ).isPresent ();
114+ assertThat (findUser .get ()).isEqualTo (savedUser );
115+ }
100116}
Original file line number Diff line number Diff line change @@ -51,6 +51,18 @@ void getById() {
5151 assertThat (foundUser ).isNotNull ();
5252 }
5353
54+ @ DisplayName ("유저 계정 아이디로 유저를 조회할 수 있다." )
55+ @ Test
56+ void getByAccountId () {
57+ // given
58+
59+ // when
60+ User foundUser = userQueryService .getByAccountId (user .getAccountId ());
61+
62+ // then
63+ assertThat (foundUser ).isNotNull ();
64+ }
65+
5466 @ DisplayName ("유저 아이디로 유저 공통 속성을 조회할 수 있다." )
5567 @ Test
5668 void getCommonAttributeByUserID () {
You can’t perform that action at this time.
0 commit comments