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

[BE] fix: 발자국 알림 개선 #505

Merged
merged 3 commits into from
Aug 21, 2024
Merged

[BE] fix: 발자국 알림 개선 #505

merged 3 commits into from
Aug 21, 2024

Conversation

ehtjsv2
Copy link
Contributor

@ehtjsv2 ehtjsv2 commented Aug 20, 2024

이슈

개발 사항

  • 알림 보낼 디바이스가 존재하지 않을경우, 메서드 호출하지 않도록 수정
  • 산책끝난 발자국에게 알림 보내지 않도록 수정
  • 하루지난 발자국에게 알림 보내지 않도록 구현

@ehtjsv2 ehtjsv2 added 🐞 bug 버그 수정 🖥 backend backend labels Aug 20, 2024
@ehtjsv2 ehtjsv2 added this to the Sprint4 milestone Aug 20, 2024
@ehtjsv2 ehtjsv2 self-assigned this Aug 20, 2024
@ehtjsv2 ehtjsv2 linked an issue Aug 20, 2024 that may be closed by this pull request
Copy link

Test Results

161 tests  +158   161 ✅ +158   18s ⏱️ +18s
 33 suites + 32     0 💤 ±  0 
 33 files   + 32     0 ❌ ±  0 

Results for commit 53a8a0d. ± Comparison against base commit 93e3951.

This pull request removes 3 and adds 161 tests. Note that renamed tests count towards both.
com.happy.friendogly.ExampleUnitTest ‑ addition_isCorrect
com.happy.friendogly.ExampleUnitTest ‑ addition_isCorrect2
com.happy.friendogly.ExampleUnitTest ‑ addition_isCorrect3
com.happy.friendogly.chat.service.ChatRoomCommandServiceTest ‑ 1대1 채팅방 저장 과정에서, 이미 채팅방이 존재하면 기존 채팅방 ID를 반환한다.
com.happy.friendogly.chat.service.ChatRoomCommandServiceTest ‑ 모임에 참여하지 않은 경우, 모임 채팅방에서 나갈 수 없다.
com.happy.friendogly.chat.service.ChatRoomCommandServiceTest ‑ 새로운 1대1 채팅방을 개설할 수 있다.
com.happy.friendogly.chat.service.ChatRoomCommandServiceTest ‑ 채팅방에 참여한 경우, 채팅방에서 나갈 수 있다.
com.happy.friendogly.chat.service.ChatRoomQueryServiceTest ‑ 내가 속해 있는 채팅방을 찾을 수 있다.
com.happy.friendogly.chat.service.ChatRoomQueryServiceTest ‑ 자신이 참여한 채팅방이 아니면 채팅방에서 모임 정보를 받아올 수 없다.
com.happy.friendogly.chat.service.ChatRoomQueryServiceTest ‑ 채팅방 ID로부터 모임 ID, 허용 펫 사이즈, 허용 펫 성별을 조회할 수 있다.
com.happy.friendogly.chat.service.ChatRoomQueryServiceTest ‑ 채팅방 내 멤버 세부정보를 조회할 수 있다.
com.happy.friendogly.club.domain.AddressTest ‑ [1] provinceInput=null
com.happy.friendogly.club.domain.AddressTest ‑ [2] provinceInput=
…

Comment on lines +30 to +38
@DisplayName("알림을 받을 디바이스가 존재하지 않으면 알림을 보내지 않습니다.")
@Test
void sendFootprintNotification() throws FirebaseMessagingException {
// when
fcmNotificationService.sendFootprintNotification("title", "content", List.of());

// then
verify(firebaseMessaging, never()).sendEachForMulticast(any());
}
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

Choose a reason for hiding this comment

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

오 검증문이 특이하네요 mockito 기능인가요?!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

모키토 입니다!

Copy link
Contributor

@takoyakimchi takoyakimchi left a comment

Choose a reason for hiding this comment

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

고생했어요.

private final DeviceTokenRepository deviceTokenRepository;

public FcmNotificationService(
FirebaseApp firebaseApp,
@Autowired FirebaseApp firebaseApp,
Copy link
Contributor

Choose a reason for hiding this comment

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

이거 어노테이션 붙여야 하나요? 필드에 없는 값이면 붙여야 하는 건가...?

Comment on lines +39 to +44
public void sendFootprintNotification(String title, String content, String receiverToken) {
Map<String, String> data = Map.of(
"body", content
);

sendNotificationWithType(FOOTPRINT, title, data, List.of(receiverToken));
Copy link
Contributor

Choose a reason for hiding this comment

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

오 제가 만든 메서드 잘 활용해주셨네용

Copy link
Contributor

@J-I-H-O J-I-H-O left a comment

Choose a reason for hiding this comment

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

고생하셨습니당~

@ehtjsv2 ehtjsv2 merged commit 88d9574 into develop Aug 21, 2024
3 checks passed
takoyakimchi pushed a commit that referenced this pull request Oct 23, 2024
@takoyakimchi takoyakimchi deleted the feat/fooprint-fcm branch November 4, 2024 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🖥 backend backend 🐞 bug 버그 수정
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

발자국 알림 수정
4 participants