테스트 통합 환경 설정 추가

This commit is contained in:
2026-05-29 15:58:33 +09:00
parent 00316ba013
commit ebfbf7b597
8 changed files with 182 additions and 25 deletions

View File

@@ -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()
}