Skip to content

Commit

Permalink
refactor: apple access token 테스트 코드 #214
Browse files Browse the repository at this point in the history
  • Loading branch information
ozzing committed Sep 9, 2022
1 parent ac9ffb0 commit c5c90b2
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ public void testIfKidAppleLoginSucceedReturnResult() {
Mockito.doReturn(appleKeyListDTO).when(appleService).getAppleIdentityToken();
Mockito.doReturn(appleSubjectDTO).when(appleService)
.verifyIdentityToken(appleRequest, appleKeyListDTO);
Mockito.doReturn(appleTokenDTO).when(appleService).getAppleAccessToken(appleRequest);
Mockito.doReturn(appleTokenDTO).when(appleService)
.getAppleAccessToken(appleRequest, "login");

// when
UserServiceImpl userService = new UserServiceImpl(
Expand Down Expand Up @@ -150,7 +151,8 @@ public void testIfNewUserAppleLoginSucceedReturnResult() {
Mockito.doReturn(appleKeyListDTO).when(appleService).getAppleIdentityToken();
Mockito.doReturn(appleSubjectDTO).when(appleService)
.verifyIdentityToken(appleRequest, appleKeyListDTO);
Mockito.doReturn(appleTokenDTO).when(appleService).getAppleAccessToken(appleRequest);
Mockito.doReturn(appleTokenDTO).when(appleService)
.getAppleAccessToken(appleRequest, "login");

// when
UserServiceImpl userService = new UserServiceImpl(
Expand Down Expand Up @@ -219,7 +221,8 @@ public void testIfNewUserWithLongNameAppleLoginSucceedReturnResult() {
Mockito.doReturn(appleKeyListDTO).when(appleService).getAppleIdentityToken();
Mockito.doReturn(appleSubjectDTO).when(appleService)
.verifyIdentityToken(appleRequest, appleKeyListDTO);
Mockito.doReturn(appleTokenDTO).when(appleService).getAppleAccessToken(appleRequest);
Mockito.doReturn(appleTokenDTO).when(appleService)
.getAppleAccessToken(appleRequest, "login");

// when
UserServiceImpl userService = new UserServiceImpl(
Expand Down Expand Up @@ -284,7 +287,8 @@ public void testIfUserRevokeSucceedReturnResult() {
Mockito.doReturn(appleKeyListDTO).when(appleService).getAppleIdentityToken();
Mockito.doReturn(appleSubjectDTO).when(appleService)
.verifyIdentityToken(appleRequest, appleKeyListDTO);
Mockito.doReturn(appleTokenDTO).when(appleService).getAppleAccessToken(appleRequest);
Mockito.doReturn(appleTokenDTO).when(appleService)
.getAppleAccessToken(appleRequest, "revoke");
Mockito.doReturn(object).when(appleService).revokeAppleAccount(appleTokenDTO);

// when
Expand Down

0 comments on commit c5c90b2

Please sign in to comment.