Skip to content
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

Feature/#3 노션 API 테스트 #4

Merged
merged 6 commits into from
Sep 17, 2022

Conversation

dmswjdchl
Copy link
Collaborator

What is the PR?

Changes

  • 노션에서 테이블 가져오는 테스트 코드 작성

Test Check List

etc

@dmswjdchl dmswjdchl marked this pull request as draft September 17, 2022 07:06
@dmswjdchl dmswjdchl marked this pull request as ready for review September 17, 2022 07:08
@dmswjdchl dmswjdchl marked this pull request as draft September 17, 2022 07:08
@dmswjdchl dmswjdchl marked this pull request as ready for review September 17, 2022 07:09
@dmswjdchl dmswjdchl marked this pull request as draft September 17, 2022 07:09
@dmswjdchl dmswjdchl marked this pull request as ready for review September 17, 2022 07:09
private final String TOKEN = "";
private final String DATABASE_ID = "";
private final String tableName = "MEMBER PROFILE";
private final int memberNum = 3;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

memberNum은 회원 수를 말하는 거죠?? 테스트 용으로 임의로 3명으로 지정해 놓은 변수로 이해하면 될까요?

Copy link
Collaborator Author

@dmswjdchl dmswjdchl Sep 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네넵 맞습니다!

//then
assertThat(simpleQueryResultPage.results.size()).isEqualTo(1);
// System.out.println("simpleQueryResultPage = " + simpleQueryResultPage.results.get(0).getPropertyValues());
assertThat(simpleQueryResultPage.results.get(0).getPropertyValues().toString().contains(email)).isEqualTo(true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

equals 써서 바로 string 비교할 수도 있지 않나요? 호옥시 contains.equals(true)로 한 이유가 있을까요?? 저도 잘 몰라서 질문 드려용

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simpleQueryResultPage.results.get(0).getPropertyValues()
-> 이렇게 하면 사용자 이름, 이메일, 역할에 관한 정보가 들어가 있긴 한데
bold=false, italic=false, strikethrough=false, underline=false 이런 정보들도 같이 나와서 contains 사용했습니다.

simpleQueryResultPage.results.get(0).getPropertyValues().get(0).getValue()
-> 하면 이메일 정보만 따로 나오긴 하는데 여기에도 다른 정보들도 같이 나와서 일단 저렇게 작성해뒀습니다.

  • 원하는 email, name, role 값만 꺼내려는데 잘 안돼서 contains 사용했는데 고칠 필요가 있을 것 같습니다!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

실제 사용하는 과정에서는 파싱해서 email, name, role만 따로 가져올 필요가 있겠네요.
답변 감사합니다!

@coke98 coke98 merged commit b379e6e into GDSC-PKNU-Official:develop Sep 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants