Skip to content

Commit

Permalink
[refactor/InhaBas#179] SignUpIntegrationTest 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
whitem4rk committed Dec 11, 2023
1 parent 6579c91 commit 1072f2b
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import com.inhabas.api.auth.domain.oauth2.member.domain.valueObject.Role;
import com.inhabas.api.auth.domain.oauth2.member.repository.MemberRepository;
import com.inhabas.api.auth.domain.oauth2.socialAccount.type.UID;
import com.inhabas.api.auth.domain.oauth2.userInfo.OAuth2UserInfo;
import com.inhabas.api.auth.domain.oauth2.userInfo.OAuth2UserInfoFactory;
import com.inhabas.api.auth.domain.token.TokenUtil;
import com.inhabas.api.domain.questionnaire.domain.Questionnaire;
import com.inhabas.api.domain.questionnaire.repository.QuestionnaireRepository;
Expand All @@ -36,6 +38,7 @@
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Optional;

import static com.inhabas.api.auth.domain.oauth2.member.domain.valueObject.Role.*;
import static org.assertj.core.api.Assertions.assertThat;
Expand Down Expand Up @@ -253,9 +256,13 @@ public static RequestPostProcessor accessToken(String accessToken) {
"name", "조승현"
)
);
OAuth2UserInfo oAuth2UserInfo = OAuth2UserInfoFactory.getOAuth2UserInfo("NAVER", nameAttributeKey);
memberRepository.saveAndFlush(new Member(oAuth2UserInfo));
Optional<Member> test = memberRepository.findByProviderAndUid(OAuth2Provider.NAVER, new UID("N8ojJQXxxSxtO0CmEH3xtt5Y6ER09UEsRozkpbGAdOI"));
CustomOAuth2User customOAuth2User = new CustomOAuth2User(grantedAuthorities, nameAttributeKey, "response", 1L);

return tokenUtil.createAccessToken(new OAuth2AuthenticationToken(customOAuth2User, grantedAuthorities, "naver"));
return tokenUtil.createAccessToken(new OAuth2AuthenticationToken(customOAuth2User, grantedAuthorities, "NAVER"));

}

private void 면접질문_설정() {
Expand Down

0 comments on commit 1072f2b

Please sign in to comment.