Skip to content
This repository has been archived by the owner on Aug 13, 2022. It is now read-only.

Commit

Permalink
Merge pull request #51 from f-lab-edu/feature/40
Browse files Browse the repository at this point in the history
[#40] Logger 적용
  • Loading branch information
cyj199637 authored Jan 11, 2021
2 parents aaea38a + 35242a9 commit ff7a515
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/main/java/me/liiot/snsserver/config/FirebaseConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.google.auth.oauth2.GoogleCredentials;
import com.google.firebase.FirebaseApp;
import com.google.firebase.FirebaseOptions;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
Expand All @@ -14,8 +15,12 @@
/*
@PostConstruct
: 빈의 초기화를 위해 모든 의존성이 주입이 된 후에 실행됨
@Slf4j
: static fianl log 필드가 생성되어 logger를 사용 가능
*/
@Configuration
@Slf4j
public class FirebaseConfig {

@Value("${firebase.account.key.path}")
Expand All @@ -34,7 +39,7 @@ public void initialize() {
FirebaseApp.initializeApp(options);
}
} catch (IOException e) {
e.printStackTrace();
log.error("Failed initializing FilebaseApp: {}", e.getMessage());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.google.firebase.messaging.FirebaseMessaging;
import com.google.firebase.messaging.Message;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import me.liiot.snsserver.enumeration.PushType;
import org.springframework.core.io.ClassPathResource;
import org.springframework.data.redis.core.RedisTemplate;
Expand All @@ -16,6 +17,7 @@

@Service
@RequiredArgsConstructor
@Slf4j
public class FirebasePushService implements PushService {

private final RedisTemplate<String, Object> redisTemplate;
Expand Down Expand Up @@ -61,7 +63,7 @@ private String getAccessToken() {
googleCredential.refreshToken();
return googleCredential.getAccessToken();
} catch (IOException e) {
e.printStackTrace();
log.error("Failed getting access token: {}", e.getMessage());
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ public void setUpEach() throws ServletException {
.build();

mockHttpSession = new MockHttpSession();

doReturn(true).when(localeChangeInterceptor).preHandle(any(), any(), any());
when(localeChangeInterceptor.preHandle(any(), any(), any())).thenReturn(true);
}

@Test
Expand Down

0 comments on commit ff7a515

Please sign in to comment.