Attempting to fix black magic 2
This commit is contained in:
parent
b02b0ce05b
commit
4955e49f54
@ -54,15 +54,13 @@ class WebConfig: WebMvcConfigurer {
|
|||||||
class ApiCommunicationConfig {
|
class ApiCommunicationConfig {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
fun coordinatorTemplate(): RestTemplate {
|
fun coordinatorTemplate(builder: RestTemplateBuilder): RestTemplate {
|
||||||
return try {
|
return try {
|
||||||
val url = UIEnv.coordinatorUrl
|
val url = UIEnv.coordinatorUrl
|
||||||
log.info { "CoordinatorUrl: $url" }
|
log.info { "CoordinatorUrl: $url" }
|
||||||
require(url.isNotBlank()) { "UIEnv.coordinatorUrl er ikke satt!" }
|
require(url.isNotBlank()) { "UIEnv.coordinatorUrl er ikke satt!" }
|
||||||
|
builder.uriTemplateHandler(DefaultUriBuilderFactory(url))
|
||||||
val restTemplate = RestTemplate()
|
builder.build()
|
||||||
restTemplate.uriTemplateHandler = DefaultUriBuilderFactory(url)
|
|
||||||
restTemplate
|
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
throw IllegalStateException("Feil ved opprettelse av coordinatorTemplate: ${e.message}", e)
|
throw IllegalStateException("Feil ved opprettelse av coordinatorTemplate: ${e.message}", e)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user