package com.juick.server.configuration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.http.client.OkHttp3ClientHttpRequestFactory; import org.springframework.web.client.RestTemplate; import javax.inject.Inject; @Configuration public class ActivityPubClientConfig { @Inject ActivityPubClientErrorHandler activityPubClientErrorHandler; @Bean public RestTemplate apClient() { RestTemplate restTemplate = new RestTemplate(new OkHttp3ClientHttpRequestFactory()); restTemplate.setErrorHandler(activityPubClientErrorHandler); return restTemplate; } }