-
Notifications
You must be signed in to change notification settings - Fork 0
/
KommuneInfoClientConfig.kt
36 lines (31 loc) · 1.23 KB
/
KommuneInfoClientConfig.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package no.nav.sosialhjelp.innsyn.client.fiks
import no.nav.sosialhjelp.client.kommuneinfo.FiksProperties
import no.nav.sosialhjelp.client.kommuneinfo.KommuneInfoClient
import no.nav.sosialhjelp.client.kommuneinfo.KommuneInfoClientImpl
import no.nav.sosialhjelp.innsyn.config.ClientProperties
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Profile
import org.springframework.web.reactive.function.client.WebClient
@Profile("!mock")
@Configuration
class KommuneInfoClientConfig(
private val proxiedWebClientBuilder: WebClient.Builder,
private val clientProperties: ClientProperties
) {
@Bean
fun kommuneInfoClient(): KommuneInfoClient {
return KommuneInfoClientImpl(
proxiedWebClientBuilder.build(),
fiksProperties()
)
}
private fun fiksProperties(): FiksProperties {
return FiksProperties(
clientProperties.fiksDigisosEndpointUrl + FiksPaths.PATH_KOMMUNEINFO,
clientProperties.fiksDigisosEndpointUrl + FiksPaths.PATH_ALLE_KOMMUNEINFO,
clientProperties.fiksIntegrasjonId,
clientProperties.fiksIntegrasjonpassord
)
}
}