diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java
index 3994208..5bd4df7 100644
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java
+++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/adapter/network/tasks/NetworkAdapterRestV1Test.java
@@ -4,6 +4,8 @@
  * ================================================================================
  * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
+ * Copyright (C) 2018 Nokia.
+ * ================================================================================
  * 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
@@ -20,7 +22,6 @@
 
 package org.onap.so.bpmn.infrastructure.adapter.network.tasks;
 
-import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 import javax.xml.bind.JAXBException;
@@ -31,23 +32,24 @@
 import org.junit.Test;
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
+import org.onap.so.adapters.nwrest.CreateNetworkRequest;
 import org.onap.so.adapters.nwrest.CreateNetworkResponse;
+import org.onap.so.adapters.nwrest.DeleteNetworkRequest;
+import org.onap.so.adapters.nwrest.DeleteNetworkResponse;
 import org.onap.so.adapters.nwrest.UpdateNetworkError;
 import org.onap.so.adapters.nwrest.UpdateNetworkRequest;
 import org.onap.so.adapters.nwrest.UpdateNetworkResponse;
 import org.onap.so.bpmn.BaseTaskTest;
-import org.onap.so.client.exception.BadResponseException;
 import org.onap.so.client.exception.ExceptionBuilder;
-import org.onap.so.client.exception.MapperException;
 import org.onap.so.utils.Components;
 import org.onap.logging.filter.base.ONAPComponents;
+import static org.junit.Assert.assertTrue;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.ArgumentMatchers.eq;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
@@ -60,13 +62,22 @@
     @Mock
     ExceptionBuilder exceptionBuilder = new ExceptionBuilder();
 
+    private static final String CREATE_NETWORK_RESPONSE = "createNetworkResponse";
+    private static final String DELETE_NETWORK_RESPONSE = "deleteNetworkResponse";
+    private static final String CREATE_NETWORK_ERROR = "createNetworkError";
+    private static final String DELETE_NETWORK_ERROR = "deleteNetworkError";
+    private static final String NET_ID_FOR_CREATE_NETWORK_RESPONSE = "netIdForCreateNetworkResponse";
+    private static final String NET_ID_FOR_DELETE_NETWORK_RESPONSE = "netIdForDeleteNetworkResponse";
+    private static final String CREATE_NETWORK_ERROR_MESSAGE = "createNetErrorMessage";
+    private static final String DELETE_NETWORK_ERROR_MESSAGE = "deleteNetErrorMessage";
+
     @Before
     public void setup() {
         delegateExecution = new DelegateExecutionFake();
     }
 
     @Test
-    public void testUnmarshalXml() throws IOException, JAXBException {
+    public void testUnmarshalXml() throws JAXBException {
         String xml =
                 "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><createNetworkResponse><messageId>ec37c121-e3ec-4697-8adf-2d7dca7044fc</messageId><networkCreated>true</networkCreated><networkFqdn>someNetworkFqdn</networkFqdn><networkId>991ec7bf-c9c4-4ac1-bb9c-4b61645bddb3</networkId><networkStackId>someStackId</networkStackId><neutronNetworkId>9c47521a-2916-4018-b2bc-71ab767497e3</neutronNetworkId><rollback><cloudId>someCloudId</cloudId><modelCustomizationUuid>b7171cdd-8b05-459b-80ef-2093150e8983</modelCustomizationUuid><msoRequest><requestId>90b32315-176e-4dab-bcf1-80eb97a1c4f4</requestId><serviceInstanceId>71e7db22-7907-4d78-8fcc-8d89d28e90be</serviceInstanceId></msoRequest><networkCreated>true</networkCreated><networkStackId>someStackId</networkStackId><networkType>SomeNetworkType</networkType><neutronNetworkId>9c47521a-2916-4018-b2bc-71ab767497e3</neutronNetworkId><tenantId>b60da4f71c1d4b35b8113d4eca6deaa1</tenantId></rollback><subnetMap><entry><key>6b381fa9-48ce-4e16-9978-d75309565bb6</key><value>bc1d5537-860b-4894-8eba-6faff41e648c</value></entry></subnetMap></createNetworkResponse>";
         CreateNetworkResponse response =
@@ -76,11 +87,11 @@
     }
 
     @Test
-    public void testUnmarshalXmlUpdate() throws IOException, JAXBException {
+    public void testUnmarshalXmlUpdate() throws JAXBException {
         UpdateNetworkResponse expectedResponse = new UpdateNetworkResponse();
         expectedResponse.setMessageId("ec100bcc-2659-4aa4-b4d8-3255715c2a51");
         expectedResponse.setNetworkId("80de31e3-cc78-4111-a9d3-5b92bf0a39eb");
-        Map<String, String> subnetMap = new HashMap<String, String>();
+        Map<String, String> subnetMap = new HashMap<>();
         subnetMap.put("95cd8437-25f1-4238-8720-cbfe7fa81476", "d8d16606-5d01-4822-b160-9a0d257303e0");
         expectedResponse.setSubnetMap(subnetMap);
         String xml =
@@ -91,7 +102,7 @@
     }
 
     @Test
-    public void processCallbackTest() throws MapperException, BadResponseException, IOException {
+    public void processCallbackTest() {
         UpdateNetworkRequest updateNetworkRequest = new UpdateNetworkRequest();
         UpdateNetworkResponse updateNetworkResponse = new UpdateNetworkResponse();
         updateNetworkResponse.setMessageId("messageId");
@@ -105,7 +116,7 @@
     }
 
     @Test
-    public void processCallbackErrorTest() throws MapperException, BadResponseException, IOException {
+    public void processCallbackErrorTest() {
         UpdateNetworkRequest updateNetworkRequest = new UpdateNetworkRequest();
         UpdateNetworkError updateNetworkResponse = new UpdateNetworkError();
         updateNetworkResponse.setMessageId("messageId");
@@ -125,4 +136,67 @@
         verify(exceptionBuilder, times(1)).buildAndThrowWorkflowException(any(DelegateExecution.class), eq(7000),
                 eq("test error message"), eq(Components.OPENSTACK));
     }
+
+    @Test
+    public void processCallback_createNetworkResponse() {
+        delegateExecution.setVariable("networkAdapterRequest", new CreateNetworkRequest());
+        delegateExecution.setVariable("NetworkAResponse_MESSAGE",
+                createNetworkResponse(CREATE_NETWORK_RESPONSE, NET_ID_FOR_CREATE_NETWORK_RESPONSE));
+        networkAdapterRestV1Tasks.processCallback(delegateExecution);
+
+        Object result = delegateExecution.getVariable("createNetworkResponse");
+        assertTrue(result instanceof CreateNetworkResponse);
+        CreateNetworkResponse createNetworkResponse = (CreateNetworkResponse) result;
+        assertEquals(createNetworkResponse.getNetworkId(), NET_ID_FOR_CREATE_NETWORK_RESPONSE);
+    }
+
+    @Test
+    public void processCallback_deleteNetworkResponse() {
+        delegateExecution.setVariable("networkAdapterRequest", new DeleteNetworkRequest());
+        delegateExecution.setVariable("NetworkAResponse_MESSAGE",
+                createNetworkResponse(DELETE_NETWORK_RESPONSE, NET_ID_FOR_DELETE_NETWORK_RESPONSE));
+        networkAdapterRestV1Tasks.processCallback(delegateExecution);
+
+        Object result = delegateExecution.getVariable("deleteNetworkResponse");
+        assertTrue(result instanceof DeleteNetworkResponse);
+        DeleteNetworkResponse deleteNetworkResponse = (DeleteNetworkResponse) result;
+        assertEquals(deleteNetworkResponse.getNetworkId(), NET_ID_FOR_DELETE_NETWORK_RESPONSE);
+    }
+
+    @Test
+    public void processCallback_createNetworkError() {
+        try {
+            delegateExecution.setVariable("networkAdapterRequest", new CreateNetworkRequest());
+            delegateExecution.setVariable("NetworkAResponse_MESSAGE",
+                    createNetworkError(CREATE_NETWORK_ERROR, CREATE_NETWORK_ERROR_MESSAGE));
+            networkAdapterRestV1Tasks.processCallback(delegateExecution);
+        } catch (Exception e) {
+            assertEquals(e.getMessage(), CREATE_NETWORK_ERROR_MESSAGE);
+        }
+    }
+
+    @Test
+    public void processCallback_deleteNetworkError() {
+        try {
+            delegateExecution.setVariable("networkAdapterRequest", new DeleteNetworkRequest());
+            delegateExecution.setVariable("NetworkAResponse_MESSAGE",
+                    createNetworkError(DELETE_NETWORK_ERROR, DELETE_NETWORK_ERROR_MESSAGE));
+            networkAdapterRestV1Tasks.processCallback(delegateExecution);
+        } catch (Exception e) {
+            assertEquals(e.getMessage(), DELETE_NETWORK_ERROR_MESSAGE);
+        }
+    }
+
+    private String createNetworkResponse(String networkResponseType, String networkId) {
+
+        return "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><" + networkResponseType + "><networkId>"
+                + networkId + "</networkId></" + networkResponseType + ">";
+    }
+
+    private String createNetworkError(String networkErrorType, String message) {
+
+        return "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><" + networkErrorType + "><message>"
+                + message + "</message></" + networkErrorType + ">";
+    }
+
 }
