SOL003 Adapter removing duplicate code
[so.git] / adapters / etsi-sol003-adapter / etsi-sol003-adapter-common / src / main / java / org / onap / so / adapters / etsi / sol003 / adapter / common / configuration / AbstractServiceProviderConfiguration.java
@@ -1,27 +1,25 @@
 /*-
  * ============LICENSE_START=======================================================
- *  Copyright (C) 2019 Nordix Foundation.
+ *  Copyright (C) 2020 Ericsson. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- *
+ * 
  *      http://www.apache.org/licenses/LICENSE-2.0
- *
+ * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *
+ * 
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
-
-package org.onap.so.adapters.etsisol003adapter.lcm.extclients;
+package org.onap.so.adapters.etsi.sol003.adapter.common.configuration;
 
 import java.util.Iterator;
-import org.onap.so.adapters.etsisol003adapter.lcm.v1.JSON;
 import org.springframework.http.converter.HttpMessageConverter;
 import org.springframework.http.converter.json.GsonHttpMessageConverter;
 import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
@@ -33,6 +31,7 @@ import com.google.gson.Gson;
  * that will be useful to some such classes.
  *
  * @author gareth.roper@est.tech
+ * @author Waqas Ikram (waqas.ikram@est.tech)
  */
 public abstract class AbstractServiceProviderConfiguration {
 
@@ -43,7 +42,9 @@ public abstract class AbstractServiceProviderConfiguration {
                 iterator.remove();
             }
         }
-        final Gson gson = new JSON().getGson();
-        restTemplate.getMessageConverters().add(new GsonHttpMessageConverter(gson));
+        restTemplate.getMessageConverters().add(new GsonHttpMessageConverter(getGson()));
     }
+
+    protected abstract Gson getGson();
+
 }