-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: SlackClient 로직 개선 및 로깅 추가 #637
Conversation
Unit Test Results200 tests ±0 200 ✔️ ±0 16s ⏱️ ±0s Results for commit d1d7c95. ± Comparison against base commit ab94bc8. This pull request removes 4 and adds 4 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
@@ -201,6 +183,7 @@ public void inviteBotToChannel(final Member member, final Channel channel) { | |||
.token(member.getToken()) | |||
.users(List.of(member.getWorkspace().getBotSlackId())) | |||
.build(); | |||
log.info(LOGGING_INFO, request); | |||
|
|||
try { | |||
ConversationsInviteResponse response = methodsClient.conversationsInvite(request); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inviteBotToChannel()
메서드는 중간에 isBotAlreadyInChannel()
이라는 메서드를 실행하면서 다른 메서드들과는 다른 로직을 갖고 있기 때문에 execute()
를 사용하지 않았습니다.
This comment has been minimized.
This comment has been minimized.
…ickpick into feature/refactor-SlackClient
This comment has been minimized.
This comment has been minimized.
1 similar comment
Analysis Details0 IssuesCoverage and DuplicationsProject ID: woowacourse-teams_2022-pickpick_AYKprLeNXDQxKhlck1fc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try { | ||
OAuthV2AccessResponse response = methodsClient | ||
.oauthV2Access(request); | ||
validateResponse(OAUTH_ACCESS_METHOD_NAME, response); | ||
return response; | ||
|
||
} catch (IOException | SlackApiException e) { | ||
throw new SlackApiCallException(OAUTH_ACCESS_METHOD_NAME); | ||
} | ||
return execute(methodsClient::oauthV2Access, OAUTH_ACCESS_METHOD_NAME, request); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try~catch
가 어디론가 옮겨졌다 생각하고 음 반복 로직을 더 깔끔하게 못만드나 했는데 이미 멋지게 중복을 없애두셨군요.. 🥺!!!!!
given(slackClient.conversationsList((RequestConfigurator<ConversationsListRequestBuilder>) any())) | ||
given(slackClient.conversationsList(any(ConversationsListRequest.class))) | ||
.willReturn(generateConversationsListResponse()); | ||
given(slackClient.usersList((RequestConfigurator<UsersListRequestBuilder>) any())) | ||
given(slackClient.usersList(any(UsersListRequest.class))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기도 깔끔하게 정리됐군요..!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
연로그 정말 최고에요 🥺 코드가 정말 깔끔 그 자체가 되었네요 ㅠㅠ 괴물개발자 👍
머지는 너무 늦은 시간인 것 같아서 내일 하면 될 것 같아요!!
요약
SlackClient 로직 개선
작업 내용
참고 #639