aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/onap/vid/client/SyncRestClient.java
diff options
context:
space:
mode:
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/client/SyncRestClient.java')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/client/SyncRestClient.java24
1 files changed, 2 insertions, 22 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/client/SyncRestClient.java b/vid-app-common/src/main/java/org/onap/vid/client/SyncRestClient.java
index f7087568d..5c65c8af4 100644
--- a/vid-app-common/src/main/java/org/onap/vid/client/SyncRestClient.java
+++ b/vid-app-common/src/main/java/org/onap/vid/client/SyncRestClient.java
@@ -21,8 +21,8 @@
package org.onap.vid.client;
-import static org.apache.commons.lang3.StringUtils.isEmpty;
import static org.onap.vid.client.UnirestPatchKt.patched;
+import static org.onap.vid.utils.KotlinUtilsKt.JOSHWORKS_JACKSON_OBJECT_MAPPER;
import com.att.eelf.configuration.EELFLogger;
import io.joshworks.restclient.http.HttpResponse;
@@ -250,27 +250,7 @@ public class SyncRestClient implements SyncRestClientInterface {
}
private ObjectMapper defaultObjectMapper() {
- com.fasterxml.jackson.databind.ObjectMapper objectMapper = new com.fasterxml.jackson.databind.ObjectMapper();
-
- return new ObjectMapper() {
- @Override
- public <T> T readValue(String value, Class<T> aClass) {
- try {
- return isEmpty(value) ? null : objectMapper.readValue(value, aClass);
- } catch (IOException e) {
- throw new SyncRestClientException("IOException while reading value", e);
- }
- }
-
- @Override
- public String writeValue(Object value) {
- try {
- return objectMapper.writeValueAsString(value);
- } catch (IOException e) {
- throw new SyncRestClientException("IOException while writing value", e);
- }
- }
- };
+ return JOSHWORKS_JACKSON_OBJECT_MAPPER;
}
private CloseableHttpClient defaultHttpClient() {