Skip to content

Commit

Permalink
feat: FirebaseApp 초기화, 딱 한 번만 수행하도록 변경(#89)
Browse files Browse the repository at this point in the history
- 테스트 코드 실행시 기본 이름(default)의 FirebaseApp이 중복 생성되는 예외 발생
- 반드시 한 번만 초기화를 수행하도록 설정 변경
  • Loading branch information
Minjae-An committed May 26, 2024
1 parent 86b6750 commit f208320
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions be/src/main/java/yeonba/be/config/FcmConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ public class FcmConfig {
@Bean
public FirebaseMessaging firebaseMessaging() throws IOException {

if (!FirebaseApp.getApps().isEmpty()) {

return FirebaseMessaging.getInstance(FirebaseApp.getInstance());
}

ClassPathResource resource = new ClassPathResource(fcmAccountKeyPath);

FirebaseOptions firebaseOptions = FirebaseOptions.builder()
Expand Down

0 comments on commit f208320

Please sign in to comment.