테스트 통합 환경 설정 추가
This commit is contained in:
@@ -14,17 +14,24 @@ import java.io.FileInputStream
|
||||
@Configuration
|
||||
class AndroidPublisherConfig(
|
||||
@Value("\${firebase.secret-key-path}")
|
||||
private val secretKeyPath: String
|
||||
private val secretKeyPath: String,
|
||||
@Value("\${android-publisher.enabled:true}")
|
||||
private val enabled: Boolean
|
||||
) {
|
||||
@Bean
|
||||
fun androidPublisher(): AndroidPublisher {
|
||||
val jsonFactory = GsonFactory.getDefaultInstance()
|
||||
val httpTransport = NetHttpTransport()
|
||||
val credential = if (enabled) {
|
||||
HttpCredentialsAdapter(
|
||||
GoogleCredentials.fromStream(FileInputStream(secretKeyPath))
|
||||
.createScoped(listOf(AndroidPublisherScopes.ANDROIDPUBLISHER))
|
||||
)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
|
||||
val credential = GoogleCredentials.fromStream(FileInputStream(secretKeyPath))
|
||||
.createScoped(listOf(AndroidPublisherScopes.ANDROIDPUBLISHER))
|
||||
|
||||
return AndroidPublisher.Builder(httpTransport, jsonFactory, HttpCredentialsAdapter(credential))
|
||||
return AndroidPublisher.Builder(httpTransport, jsonFactory, credential)
|
||||
.setApplicationName("소다라이브")
|
||||
.build()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user