From 1e85c97e0ab3514cf3cee9c7aa35922176eb401c Mon Sep 17 00:00:00 2001 From: BacicaFlorinTelus Date: Thu, 14 Oct 2021 12:03:40 +0300 Subject: [PATCH] Revert "use restTemplate bean in client credentials" This reverts commit 23b05e64af957976ac6093f3278cb2e60ecd9402. --- .../kotlin/digital/capsa/core/auth/ClientCredentials.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/capsa-core/src/main/kotlin/digital/capsa/core/auth/ClientCredentials.kt b/capsa-core/src/main/kotlin/digital/capsa/core/auth/ClientCredentials.kt index f1dc948..4668c24 100644 --- a/capsa-core/src/main/kotlin/digital/capsa/core/auth/ClientCredentials.kt +++ b/capsa-core/src/main/kotlin/digital/capsa/core/auth/ClientCredentials.kt @@ -5,7 +5,6 @@ import digital.capsa.core.logger import java.time.ZonedDateTime import javax.xml.bind.DatatypeConverter import org.slf4j.MDC -import org.springframework.beans.factory.annotation.Autowired import org.springframework.beans.factory.annotation.Value import org.springframework.context.annotation.Configuration import org.springframework.http.HttpEntity @@ -27,9 +26,6 @@ class ClientCredentials { var authTokenCache: MutableMap = mutableMapOf() } - @Autowired - private lateinit var restTemplate: RestTemplate - @Value("\${auth-token-service.host}") private lateinit var authTokenServiceHost: String @@ -109,7 +105,7 @@ class ClientCredentials { params.add("scope", scope) return try { - restTemplate.exchange( + RestTemplate().exchange( authTokenServiceBaseUri, HttpMethod.POST, HttpEntity(params, requestHeaders),