Skip to content

Commit f208320

Browse files
committed
feat: FirebaseApp 초기화, 딱 한 번만 수행하도록 변경(#89)
- 테스트 코드 실행시 기본 이름(default)의 FirebaseApp이 중복 생성되는 예외 발생 - 반드시 한 번만 초기화를 수행하도록 설정 변경
1 parent 86b6750 commit f208320

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

be/src/main/java/yeonba/be/config/FcmConfig.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ public class FcmConfig {
1919
@Bean
2020
public FirebaseMessaging firebaseMessaging() throws IOException {
2121

22+
if (!FirebaseApp.getApps().isEmpty()) {
23+
24+
return FirebaseMessaging.getInstance(FirebaseApp.getInstance());
25+
}
26+
2227
ClassPathResource resource = new ClassPathResource(fcmAccountKeyPath);
2328

2429
FirebaseOptions firebaseOptions = FirebaseOptions.builder()

0 commit comments

Comments
 (0)