| 1 | package org.sanmibuh.tedee.lock.infrastructure.secondary; | |
| 2 | ||
| 3 | import com.tedee.bridge.client.ApiClient; | |
| 4 | import com.tedee.bridge.client.api.CallbackApi; | |
| 5 | import com.tedee.bridge.client.api.LockApi; | |
| 6 | import java.time.Clock; | |
| 7 | import org.sanmibuh.tedee.lock.infrastructure.TedeeProperties; | |
| 8 | import org.springframework.context.annotation.Bean; | |
| 9 | import org.springframework.context.annotation.Configuration; | |
| 10 | import org.springframework.context.annotation.ImportRuntimeHints; | |
| 11 | import org.springframework.resilience.annotation.EnableResilientMethods; | |
| 12 | import org.springframework.web.client.RestClient; | |
| 13 | ||
| 14 | @Configuration | |
| 15 | @EnableResilientMethods | |
| 16 | @ImportRuntimeHints(TedeeReflectionHints.class) | |
| 17 | public class TedeeClientConfiguration { | |
| 18 | ||
| 19 | @Bean | |
| 20 | ApiClient tedeeApiClient( | |
| 21 | final RestClient.Builder builder, final TedeeProperties properties, final Clock clock) { | |
| 22 | final var interceptor = | |
| 23 | new TedeeApiTokenInterceptor(new TedeeApiTokenGenerator(properties.apiKey()), clock); | |
| 24 | final var apiClient = new ApiClient(builder.requestInterceptor(interceptor).build()); | |
| 25 | apiClient.setBasePath(properties.baseUrl()); | |
| 26 |
1
1. tedeeApiClient : replaced return value with null for org/sanmibuh/tedee/lock/infrastructure/secondary/TedeeClientConfiguration::tedeeApiClient → KILLED |
return apiClient; |
| 27 | } | |
| 28 | ||
| 29 | @Bean | |
| 30 | CallbackApi callbackApi(final ApiClient apiClient) { | |
| 31 |
1
1. callbackApi : replaced return value with null for org/sanmibuh/tedee/lock/infrastructure/secondary/TedeeClientConfiguration::callbackApi → KILLED |
return new CallbackApi(apiClient); |
| 32 | } | |
| 33 | ||
| 34 | @Bean | |
| 35 | LockApi lockApi(final ApiClient apiClient) { | |
| 36 |
1
1. lockApi : replaced return value with null for org/sanmibuh/tedee/lock/infrastructure/secondary/TedeeClientConfiguration::lockApi → KILLED |
return new LockApi(apiClient); |
| 37 | } | |
| 38 | } | |
Mutations | ||
| 26 |
1.1 |
|
| 31 |
1.1 |
|
| 36 |
1.1 |