diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapper.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapper.java
index 5a35e10..95b039b 100644
--- a/vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapper.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapper.java
@@ -48,8 +48,12 @@
         setStatus(response.getStatus());
     }
 
+	public MsoResponseWrapper(int status, String entity) {
+		this.status = status;
+		this.entity = entity;
+	}
 
-    /** The status. */
+	/** The status. */
 	@JsonProperty("status")
 	private int status;
 	
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoUtil.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoUtil.java
index 999188f..6a1030c 100644
--- a/vid-app-common/src/main/java/org/onap/vid/mso/MsoUtil.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoUtil.java
@@ -3,13 +3,14 @@
  * VID
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2018 Nokia. 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.
@@ -20,111 +21,27 @@
 
 package org.onap.vid.mso;
 
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
 import io.joshworks.restclient.http.HttpResponse;
-import org.apache.commons.lang3.ObjectUtils;
-import org.glassfish.jersey.client.ClientResponse;
-import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
 
-import static org.onap.vid.utils.Logging.getMethodName;
+import java.util.Objects;
 
-/**
- * The Class MsoUtil.
- */
 public class MsoUtil {
-	
-	/** The logger. */
-	private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoUtil.class);
 
-	/**
-	 * Wrap response.
-	 *
-	 * @param body the body
-	 * @param statusCode the status code
-	 * @return the mso response wrapper
-	 */
-	public static MsoResponseWrapper wrapResponse ( String body, int statusCode ) {
-		
-		MsoResponseWrapper w = new MsoResponseWrapper();
-		w.setStatus (statusCode);
-		w.setEntity(body);
-		
-		return w;
-	}
+    private MsoUtil() {
+    }
 
-	/**
-	 * Wrap response.
-	 *
-	 * @param cres the cres
-	 * @return the mso response wrapper
-	 */
-	public static MsoResponseWrapper wrapResponse (ClientResponse cres) {	
-		String respStr = "";
-		int statuscode = 0;
-		if ( cres != null ) {
-			respStr = cres.readEntity(String.class);
-			statuscode = cres.getStatus();
-		}
-		MsoResponseWrapper w = MsoUtil.wrapResponse ( respStr, statuscode );
-		return (w);
-	}
-	
-	/**
-	 * Wrap response.
-	 *
-	 * @param rs the rs
-	 * @return the mso response wrapper
-	 */
-	public static MsoResponseWrapper wrapResponse (RestObject<String> rs) {
-		String respStr = null;
-		int status = 0;
-		if ( rs != null ) {
-			respStr = rs.get() != null ? rs.get() : rs.getRaw();
-			status = rs.getStatusCode();
-		}
-		MsoResponseWrapper w = MsoUtil.wrapResponse ( respStr, status );
-		return (w);
-	}	
-	
-	public static <T> MsoResponseWrapper wrapResponse (HttpResponse<T> rs) {
-		MsoResponseWrapper w = new MsoResponseWrapper();
-		w.setStatus (rs.getStatus());
-		if(rs.getRawBody() != null) {
-			w.setEntity(ObjectUtils.toString(rs.getBody()));
-		}
-		return w;
-	}
+    public static MsoResponseWrapper wrapResponse(RestObject<String> restObject) {
+        String response = restObject.get() != null ? restObject.get() : restObject.getRaw();
+        int status = restObject.getStatusCode();
+        return new MsoResponseWrapper(status, response);
+    }
 
-	/**
-	 * Convert pojo to string.
-	 *
-	 * @param <T> the generic type
-	 * @param t the t
-	 * @return the string
-	 * @throws JsonProcessingException the json processing exception
-	 */
-	public static <T> String convertPojoToString ( T t ) {
-		ObjectMapper mapper = new ObjectMapper();
-		String rJsonStr = "";
-	    if ( t != null ) {
-		    try {
-		    	rJsonStr = mapper.writeValueAsString(t);
-		    }
-		    catch ( com.fasterxml.jackson.core.JsonProcessingException j ) {
-		    	logger.debug(EELFLoggerDelegate.debugLogger,getMethodName() + " Unable to parse object of type " + t.getClass().getName() + " as json", j);
-		    }
-	    }
-	    return (rJsonStr);
-	}
-	
-	/**
-	 * The main method.
-	 *
-	 * @param args the arguments
-	 */
-	public static void main(String[] args) {
-		// TODO Auto-generated method stub
-
-	}
+    public static <T> MsoResponseWrapper wrapResponse(HttpResponse<T> httpResponse) {
+        MsoResponseWrapper msoResponseWrapper = new MsoResponseWrapper();
+        msoResponseWrapper.setStatus(httpResponse.getStatus());
+        if (httpResponse.getRawBody() != null) {
+            msoResponseWrapper.setEntity(Objects.toString(httpResponse.getBody()));
+        }
+        return msoResponseWrapper;
+    }
 }
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/RestObject.java b/vid-app-common/src/main/java/org/onap/vid/mso/RestObject.java
index 7ebecba..cf39414 100644
--- a/vid-app-common/src/main/java/org/onap/vid/mso/RestObject.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/RestObject.java
@@ -3,13 +3,14 @@
  * VID
  * ================================================================================
  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Nokia. 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.
@@ -20,97 +21,37 @@
 
 package org.onap.vid.mso;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.common.base.MoreObjects;
-import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
 
-import javax.ws.rs.core.Response;
-
-import static org.onap.vid.utils.Logging.getMethodCallerName;
-
-/**
- * The Class RestObject.
- *
- * @param <T> the generic type
- */
 public class RestObject<T> {
 
-    static final ObjectMapper objectMapper = new ObjectMapper();
-
-	/**
-	 * Generic version of the RestObject class.
-	 *
-	 */
-    // T stands for "Type"
     private T t;
-    
-    // The string source of t, if available
+
+    /**
+     * The string source of t, if available
+     */
     private String rawT;
 
-    /** The status code. */
-    private int statusCode= 0;
+    private int statusCode = 0;
 
     public RestObject() {
     }
 
-    public void copyFrom(RestObject<T> src) {
-        set(src.get());
-        setRaw(src.getRaw());
-        setStatusCode(src.getStatusCode());
+    public void set(T t) {
+        this.t = t;
     }
 
-    public RestObject(Response cres, Class<?> tClass, EELFLoggerDelegate logger) {
-
-        String rawEntity = null;
-        try {
-            cres.bufferEntity();
-            rawEntity = cres.readEntity(String.class);
-            T t = (T) objectMapper.readValue(rawEntity, tClass);
-            this.set(t);
-        }
-        catch ( Exception e ) {
-            try {
-                this.setRaw(rawEntity);
-                logger.debug(EELFLoggerDelegate.debugLogger, "<== " + getMethodCallerName() + " Error reading response entity as " + tClass + ": , e="
-                        + e.getMessage() + ", Entity=" + rawEntity);
-            } catch (Exception e2) {
-                logger.debug(EELFLoggerDelegate.debugLogger, "<== " + getMethodCallerName() + " No response entity, this is probably ok, e="
-                        + e.getMessage());
-            }
-        }
-
-        int status = cres.getStatus();
-        this.setStatusCode (status);
+    public T get() {
+        return t;
     }
 
+    public void setStatusCode(int v) {
+        this.statusCode = v;
+    }
 
-    /**
-     * Sets the.
-     *
-     * @param t the t
-     */
-    public void set(T t) { this.t = t; }
-    
-    /**
-     * Gets the.
-     *
-     * @return the t
-     */
-    public T get() { return t; }
-	
-    /**
-     * Sets the status code.
-     *
-     * @param v the new status code
-     */
-    public void setStatusCode(int v) { this.statusCode = v; }
-    
-    /**
-     * Gets the status code.
-     *
-     * @return the status code
-     */
-    public int getStatusCode() { return this.statusCode; }
+    public int getStatusCode() {
+        return this.statusCode;
+    }
 
     public String getRaw() {
         return rawT;
@@ -120,6 +61,12 @@
         this.rawT = rawT;
     }
 
+    public void copyFrom(RestObject<T> src) {
+        set(src.get());
+        setRaw(src.getRaw());
+        setStatusCode(src.getStatusCode());
+    }
+
     @Override
     public String toString() {
         return MoreObjects.toStringHelper(this)
diff --git a/vid-app-common/src/test/java/org/onap/vid/mso/MsoUtilTest.java b/vid-app-common/src/test/java/org/onap/vid/mso/MsoUtilTest.java
index 9d625c4..82242b6 100644
--- a/vid-app-common/src/test/java/org/onap/vid/mso/MsoUtilTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/mso/MsoUtilTest.java
@@ -1,50 +1,83 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2019 Nokia. 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.
+ * ============LICENSE_END=========================================================
+ */
+
 package org.onap.vid.mso;
 
-import org.glassfish.jersey.client.ClientResponse;
-import org.junit.Assert;
+import io.joshworks.restclient.http.HttpResponse;
+import io.joshworks.restclient.http.mapper.ObjectMapper;
+import org.apache.http.HttpResponseFactory;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.DefaultHttpResponseFactory;
+import org.apache.http.message.BasicStatusLine;
 import org.junit.Test;
 
+import static org.apache.http.HttpStatus.SC_OK;
+import static org.apache.http.HttpVersion.HTTP_1_1;
+import static org.assertj.core.api.Assertions.assertThat;
+
 public class MsoUtilTest {
 
-	private MsoUtil createTestSubject() {
-		return new MsoUtil();
-	}
+    @Test
+    public void shouldWrapRestObject() {
+        // given
+        String entity = "entity";
+        RestObject<String> restObject = new RestObject<>();
+        restObject.set(entity);
+        restObject.setStatusCode(SC_OK);
+        // when
+        MsoResponseWrapper result = MsoUtil.wrapResponse(restObject);
+        // then
+        assertThat(result.getEntity()).isEqualTo(entity);
+        assertThat(result.getStatus()).isEqualTo(SC_OK);
+    }
 
-	@Test
-	public void testWrapResponse() throws Exception {
-		String body = "";
-		int statusCode = 0;
-		MsoResponseWrapper result;
+    @Test
+    public void shouldWrapHttpResponse() throws Exception {
+        // given
+        HttpResponse<String> httpResponse = createTestHttpResponse(SC_OK, null);
+        // when
+        MsoResponseWrapper result = MsoUtil.wrapResponse(httpResponse);
+        // then
+        assertThat(result.getEntity()).isEqualTo(null);
+        assertThat(result.getStatus()).isEqualTo(SC_OK);
+    }
 
-		// default test
-		result = MsoUtil.wrapResponse(body, statusCode);
-	}
+    @Test
+    public void shouldWrapHttpResponseWithEntity() throws Exception {
+        // given
+        String entity = "entity";
+        HttpResponse<String> httpResponse = createTestHttpResponse(SC_OK, entity);
+        // when
+        MsoResponseWrapper result = MsoUtil.wrapResponse(httpResponse);
+        // then
+        assertThat(result.getEntity()).isEqualTo(entity);
+        assertThat(result.getStatus()).isEqualTo(SC_OK);
+    }
 
-
-	@Test
-	public void testWrapResponse_2() throws Exception {
-		RestObject<String> rs = null;
-		MsoResponseWrapper result;
-
-		// test 1
-		result = MsoUtil.wrapResponse(rs);
-		Assert.assertNotNull(result);
-	}
-
-	@Test
-	public void testConvertPojoToString() throws Exception {
-		String result;
-
-		// test 1
-		result = MsoUtil.convertPojoToString(null);
-		Assert.assertEquals("", result);
-	}
-
-	@Test
-	public void testMain() throws Exception {
-		String[] args = new String[] { "" };
-
-		// default test
-		MsoUtil.main(args);
-	}
+    private HttpResponse<String> createTestHttpResponse(int statusCode, String entity) throws Exception {
+        HttpResponseFactory factory = new DefaultHttpResponseFactory();
+        org.apache.http.HttpResponse response = factory.newHttpResponse(new BasicStatusLine(HTTP_1_1, statusCode, null), null);
+        if (entity != null) {
+            response.setEntity(new StringEntity(entity));
+        }
+        return new HttpResponse<>(response, String.class, null);
+    }
 }
\ No newline at end of file
