diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/BadResponseException.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/BadResponseException.java
deleted file mode 100644
index 7b1066d..0000000
--- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/BadResponseException.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. 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.so.client.exception;
-
-public class BadResponseException extends Exception {
-
-    String responseCode;
-
-    public BadResponseException() {}
-
-    public BadResponseException(String message) {
-        super(message);
-    }
-
-    public BadResponseException(String message, String responseCode) {
-        super(message);
-        this.responseCode = responseCode;
-    }
-
-    public String getResponseCode() {
-        return responseCode;
-    }
-
-}
diff --git a/bpmn/so-bpmn-tasks/pom.xml b/bpmn/so-bpmn-tasks/pom.xml
index f7a4e5e..e89bbec 100644
--- a/bpmn/so-bpmn-tasks/pom.xml
+++ b/bpmn/so-bpmn-tasks/pom.xml
@@ -252,5 +252,10 @@
       <version>${grpc.version}</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.onap.so</groupId>
+      <artifactId>so-optimization-clients</artifactId>
+      <version>${project.version}</version>
+    </dependency>
   </dependencies>
 </project>
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java
index f10b503..71ea9fa 100644
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java
+++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/buildingblock/SniroHomingV2.java
@@ -440,7 +440,8 @@
         if (!candidates.isEmpty()) {
             for (Candidate c : candidates) {
                 org.onap.so.client.sniro.beans.Candidate can = new org.onap.so.client.sniro.beans.Candidate();
-                can.setIdentifierType(c.getIdentifierType());
+                can.setIdentifierType(
+                        org.onap.so.client.sniro.beans.CandidateType.valueOf(c.getIdentifierType().name()));
                 can.setIdentifiers(c.getIdentifiers());
                 can.setCloudOwner(c.getCloudOwner());
                 candidateList.add(can);
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/OofClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/OofClient.java
deleted file mode 100644
index 8b0cf69..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/OofClient.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2018 Intel Corp.  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.so.client.oof;
-
-
-import org.camunda.bpm.engine.delegate.BpmnError;
-import org.onap.so.client.BaseClient;
-import org.onap.so.client.exception.BadResponseException;
-import org.onap.so.client.oof.beans.OofProperties;
-import org.onap.so.client.oof.beans.OofRequest;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.ParameterizedTypeReference;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.MediaType;
-import org.springframework.stereotype.Component;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import java.util.LinkedHashMap;
-
-@Component
-public class OofClient {
-
-    private static final Logger logger = LoggerFactory.getLogger(OofClient.class);
-    public static final String X_MINOR_VERSION = "X-MinorVersion";
-    public static final String X_PATCH_VERSION = "X-PatchVersion";
-    public static final String X_LATEST_VERSION = "X-LatestVersion";
-
-    @Autowired
-    private OofProperties oofProperties;
-
-    @Autowired
-    private OofValidator validator;
-
-
-    /**
-     * Makes a rest call to oof to perform homing and licensing for a list of demands
-     *
-     * @param homingRequest
-     * @return
-     * @throws JsonProcessingException
-     * @throws BpmnError
-     */
-    public void postDemands(OofRequest homingRequest) throws BadResponseException, JsonProcessingException {
-        logger.trace("Started oof Client Post Demands");
-        String url = oofProperties.getHost() + oofProperties.getUri();
-        logger.debug("Post demands url: " + url);
-        logger.debug("Post demands payload: " + homingRequest.toJsonString());
-
-        HttpHeaders header = new HttpHeaders();
-        header.setContentType(MediaType.APPLICATION_JSON);
-        header.set(HttpHeaders.AUTHORIZATION, oofProperties.getHeaders().get("auth"));
-        header.set(X_PATCH_VERSION, oofProperties.getHeaders().get("patchVersion"));
-        header.set(X_MINOR_VERSION, oofProperties.getHeaders().get("minorVersion"));
-        header.set(X_LATEST_VERSION, oofProperties.getHeaders().get("latestVersion"));
-        BaseClient<String, LinkedHashMap<?, ?>> baseClient = new BaseClient<>();
-
-        baseClient.setTargetUrl(url);
-        baseClient.setHttpHeader(header);
-
-        LinkedHashMap<?, ?> response =
-                baseClient.post(homingRequest.toJsonString(), new ParameterizedTypeReference<LinkedHashMap<?, ?>>() {});
-        validator.validateDemandsResponse(response);
-        logger.trace("Completed OOF Client Post Demands");
-    }
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/OofValidator.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/OofValidator.java
deleted file mode 100644
index abbf52e..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/OofValidator.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2018 Intel Corp. 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.so.client.oof;
-
-
-import org.json.JSONObject;
-import org.onap.so.client.exception.BadResponseException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-import java.util.LinkedHashMap;
-import static org.apache.commons.lang.StringUtils.isNotBlank;
-
-
-@Component
-public class OofValidator {
-
-    private static final Logger logger = LoggerFactory.getLogger(OofValidator.class);
-
-    /**
-     * Validates the synchronous homing response from oof
-     *
-     * @throws BadResponseException
-     */
-    public void validateDemandsResponse(LinkedHashMap<?, ?> response) throws BadResponseException {
-        logger.debug("Validating oofs synchronous response");
-        if (!response.isEmpty()) {
-            JSONObject jsonResponse = new JSONObject(response);
-            if (jsonResponse.has("requestStatus")) {
-                String status = jsonResponse.getString("requestStatus");
-                if (status.equals("accepted")) {
-                    logger.debug("oofs synchronous response indicates accepted");
-                } else {
-                    String message = jsonResponse.getString("statusMessage");
-                    if (isNotBlank(message)) {
-                        logger.debug("oofs response indicates failed: " + message);
-                    } else {
-                        logger.debug("oofs response indicates failed: no status message provided");
-                        message = "error message not provided";
-                    }
-                    throw new BadResponseException("oofs synchronous response indicates failed: " + message);
-                }
-            } else {
-                logger.debug("oofs synchronous response does not contain: request status");
-                throw new BadResponseException("oofs synchronous response does not contain: request status");
-            }
-        } else {
-            logger.debug("oofs synchronous response is empty");
-            throw new BadResponseException("oofs synchronous response i is empty");
-        }
-    }
-
-    /**
-     * Validates the asynchronous/callback response from oof which contains the homing and licensing solutions
-     *
-     * @throws BadResponseException
-     */
-    public void validateSolution(String response) throws BadResponseException {
-        logger.debug("Validating oofs asynchronous callback response");
-        if (isNotBlank(response)) {
-            JSONObject jsonResponse = new JSONObject(response);
-            if (!jsonResponse.has("serviceException")) {
-                logger.debug("oofs asynchronous response is valid");
-            } else {
-                String message = jsonResponse.getJSONObject("serviceException").getString("text");
-                if (isNotBlank(message)) {
-                    logger.debug("oofs response contains a service exception: " + message);
-                } else {
-                    logger.debug("oofs response contains a service exception: no service exception text provided");
-                    message = "error message not provided";
-                }
-                throw new BadResponseException("oofs asynchronous response contains a service exception: " + message);
-            }
-        } else {
-            logger.debug("oofs asynchronous response is empty");
-            throw new BadResponseException("oofs asynchronous response is empty");
-        }
-    }
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/LicenseDemand.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/LicenseDemand.java
deleted file mode 100644
index e64a545..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/LicenseDemand.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2019 Intel Corp.  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.so.client.oof.beans;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonRootName;
-import java.io.Serializable;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({"resourceModuleName", "serviceResourceId", "tenantId", "resourceModelInfo"})
-@JsonRootName("licenseDemand")
-public class LicenseDemand implements Serializable {
-
-    private static final long serialVersionUID = -759180997599143791L;
-
-    @JsonProperty("resourceModuleName")
-    private String resourceModuleName;
-    @JsonProperty("serviceResourceId")
-    private String serviceResourceId;
-    @JsonProperty("tenantId")
-    private String tenantId;
-    @JsonProperty("resourceModelInfo")
-    private ResourceModelInfo resourceModelInfo;
-
-    @JsonProperty("resourceModuleName")
-    public String getResourceModuleName() {
-        return resourceModuleName;
-    }
-
-    @JsonProperty("resourceModuleName")
-    public void setResourceModuleName(String resourceModuleName) {
-        this.resourceModuleName = resourceModuleName;
-    }
-
-    @JsonProperty("serviceResourceId")
-    public String getServiceResourceId() {
-        return serviceResourceId;
-    }
-
-    @JsonProperty("serviceResourceId")
-    public void setServiceResourceId(String serviceResourceId) {
-        this.serviceResourceId = serviceResourceId;
-    }
-
-    @JsonProperty("tenantId")
-    public String getTenantId() {
-        return tenantId;
-    }
-
-    @JsonProperty("tenantId")
-    public void setTenantId(String tenantId) {
-        this.tenantId = tenantId;
-    }
-
-    @JsonProperty("resourceModelInfo")
-    public ResourceModelInfo getResourceModelInfo() {
-        return resourceModelInfo;
-    }
-
-    @JsonProperty("resourceModelInfo")
-    public void setResourceModelInfo(ResourceModelInfo resourceModelInfo) {
-        this.resourceModelInfo = resourceModelInfo;
-    }
-
-    public void setResourceModelInfo(ModelInfo modelInfo) {
-        ResourceModelInfo localResourceModelInfo = new ResourceModelInfo();
-        localResourceModelInfo.setModelVersionId(modelInfo.getModelVersionId());
-        localResourceModelInfo.setModelVersionId(modelInfo.getModelVersionId());
-        localResourceModelInfo.setModelVersion(modelInfo.getModelVersion());
-        localResourceModelInfo.setModelName(modelInfo.getModelName());
-        localResourceModelInfo.setModelType(modelInfo.getModelType());
-        localResourceModelInfo.setModelInvariantId(modelInfo.getModelInvariantId());
-        localResourceModelInfo.setModelCustomizationName(modelInfo.getModelCustomizationName());
-        this.resourceModelInfo = localResourceModelInfo;
-    }
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/LicenseInfo.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/LicenseInfo.java
deleted file mode 100644
index 74ff933..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/LicenseInfo.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2019 Intel Corp.  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.so.client.oof.beans;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonRootName;
-import java.io.Serializable;
-import java.util.ArrayList;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonRootName("licenseInfo")
-public class LicenseInfo implements Serializable {
-
-    private static final long serialVersionUID = -759180997599143791L;
-
-    @JsonProperty("licenseDemands")
-    private ArrayList<LicenseDemand> licenseDemands = new ArrayList<>();
-
-
-    @JsonProperty("licenseDemands")
-    public ArrayList<LicenseDemand> getLicenseDemands() {
-        return licenseDemands;
-    }
-
-    @JsonProperty("licenseDemands")
-    public void setLicenseDemands(ArrayList<LicenseDemand> licenseDemands) {
-        this.licenseDemands = licenseDemands;
-    }
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/ModelInfo.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/ModelInfo.java
deleted file mode 100644
index 433de22..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/ModelInfo.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2018 Intel Corp.  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.so.client.oof.beans;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonRootName;
-import java.io.Serializable;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({"modelType", "modelInvariantId", "modelVersionId", "modelName", "modelVersion",
-        "modelCustomizationName"})
-@JsonRootName("modelInfo")
-public class ModelInfo implements Serializable {
-
-    private static final long serialVersionUID = -759180997599143791L;
-
-    @JsonProperty("modelType")
-    private String modelType;
-    @JsonProperty("modelInvariantId")
-    private String modelInvariantId;
-    @JsonProperty("modelVersionId")
-    private String modelVersionId;
-    @JsonProperty("modelName")
-    private String modelName;
-    @JsonProperty("modelVersion")
-    private String modelVersion;
-    @JsonProperty("modelCustomizationName")
-    private String modelCustomizationName;
-
-    @JsonProperty("modelType")
-    public String getModelType() {
-        return modelType;
-    }
-
-    @JsonProperty("modelType")
-    public void setModelType(String modelType) {
-        this.modelType = modelType;
-    }
-
-    @JsonProperty("modelInvariantId")
-    public String getModelInvariantId() {
-        return modelInvariantId;
-    }
-
-    @JsonProperty("modelInvariantId")
-    public void setModelInvariantId(String modelInvariantId) {
-        this.modelInvariantId = modelInvariantId;
-    }
-
-    @JsonProperty("modelVersionId")
-    public String getModelVersionId() {
-        return modelVersionId;
-    }
-
-    @JsonProperty("modelVersionId")
-    public void setModelVersionId(String modelVersionId) {
-        this.modelVersionId = modelVersionId;
-    }
-
-    @JsonProperty("modelName")
-    public String getModelName() {
-        return modelName;
-    }
-
-    @JsonProperty("modelName")
-    public void setModelName(String modelName) {
-        this.modelName = modelName;
-    }
-
-    @JsonProperty("modelVersion")
-    public String getModelVersion() {
-        return modelVersion;
-    }
-
-    @JsonProperty("modelVersion")
-    public void setModelVersion(String modelVersion) {
-        this.modelVersion = modelVersion;
-    }
-
-    @JsonProperty("modelCustomizationName")
-    public String getModelCustomizationName() {
-        return modelCustomizationName;
-    }
-
-    @JsonProperty("modelCustomizationName")
-    public void setModelCustomizationName(String modelCustomizationName) {
-        this.modelCustomizationName = modelCustomizationName;
-    }
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/OofProperties.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/OofProperties.java
deleted file mode 100644
index 84e29b6..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/OofProperties.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2018 Intel Corp. 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.so.client.oof.beans;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.context.annotation.Configuration;
-import java.util.Map;
-
-@Configuration
-@ConfigurationProperties(prefix = "oof")
-public class OofProperties {
-
-    private String host;
-    private String uri;
-
-    private Map<String, String> headers;
-
-
-    public String getHost() {
-        return host;
-    }
-
-    public void setHost(String host) {
-        this.host = host;
-    }
-
-    public String getUri() {
-        return uri;
-    }
-
-    public void setUri(String uri) {
-        this.uri = uri;
-    }
-
-    public Map<String, String> getHeaders() {
-        return headers;
-    }
-
-    public void setHeaders(Map<String, String> headers) {
-        this.headers = headers;
-    }
-
-
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/OofRequest.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/OofRequest.java
deleted file mode 100644
index f889624..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/OofRequest.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2018 Intel Corp.  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.so.client.oof.beans;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonInclude.Include;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.ObjectWriter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import java.io.Serializable;
-
-
-public class OofRequest implements Serializable {
-
-    private static final long serialVersionUID = -1541132882892163132L;
-    private static final Logger logger = LoggerFactory.getLogger(OofRequest.class);
-
-
-    @JsonProperty("requestInfo")
-    private RequestInfo requestInformation;
-
-    @JsonProperty("serviceInfo")
-    private ServiceInfo serviceInformation;
-
-    @JsonProperty("placementInfo")
-    private PlacementInfo placementInformation;
-
-    @JsonProperty("licenseInfo")
-    private LicenseInfo licenseInformation;
-
-
-    public RequestInfo getRequestInformation() {
-        return requestInformation;
-    }
-
-    public void setRequestInformation(RequestInfo requestInformation) {
-        this.requestInformation = requestInformation;
-    }
-
-    public ServiceInfo getServiceInformation() {
-        return serviceInformation;
-    }
-
-    public void setServiceInformation(ServiceInfo serviceInformation) {
-        this.serviceInformation = serviceInformation;
-    }
-
-    public PlacementInfo getPlacementInformation() {
-        return placementInformation;
-    }
-
-    public void setPlacementInformation(PlacementInfo placementInformation) {
-        this.placementInformation = placementInformation;
-    }
-
-    public LicenseInfo getLicenseInformation() {
-        return licenseInformation;
-    }
-
-    public void setLicenseInformation(LicenseInfo licenseInformation) {
-        this.licenseInformation = licenseInformation;
-    }
-
-
-    @JsonInclude(Include.NON_NULL)
-    public String toJsonString() {
-        String json = "";
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.setSerializationInclusion(Include.NON_NULL);
-        ObjectWriter ow = mapper.writer().withDefaultPrettyPrinter();
-        try {
-            json = ow.writeValueAsString(this);
-        } catch (Exception e) {
-            logger.error("Unable to convert oofRequest to string", e);
-        }
-        return json.replaceAll("\\\\", "");
-    }
-
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/OofRequestParameters.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/OofRequestParameters.java
deleted file mode 100644
index 6c9e45c..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/OofRequestParameters.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2018 Intel Corp.  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.so.client.oof.beans;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonRootName;
-import java.io.Serializable;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({"customerLatitude", "customerLongitude", "customerName"})
-@JsonRootName("requestParameters")
-public class OofRequestParameters implements Serializable {
-
-    private static final long serialVersionUID = -759180997599143791L;
-
-
-    @JsonProperty("customerLatitude")
-    private String customerLatitude;
-    @JsonProperty("customerLongitude")
-    private String customerLongitude;
-    @JsonProperty("customerName")
-    private String customerName;
-
-    @JsonProperty("customerLatitude")
-    public String getCustomerLatitude() {
-        return customerLatitude;
-    }
-
-    @JsonProperty("customerLatitude")
-    public void setCustomerLatitude(String customerLatitude) {
-        this.customerLatitude = customerLatitude;
-    }
-
-    @JsonProperty("customerLongitude")
-    public String getCustomerLongitude() {
-        return customerLongitude;
-    }
-
-    @JsonProperty("customerLongitude")
-    public void setCustomerLongitude(String customerLongitude) {
-        this.customerLongitude = customerLongitude;
-    }
-
-    @JsonProperty("customerName")
-    public String getCustomerName() {
-        return customerName;
-    }
-
-    @JsonProperty("customerName")
-    public void setCustomerName(String customerName) {
-        this.customerName = customerName;
-    }
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/PlacementDemand.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/PlacementDemand.java
deleted file mode 100644
index 631b370..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/PlacementDemand.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2018 Intel Corp.  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.so.client.oof.beans;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonRootName;
-import java.io.Serializable;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({"resourceModuleName", "serviceResourceId", "tenantId", "resourceModelInfo"})
-@JsonRootName("placementDemand")
-public class PlacementDemand implements Serializable {
-
-    private static final long serialVersionUID = -759180997599143791L;
-
-    @JsonProperty("resourceModuleName")
-    private String resourceModuleName;
-    @JsonProperty("serviceResourceId")
-    private String serviceResourceId;
-    @JsonProperty("tenantId")
-    private String tenantId;
-    @JsonProperty("resourceModelInfo")
-    private ResourceModelInfo resourceModelInfo;
-
-    @JsonProperty("resourceModuleName")
-    public String getResourceModuleName() {
-        return resourceModuleName;
-    }
-
-    @JsonProperty("resourceModuleName")
-    public void setResourceModuleName(String resourceModuleName) {
-        this.resourceModuleName = resourceModuleName;
-    }
-
-    @JsonProperty("serviceResourceId")
-    public String getServiceResourceId() {
-        return serviceResourceId;
-    }
-
-    @JsonProperty("serviceResourceId")
-    public void setServiceResourceId(String serviceResourceId) {
-        this.serviceResourceId = serviceResourceId;
-    }
-
-    @JsonProperty("tenantId")
-    public String getTenantId() {
-        return tenantId;
-    }
-
-    @JsonProperty("tenantId")
-    public void setTenantId(String tenantId) {
-        this.tenantId = tenantId;
-    }
-
-    @JsonProperty("resourceModelInfo")
-    public ResourceModelInfo getResourceModelInfo() {
-        return resourceModelInfo;
-    }
-
-    @JsonProperty("resourceModelInfo")
-    public void setResourceModelInfo(ResourceModelInfo resourceModelInfo) {
-        this.resourceModelInfo = resourceModelInfo;
-    }
-
-    public void setResourceModelInfo(ModelInfo modelInfo) {
-        ResourceModelInfo localResourceModelInfo = new ResourceModelInfo();
-        localResourceModelInfo.setModelVersionId(modelInfo.getModelVersionId());
-        localResourceModelInfo.setModelVersionId(modelInfo.getModelVersionId());
-        localResourceModelInfo.setModelVersion(modelInfo.getModelVersion());
-        localResourceModelInfo.setModelName(modelInfo.getModelName());
-        localResourceModelInfo.setModelType(modelInfo.getModelType());
-        localResourceModelInfo.setModelInvariantId(modelInfo.getModelInvariantId());
-        localResourceModelInfo.setModelCustomizationName(modelInfo.getModelCustomizationName());
-        this.resourceModelInfo = localResourceModelInfo;
-    }
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/PlacementInfo.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/PlacementInfo.java
deleted file mode 100644
index 7519e8c..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/PlacementInfo.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2018 Intel Corp.  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.so.client.oof.beans;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonRootName;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({"requestParameters", "subscriberInfo", "placementDemands"})
-@JsonRootName("placementInfo")
-public class PlacementInfo implements Serializable {
-
-    private static final long serialVersionUID = -759180997599143791L;
-
-    @JsonProperty("requestParameters")
-    private OofRequestParameters requestParameters;
-    @JsonProperty("subscriberInfo")
-    private SubscriberInfo subscriberInfo;
-    @JsonProperty("placementDemands")
-    private ArrayList<PlacementDemand> placementDemands = new ArrayList<>();
-
-    @JsonProperty("requestParameters")
-    public OofRequestParameters getRequestParameters() {
-        return requestParameters;
-    }
-
-    @JsonProperty("requestParameters")
-    public void setRequestParameters(OofRequestParameters requestParameters) {
-        this.requestParameters = requestParameters;
-    }
-
-    @JsonProperty("subscriberInfo")
-    public SubscriberInfo getSubscriberInfo() {
-        return subscriberInfo;
-    }
-
-    @JsonProperty("subscriberInfo")
-    public void setSubscriberInfo(SubscriberInfo subscriberInfo) {
-        this.subscriberInfo = subscriberInfo;
-    }
-
-    @JsonProperty("placementDemands")
-    public ArrayList<PlacementDemand> getPlacementDemands() {
-        return placementDemands;
-    }
-
-    @JsonProperty("placementDemands")
-    public void setPlacementDemands(ArrayList<PlacementDemand> placementDemands) {
-        this.placementDemands = placementDemands;
-    }
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/RequestInfo.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/RequestInfo.java
deleted file mode 100644
index 0132ed5..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/RequestInfo.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2018 Intel Corp.  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.so.client.oof.beans;
-
-import java.io.Serializable;
-import java.util.List;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonRootName;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({"transactionId", "requestId", "callbackUrl", "sourceId", "requestType", "numSolutions",
-        "optimizers", "timeout"})
-@JsonRootName("requestInfo")
-public class RequestInfo implements Serializable {
-
-    private static final long serialVersionUID = -759180997599143791L;
-
-    @JsonProperty("transactionId")
-    private String transactionId;
-    @JsonProperty("requestId")
-    private String requestId;
-    @JsonProperty("callbackUrl")
-    private String callbackUrl;
-    @JsonProperty("sourceId")
-    private String sourceId;
-    @JsonProperty("requestType")
-    private String requestType;
-    @JsonProperty("numSolutions")
-    private Integer numSolutions;
-    @JsonProperty("optimizers")
-    private List<String> optimizers = null;
-    @JsonProperty("timeout")
-    private Long timeout;
-
-    @JsonProperty("transactionId")
-    public String getTransactionId() {
-        return transactionId;
-    }
-
-    @JsonProperty("transactionId")
-    public void setTransactionId(String transactionId) {
-        this.transactionId = transactionId;
-    }
-
-    @JsonProperty("requestId")
-    public String getRequestId() {
-        return requestId;
-    }
-
-    @JsonProperty("requestId")
-    public void setRequestId(String requestId) {
-        this.requestId = requestId;
-    }
-
-    @JsonProperty("callbackUrl")
-    public String getCallbackUrl() {
-        return callbackUrl;
-    }
-
-    @JsonProperty("callbackUrl")
-    public void setCallbackUrl(String callbackUrl) {
-        this.callbackUrl = callbackUrl;
-    }
-
-    @JsonProperty("sourceId")
-    public String getSourceId() {
-        return sourceId;
-    }
-
-    @JsonProperty("sourceId")
-    public void setSourceId(String sourceId) {
-        this.sourceId = sourceId;
-    }
-
-    @JsonProperty("requestType")
-    public String getRequestType() {
-        return requestType;
-    }
-
-    @JsonProperty("requestType")
-    public void setRequestType(String requestType) {
-        this.requestType = requestType;
-    }
-
-    @JsonProperty("numSolutions")
-    public Integer getNumSolutions() {
-        return numSolutions;
-    }
-
-    @JsonProperty("numSolutions")
-    public void setNumSolutions(Integer numSolutions) {
-        this.numSolutions = numSolutions;
-    }
-
-    @JsonProperty("optimizers")
-    public List<String> getOptimizers() {
-        return optimizers;
-    }
-
-    @JsonProperty("optimizers")
-    public void setOptimizers(List<String> optimizers) {
-        this.optimizers = optimizers;
-    }
-
-    @JsonProperty("timeout")
-    public Long getTimeout() {
-        return timeout;
-    }
-
-    @JsonProperty("timeout")
-    public void setTimeout(Long timeout) {
-        this.timeout = timeout;
-    }
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/Resource.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/Resource.java
deleted file mode 100644
index 8d44c63..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/Resource.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2018 Intel Corp.  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.so.client.oof.beans;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.io.Serializable;
-
-public class Resource implements Serializable {
-
-    private static final long serialVersionUID = 5949861520571440421L;
-
-    @JsonProperty("service-resource-id")
-    private String serviceResourceId;
-    @JsonProperty("status")
-    private String status;
-
-
-    public String getServiceResourceId() {
-        return serviceResourceId;
-    }
-
-    public void setServiceResourceId(String serviceResourceId) {
-        this.serviceResourceId = serviceResourceId;
-    }
-
-    public String getStatus() {
-        return status;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
-
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/ResourceModelInfo.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/ResourceModelInfo.java
deleted file mode 100644
index 9d03525..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/ResourceModelInfo.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2018 Intel Corp.  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.so.client.oof.beans;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonRootName;
-import java.io.Serializable;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonRootName("resourceModelInfo")
-public class ResourceModelInfo extends ModelInfo implements Serializable {
-
-    private static final long serialVersionUID = -759180997599143791L;
-
-    @JsonProperty("modelInvariantId")
-    private String modelInvariantId;
-    @JsonProperty("modelVersionId")
-    private String modelVersionId;
-    @JsonProperty("modelName")
-    private String modelName;
-    @JsonProperty("modelType")
-    private String modelType;
-    @JsonProperty("modelVersion")
-    private String modelVersion;
-    @JsonProperty("modelCustomizationName")
-    private String modelCustomizationName;
-
-    @JsonProperty("modelInvariantId")
-    public String getModelInvariantId() {
-        return modelInvariantId;
-    }
-
-    @JsonProperty("modelInvariantId")
-    public void setModelInvariantId(String modelInvariantId) {
-        this.modelInvariantId = modelInvariantId;
-    }
-
-    @JsonProperty("modelVersionId")
-    public String getModelVersionId() {
-        return modelVersionId;
-    }
-
-    @JsonProperty("modelVersionId")
-    public void setModelVersionId(String modelVersionId) {
-        this.modelVersionId = modelVersionId;
-    }
-
-    @JsonProperty("modelName")
-    public String getModelName() {
-        return modelName;
-    }
-
-    @JsonProperty("modelName")
-    public void setModelName(String modelName) {
-        this.modelName = modelName;
-    }
-
-    @JsonProperty("modelType")
-    public String getModelType() {
-        return modelType;
-    }
-
-    @JsonProperty("modelType")
-    public void setModelType(String modelType) {
-        this.modelType = modelType;
-    }
-
-    @JsonProperty("modelVersion")
-    public String getModelVersion() {
-        return modelVersion;
-    }
-
-    @JsonProperty("modelVersion")
-    public void setModelVersion(String modelVersion) {
-        this.modelVersion = modelVersion;
-    }
-
-    @JsonProperty("modelCustomizationName")
-    public String getModelCustomizationName() {
-        return modelCustomizationName;
-    }
-
-    @JsonProperty("modelCustomizationName")
-    public void setModelCustomizationName(String modelCustomizationName) {
-        this.modelCustomizationName = modelCustomizationName;
-    }
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/ServiceInfo.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/ServiceInfo.java
deleted file mode 100644
index db0e2ac..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/ServiceInfo.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2018 Intel Corp.  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.so.client.oof.beans;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonRootName;
-import java.io.Serializable;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({"serviceInstanceId", "serviceName", "modelInfo"})
-@JsonRootName("serviceInfo")
-public class ServiceInfo implements Serializable {
-
-    private static final long serialVersionUID = -759180997599143791L;
-
-    @JsonProperty("serviceInstanceId")
-    private String serviceInstanceId;
-    @JsonProperty("serviceName")
-    private String serviceName;
-    @JsonProperty("modelInfo")
-    private ModelInfo modelInfo;
-
-    @JsonProperty("serviceInstanceId")
-    public String getServiceInstanceId() {
-        return serviceInstanceId;
-    }
-
-    @JsonProperty("serviceInstanceId")
-    public void setServiceInstanceId(String serviceInstanceId) {
-        this.serviceInstanceId = serviceInstanceId;
-    }
-
-    @JsonProperty("serviceName")
-    public String getServiceName() {
-        return serviceName;
-    }
-
-    @JsonProperty("serviceName")
-    public void setServiceName(String serviceName) {
-        this.serviceName = serviceName;
-    }
-
-    @JsonProperty("modelInfo")
-    public ModelInfo getModelInfo() {
-        return modelInfo;
-    }
-
-    @JsonProperty("modelInfo")
-    public void setModelInfo(ModelInfo modelInfo) {
-        this.modelInfo = modelInfo;
-    }
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/SubscriberInfo.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/SubscriberInfo.java
deleted file mode 100644
index 8fef4c4..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/oof/beans/SubscriberInfo.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2018 Intel Corp.  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.so.client.oof.beans;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonRootName;
-import java.io.Serializable;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({"globalSubscriberId", "subscriberName", "subscriberCommonSiteId"})
-@JsonRootName("subscriberInfo")
-public class SubscriberInfo implements Serializable {
-
-    private static final long serialVersionUID = -759180997599143791L;
-
-    @JsonProperty("globalSubscriberId")
-    private String globalSubscriberId;
-    @JsonProperty("subscriberName")
-    private String subscriberName;
-    @JsonProperty("subscriberCommonSiteId")
-    private String subscriberCommonSiteId;
-
-    @JsonProperty("globalSubscriberId")
-    public String getGlobalSubscriberId() {
-        return globalSubscriberId;
-    }
-
-    @JsonProperty("globalSubscriberId")
-    public void setGlobalSubscriberId(String globalSubscriberId) {
-        this.globalSubscriberId = globalSubscriberId;
-    }
-
-    @JsonProperty("subscriberName")
-    public String getSubscriberName() {
-        return subscriberName;
-    }
-
-    @JsonProperty("subscriberName")
-    public void setSubscriberName(String subscriberName) {
-        this.subscriberName = subscriberName;
-    }
-
-    @JsonProperty("subscriberCommonSiteId")
-    public String getSubscriberCommonSiteId() {
-        return subscriberCommonSiteId;
-    }
-
-    @JsonProperty("subscriberCommonSiteId")
-    public void setSubscriberCommonSiteId(String subscriberCommonSiteId) {
-        this.subscriberCommonSiteId = subscriberCommonSiteId;
-    }
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java
deleted file mode 100644
index c63cbc0..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroClient.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Modifications Copyright (c) 2019 Samsung
- * ================================================================================
- * 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.so.client.sniro;
-
-import java.util.LinkedHashMap;
-import org.camunda.bpm.engine.delegate.BpmnError;
-import org.onap.so.bpmn.core.UrnPropertiesReader;
-import org.onap.so.client.BaseClient;
-import org.onap.so.client.exception.BadResponseException;
-import org.onap.so.client.sniro.beans.ManagerProperties;
-import org.onap.so.client.sniro.beans.SniroConductorRequest;
-import org.onap.so.client.sniro.beans.SniroManagerRequest;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.ParameterizedTypeReference;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.MediaType;
-import org.springframework.stereotype.Component;
-
-
-@Component
-public class SniroClient {
-
-    private static final Logger logger = LoggerFactory.getLogger(SniroClient.class);
-
-    @Autowired
-    private ManagerProperties managerProperties;
-
-    @Autowired
-    private SniroValidator validator;
-
-
-    /**
-     * Makes a rest call to sniro manager to perform homing and licensing for a list of demands
-     *
-     * @param homingRequest
-     * @return
-     * @throws BadResponseException
-     * @throws BpmnError
-     */
-    public void postDemands(SniroManagerRequest homingRequest) throws BadResponseException {
-        logger.trace("Started Sniro Client Post Demands");
-        String url = managerProperties.getHost() + managerProperties.getUri().get("v2");
-        logger.debug("Post demands url: {}", url);
-        logger.debug("Post demands payload: {}", homingRequest.toJsonString());
-
-        HttpHeaders header = new HttpHeaders();
-        header.setContentType(MediaType.APPLICATION_JSON);
-        header.set("Authorization", managerProperties.getHeaders().get("auth"));
-        header.set("X-patchVersion", managerProperties.getHeaders().get("patchVersion"));
-        header.set("X-minorVersion", managerProperties.getHeaders().get("minorVersion"));
-        header.set("X-latestVersion", managerProperties.getHeaders().get("latestVersion"));
-        BaseClient<String, LinkedHashMap<String, Object>> baseClient = new BaseClient<>();
-
-        baseClient.setTargetUrl(url);
-        baseClient.setHttpHeader(header);
-
-        LinkedHashMap<String, Object> response = baseClient.post(homingRequest.toJsonString(),
-                new ParameterizedTypeReference<LinkedHashMap<String, Object>>() {});
-        validator.validateDemandsResponse(response);
-        logger.trace("Completed Sniro Client Post Demands");
-    }
-
-    /**
-     * Makes a rest call to sniro conductor to notify them of successful or unsuccessful vnf creation for previously
-     * homed resources
-     *
-     * TODO Temporarily being used in groovy therefore can not utilize autowire. Once java "release" subflow is
-     * developed it will be refactored to use autowire.
-     *
-     * @param releaseRequest
-     * @return
-     * @throws BadResponseException
-     */
-    public void postRelease(SniroConductorRequest releaseRequest) throws BadResponseException {
-        logger.trace("Started Sniro Client Post Release");
-        String url = UrnPropertiesReader.getVariable("sniro.conductor.host")
-                + UrnPropertiesReader.getVariable("sniro.conductor.uri");
-        logger.debug("Post release url: {}", url);
-        logger.debug("Post release payload: {}", releaseRequest.toJsonString());
-
-        HttpHeaders header = new HttpHeaders();
-        header.setContentType(MediaType.APPLICATION_JSON);
-        header.set("Authorization", UrnPropertiesReader.getVariable("sniro.conductor.headers.auth"));
-        BaseClient<String, LinkedHashMap<String, Object>> baseClient = new BaseClient<>();
-
-        baseClient.setTargetUrl(url);
-        baseClient.setHttpHeader(header);
-
-        LinkedHashMap<String, Object> response = baseClient.post(releaseRequest.toJsonString(),
-                new ParameterizedTypeReference<LinkedHashMap<String, Object>>() {});
-        SniroValidator v = new SniroValidator();
-        v.validateReleaseResponse(response);
-        logger.trace("Completed Sniro Client Post Release");
-    }
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroValidator.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroValidator.java
deleted file mode 100644
index eb73001..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/SniroValidator.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Modifications Copyright (c) 2019 Samsung
- * ================================================================================
- * 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.so.client.sniro;
-
-
-import static org.apache.commons.lang.StringUtils.*;
-import java.util.LinkedHashMap;
-import org.json.JSONObject;
-import org.onap.so.client.exception.BadResponseException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-
-
-@Component
-public class SniroValidator {
-
-    private static final Logger logger = LoggerFactory.getLogger(SniroValidator.class);
-
-    /**
-     * Validates the synchronous homing response from sniro manager
-     *
-     * @throws BadResponseException
-     */
-    public void validateDemandsResponse(LinkedHashMap<String, Object> response) throws BadResponseException {
-        logger.debug("Validating Sniro Managers synchronous response");
-        if (!response.isEmpty()) {
-            JSONObject jsonResponse = new JSONObject(response);
-            if (jsonResponse.has("requestStatus")) {
-                String status = jsonResponse.getString("requestStatus");
-                if ("accepted".equals(status)) {
-                    logger.debug("Sniro Managers synchronous response indicates accepted");
-                } else {
-                    String message = jsonResponse.getString("statusMessage");
-                    if (isNotBlank(message)) {
-                        logger.debug("Sniro Managers response indicates failed: " + message);
-                    } else {
-                        logger.debug("Sniro Managers response indicates failed: no status message provided");
-                        message = "error message not provided";
-                    }
-                    throw new BadResponseException("Sniro Managers synchronous response indicates failed: " + message);
-                }
-            } else {
-                logger.debug("Sniro Managers synchronous response does not contain: request status");
-                throw new BadResponseException("Sniro Managers synchronous response does not contain: request status");
-            }
-        } else {
-            logger.debug("Sniro Managers synchronous response is empty");
-            throw new BadResponseException("Sniro Managers synchronous response i is empty");
-        }
-    }
-
-    /**
-     * Validates the asynchronous/callback response from sniro manager which contains the homing and licensing solutions
-     *
-     * @throws BadResponseException
-     */
-    public static void validateSolution(String response) throws BadResponseException {
-        logger.debug("Validating Sniro Managers asynchronous callback response");
-        if (isNotBlank(response)) {
-            JSONObject jsonResponse = new JSONObject(response);
-            if (!jsonResponse.has("serviceException")) {
-                logger.debug("Sniro Managers asynchronous response is valid");
-            } else {
-                String message = jsonResponse.getJSONObject("serviceException").getString("text");
-                if (isNotBlank(message)) {
-                    logger.debug("Sniro Managers response contains a service exception: " + message);
-                } else {
-                    logger.debug(
-                            "Sniro Managers response contains a service exception: no service exception text provided");
-                    message = "error message not provided";
-                }
-                throw new BadResponseException(
-                        "Sniro Managers asynchronous response contains a service exception: " + message);
-            }
-        } else {
-            logger.debug("Sniro Managers asynchronous response is empty");
-            throw new BadResponseException("Sniro Managers asynchronous response is empty");
-        }
-    }
-
-
-    /**
-     * Validates the release response from sniro conductor
-     *
-     * @throws BadResponseException
-     */
-    public void validateReleaseResponse(LinkedHashMap<String, Object> response) throws BadResponseException {
-        logger.debug("Validating Sniro Conductors response");
-        if (!response.isEmpty()) {
-            String status = (String) response.get("status");
-            if (isNotBlank(status)) {
-                if ("success".equals(status)) {
-                    logger.debug("Sniro Conductors synchronous response indicates success");
-                } else {
-                    String message = (String) response.get("message");
-                    if (isNotBlank(message)) {
-                        logger.debug("Sniro Conductors response indicates failed: " + message);
-                    } else {
-                        logger.debug("Sniro Conductors response indicates failed: error message not provided");
-                        message = "error message not provided";
-                    }
-                    throw new BadResponseException(
-                            "Sniro Conductors synchronous response indicates failed: " + message);
-                }
-            } else {
-                logger.debug("Sniro Managers Conductors response does not contain: status");
-                throw new BadResponseException("Sniro Conductors synchronous response does not contain: status");
-            }
-        } else {
-            logger.debug("Sniro Conductors response is empty");
-            throw new BadResponseException("Sniro Conductors response is empty");
-        }
-
-    }
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/Candidate.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/Candidate.java
deleted file mode 100644
index 3127275..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/Candidate.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2019 AT&T Intellectual Property. 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.so.client.sniro.beans;
-
-import java.io.Serializable;
-import java.util.List;
-import org.onap.so.bpmn.servicedecomposition.homingobjects.CandidateType;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public class Candidate implements Serializable {
-
-    private static final long serialVersionUID = -5474502255533410907L;
-
-    @JsonProperty("identifierType")
-    private CandidateType identifierType;
-    @JsonProperty("identifiers")
-    private List<String> identifiers;
-    @JsonProperty("cloudOwner")
-    private String cloudOwner;
-
-    public Candidate() {}
-
-    public Candidate(CandidateType identifierType, List<String> identifiers, String cloudOwner) {
-        this.identifierType = identifierType;
-        this.identifiers = identifiers;
-        this.cloudOwner = cloudOwner;
-    }
-
-    public CandidateType getIdentifierType() {
-        return identifierType;
-    }
-
-    public void setIdentifierType(CandidateType identifierType) {
-        this.identifierType = identifierType;
-    }
-
-    public List<String> getIdentifiers() {
-        return identifiers;
-    }
-
-    public void setIdentifiers(List<String> identifiers) {
-        this.identifiers = identifiers;
-    }
-
-    public String getCloudOwner() {
-        return cloudOwner;
-    }
-
-    public void setCloudOwner(String cloudOwner) {
-        this.cloudOwner = cloudOwner;
-    }
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/ConductorProperties.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/ConductorProperties.java
deleted file mode 100644
index 9ac8727..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/ConductorProperties.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2018 AT&T Intellectual Property. 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.so.client.sniro.beans;
-
-import java.util.Map;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.context.annotation.Configuration;
-
-@Configuration
-@ConfigurationProperties(prefix = "sniro.conductor")
-public class ConductorProperties {
-
-    private String host;
-    private String uri;
-
-    private Map<String, String> headers;
-
-
-    public String getHost() {
-        return host;
-    }
-
-    public void setHost(String host) {
-        this.host = host;
-    }
-
-    public String getUri() {
-        return uri;
-    }
-
-    public void setUri(String uri) {
-        this.uri = uri;
-    }
-
-    public Map<String, String> getHeaders() {
-        return headers;
-    }
-
-    public void setHeaders(Map<String, String> headers) {
-        this.headers = headers;
-    }
-
-
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/Demand.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/Demand.java
deleted file mode 100644
index 0cc9935..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/Demand.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2019 AT&T Intellectual Property. 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.so.client.sniro.beans;
-
-import java.io.Serializable;
-import java.util.List;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public class Demand implements Serializable {
-
-    private static final long serialVersionUID = 5676094538091859816L;
-
-    @JsonProperty("serviceResourceId")
-    private String serviceResourceId;
-    @JsonProperty("resourceModuleName")
-    private String resourceModuleName;
-    @JsonProperty("resourceModelInfo")
-    private ModelInfo modelInfo;
-    @JsonProperty("requiredCandidates")
-    private List<Candidate> requiredCandidates;
-    @JsonProperty("excludedCandidates")
-    private List<Candidate> excludedCandidates;
-    @JsonProperty("existingCandidates")
-    private List<Candidate> existingCandidates;
-    @JsonProperty("filteringAttributes")
-    private List<Candidate> filteringAttributes;
-
-
-    public List<Candidate> getRequiredCandidates() {
-        return requiredCandidates;
-    }
-
-    public void setRequiredCandidates(List<Candidate> requiredCandidates) {
-        this.requiredCandidates = requiredCandidates;
-    }
-
-    public List<Candidate> getExcludedCandidates() {
-        return excludedCandidates;
-    }
-
-    public void setExcludedCandidates(List<Candidate> excludedCandidates) {
-        this.excludedCandidates = excludedCandidates;
-    }
-
-    public String getServiceResourceId() {
-        return serviceResourceId;
-    }
-
-    public void setServiceResourceId(String serviceResourceId) {
-        this.serviceResourceId = serviceResourceId;
-    }
-
-    public String getResourceModuleName() {
-        return resourceModuleName;
-    }
-
-    public void setResourceModuleName(String resourceModuleName) {
-        this.resourceModuleName = resourceModuleName;
-    }
-
-    public ModelInfo getModelInfo() {
-        return modelInfo;
-    }
-
-    public void setModelInfo(ModelInfo modelInfo) {
-        this.modelInfo = modelInfo;
-    }
-
-    public List<Candidate> getExistingCandidates() {
-        return existingCandidates;
-    }
-
-    public void setExistingCandidates(List<Candidate> existingCandidates) {
-        this.existingCandidates = existingCandidates;
-    }
-
-    public List<Candidate> getFilteringAttributes() {
-        return filteringAttributes;
-    }
-
-    public void setFilteringAttributes(List<Candidate> filteringAttributes) {
-        this.filteringAttributes = filteringAttributes;
-    }
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/LicenseInfo.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/LicenseInfo.java
deleted file mode 100644
index 9ab3ae6..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/LicenseInfo.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2019 AT&T Intellectual Property. 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.so.client.sniro.beans;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public class LicenseInfo implements Serializable {
-
-    private static final long serialVersionUID = 6878164369491185856L;
-
-    @JsonProperty("licenseDemands")
-    private List<Demand> demands = new ArrayList<>();
-
-
-    public List<Demand> getDemands() {
-        return demands;
-    }
-
-    public void setDemands(List<Demand> demands) {
-        this.demands = demands;
-    }
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/ManagerProperties.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/ManagerProperties.java
deleted file mode 100644
index 70b1a37..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/ManagerProperties.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2018 AT&T Intellectual Property. 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.so.client.sniro.beans;
-
-import java.util.Map;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.context.annotation.Configuration;
-
-@Configuration
-@ConfigurationProperties(prefix = "sniro.manager")
-public class ManagerProperties {
-
-    private String host;
-    private Map<String, String> uri;
-    private Map<String, String> headers;
-
-
-    public String getHost() {
-        return host;
-    }
-
-    public void setHost(String host) {
-        this.host = host;
-    }
-
-    public Map<String, String> getUri() {
-        return uri;
-    }
-
-    public void setUri(Map<String, String> uri) {
-        this.uri = uri;
-    }
-
-    public Map<String, String> getHeaders() {
-        return headers;
-    }
-
-    public void setHeaders(Map<String, String> headers) {
-        this.headers = headers;
-    }
-
-
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/ModelInfo.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/ModelInfo.java
deleted file mode 100644
index 6c1932e..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/ModelInfo.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2019 AT&T Intellectual Property. 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.so.client.sniro.beans;
-
-import java.io.Serializable;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonRootName;
-
-@JsonPropertyOrder({"modelName", "modelVersionId", "modelVersion", "modelInvariantId"})
-@JsonRootName("modelInfo")
-public class ModelInfo implements Serializable {
-
-    private static final long serialVersionUID = 1488642558601651075L;
-
-    @JsonProperty("modelInvariantId")
-    private String modelInvariantId;
-    @JsonProperty("modelVersionId")
-    private String modelVersionId;
-    @JsonProperty("modelName")
-    private String modelName;
-    @JsonProperty("modelVersion")
-    private String modelVersion;
-
-
-    public String getModelInvariantId() {
-        return modelInvariantId;
-    }
-
-    public void setModelInvariantId(String modelInvariantId) {
-        this.modelInvariantId = modelInvariantId;
-    }
-
-    public String getModelVersionId() {
-        return modelVersionId;
-    }
-
-    public void setModelVersionId(String modelVersionId) {
-        this.modelVersionId = modelVersionId;
-    }
-
-    public String getModelName() {
-        return modelName;
-    }
-
-    public void setModelName(String modelName) {
-        this.modelName = modelName;
-    }
-
-    public String getModelVersion() {
-        return modelVersion;
-    }
-
-    public void setModelVersion(String modelVersion) {
-        this.modelVersion = modelVersion;
-    }
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/PlacementInfo.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/PlacementInfo.java
deleted file mode 100644
index bbbbf9c..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/PlacementInfo.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2019 AT&T Intellectual Property. 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.so.client.sniro.beans;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonRawValue;
-import com.fasterxml.jackson.annotation.JsonRootName;
-
-@JsonPropertyOrder({"subscriberInfo", "placementDemands", "requestParameters"})
-@JsonRootName("placementInfo")
-public class PlacementInfo implements Serializable {
-
-    private static final long serialVersionUID = -964488472247386556L;
-
-    @JsonProperty("subscriberInfo")
-    private SubscriberInfo subscriberInfo;
-    @JsonProperty("placementDemands")
-    private List<Demand> demands = new ArrayList<>();
-    @JsonRawValue
-    @JsonProperty("requestParameters")
-    private String requestParameters;
-
-
-    public SubscriberInfo getSubscriberInfo() {
-        return subscriberInfo;
-    }
-
-    public void setSubscriberInfo(SubscriberInfo subscriberInfo) {
-        this.subscriberInfo = subscriberInfo;
-    }
-
-    public List<Demand> getDemands() {
-        return demands;
-    }
-
-    public void setDemands(List<Demand> demands) {
-        this.demands = demands;
-    }
-
-    public String getRequestParameters() {
-        return requestParameters;
-    }
-
-    public void setRequestParameters(String requestParameters) {
-        this.requestParameters = requestParameters;
-    }
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/RequestInfo.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/RequestInfo.java
deleted file mode 100644
index fc6aec7..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/RequestInfo.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2018 AT&T Intellectual Property. 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.so.client.sniro.beans;
-
-import java.io.Serializable;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonRootName;
-
-
-@JsonRootName("requestInfo")
-public class RequestInfo implements Serializable {
-
-    private static final long serialVersionUID = -759180997599143791L;
-
-    @JsonProperty("transactionId")
-    String transactionId;
-    @JsonProperty("requestId")
-    String requestId;
-    @JsonProperty("callbackUrl")
-    String callbackUrl;
-    @JsonProperty("sourceId")
-    String sourceId = "mso";
-    @JsonProperty("requestType")
-    String requestType;
-    @JsonProperty("timeout")
-    long timeout;
-
-    public String getTransactionId() {
-        return transactionId;
-    }
-
-    public void setTransactionId(String transactionId) {
-        this.transactionId = transactionId;
-    }
-
-    public String getRequestId() {
-        return requestId;
-    }
-
-    public void setRequestId(String requestId) {
-        this.requestId = requestId;
-    }
-
-    public String getCallbackUrl() {
-        return callbackUrl;
-    }
-
-    public void setCallbackUrl(String callbackUrl) {
-        this.callbackUrl = callbackUrl;
-    }
-
-    public String getSourceId() {
-        return sourceId;
-    }
-
-    public void setSourceId(String sourceId) {
-        this.sourceId = sourceId;
-    }
-
-    public String getRequestType() {
-        return requestType;
-    }
-
-    public void setRequestType(String requestType) {
-        this.requestType = requestType;
-    }
-
-    public long getTimeout() {
-        return timeout;
-    }
-
-    public void setTimeout(long timeout) {
-        this.timeout = timeout;
-    }
-
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/Resource.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/Resource.java
deleted file mode 100644
index b5d40a8..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/Resource.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2018 AT&T Intellectual Property. 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.so.client.sniro.beans;
-
-import java.io.Serializable;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-public class Resource implements Serializable {
-
-    private static final long serialVersionUID = 5949861520571440421L;
-
-    @JsonProperty("service-resource-id")
-    private String serviceResourceId;
-    @JsonProperty("status")
-    private String status;
-
-
-    public String getServiceResourceId() {
-        return serviceResourceId;
-    }
-
-    public void setServiceResourceId(String serviceResourceId) {
-        this.serviceResourceId = serviceResourceId;
-    }
-
-    public String getStatus() {
-        return status;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
-
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/ServiceInfo.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/ServiceInfo.java
deleted file mode 100644
index 8b6f234..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/ServiceInfo.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2019 AT&T Intellectual Property. 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.so.client.sniro.beans;
-
-import java.io.Serializable;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import com.fasterxml.jackson.annotation.JsonRootName;
-
-@JsonPropertyOrder({"modelInfo", "serviceRole", "serviceInstanceId", "serviceName"})
-@JsonRootName("serviceInfo")
-public class ServiceInfo implements Serializable {
-
-    private static final long serialVersionUID = -6866022419398548585L;
-
-    @JsonProperty("serviceInstanceId")
-    private String serviceInstanceId;
-    @JsonProperty("serviceName")
-    private String serviceName;
-    @JsonProperty("serviceRole")
-    private String serviceRole;
-    @JsonProperty("modelInfo")
-    private ModelInfo modelInfo;
-
-
-    public String getServiceInstanceId() {
-        return serviceInstanceId;
-    }
-
-    public void setServiceInstanceId(String serviceInstanceId) {
-        this.serviceInstanceId = serviceInstanceId;
-    }
-
-    public String getServiceName() {
-        return serviceName;
-    }
-
-    public void setServiceName(String serviceName) {
-        this.serviceName = serviceName;
-    }
-
-    public String getServiceRole() {
-        return serviceRole;
-    }
-
-    public void setServiceRole(String serviceRole) {
-        this.serviceRole = serviceRole;
-    }
-
-    public ModelInfo getModelInfo() {
-        return modelInfo;
-    }
-
-    public void setModelInfo(ModelInfo modelInfo) {
-        this.modelInfo = modelInfo;
-    }
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SniroConductorRequest.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SniroConductorRequest.java
deleted file mode 100644
index b8896a2..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SniroConductorRequest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Modifications Copyright (c) 2019 Samsung
- * ================================================================================
- * 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.so.client.sniro.beans;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonInclude.Include;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.ObjectWriter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-public class SniroConductorRequest implements Serializable {
-
-    private static final long serialVersionUID = 1906052095861777655L;
-    private static final Logger logger = LoggerFactory.getLogger(SniroConductorRequest.class);
-
-    @JsonProperty("release-locks")
-    private List<Resource> resources = new ArrayList<>();
-
-
-    public List<Resource> getResources() {
-        return resources;
-    }
-
-    @JsonInclude(Include.NON_NULL)
-    public String toJsonString() {
-        String json = "";
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.setSerializationInclusion(Include.NON_NULL);
-        ObjectWriter ow = mapper.writer().withDefaultPrettyPrinter();
-        try {
-            json = ow.writeValueAsString(this);
-        } catch (Exception e) {
-            logger.error("Unable to convert SniroConductorRequest to string", e);
-        }
-        return json;
-    }
-
-
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SniroManagerRequest.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SniroManagerRequest.java
deleted file mode 100644
index 4babbe5..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SniroManagerRequest.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Modifications Copyright (c) 2019 Samsung
- * ================================================================================
- * 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.so.client.sniro.beans;
-
-import java.io.Serializable;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonInclude.Include;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.ObjectWriter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-public class SniroManagerRequest implements Serializable {
-
-    private static final long serialVersionUID = -1541132882892163132L;
-    private static final Logger logger = LoggerFactory.getLogger(SniroManagerRequest.class);
-
-    @JsonProperty("requestInfo")
-    private RequestInfo requestInformation;
-    @JsonProperty("serviceInfo")
-    private ServiceInfo serviceInformation;
-    @JsonProperty("placementInfo")
-    private PlacementInfo placementInformation;
-    @JsonProperty("licenseInfo")
-    private LicenseInfo licenseInformation;
-
-
-    public RequestInfo getRequestInformation() {
-        return requestInformation;
-    }
-
-    public void setRequestInformation(RequestInfo requestInformation) {
-        this.requestInformation = requestInformation;
-    }
-
-    public ServiceInfo getServiceInformation() {
-        return serviceInformation;
-    }
-
-    public void setServiceInformation(ServiceInfo serviceInformation) {
-        this.serviceInformation = serviceInformation;
-    }
-
-    public PlacementInfo getPlacementInformation() {
-        return placementInformation;
-    }
-
-    public void setPlacementInformation(PlacementInfo placementInformation) {
-        this.placementInformation = placementInformation;
-    }
-
-    public LicenseInfo getLicenseInformation() {
-        return licenseInformation;
-    }
-
-    public void setLicenseInformation(LicenseInfo licenseInformation) {
-        this.licenseInformation = licenseInformation;
-    }
-
-
-    @JsonInclude(Include.NON_NULL)
-    public String toJsonString() {
-        String json = "";
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.setSerializationInclusion(Include.NON_NULL);
-        ObjectWriter ow = mapper.writer().withDefaultPrettyPrinter();
-        try {
-            json = ow.writeValueAsString(this);
-        } catch (Exception e) {
-            logger.error("Unable to convert SniroManagerRequest to string", e);
-        }
-        return json.replaceAll("\\\\", "");
-    }
-
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SubscriberInfo.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SubscriberInfo.java
deleted file mode 100644
index 35a4cac..0000000
--- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/sniro/beans/SubscriberInfo.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2019 AT&T Intellectual Property. 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.so.client.sniro.beans;
-
-import java.io.Serializable;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonRootName;
-
-@JsonRootName("subscriberInfo")
-public class SubscriberInfo implements Serializable {
-
-    private static final long serialVersionUID = -6350949051379748872L;
-
-    @JsonProperty("globalSubscriberId")
-    private String globalSubscriberId;
-    @JsonProperty("subscriberName")
-    private String subscriberName;
-    @JsonProperty("subscriberCommonSiteId")
-    private String subscriberCommonSiteId;
-
-
-    public String getGlobalSubscriberId() {
-        return globalSubscriberId;
-    }
-
-    public void setGlobalSubscriberId(String globalSubscriberId) {
-        this.globalSubscriberId = globalSubscriberId;
-    }
-
-    public String getSubscriberName() {
-        return subscriberName;
-    }
-
-    public void setSubscriberName(String subscriberName) {
-        this.subscriberName = subscriberName;
-    }
-
-    public String getSubscriberCommonSiteId() {
-        return subscriberCommonSiteId;
-    }
-
-    public void setSubscriberCommonSiteId(String subscriberCommonSiteId) {
-        this.subscriberCommonSiteId = subscriberCommonSiteId;
-    }
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/oof/OofClientTestIT.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/oof/OofClientTestIT.java
deleted file mode 100644
index 3ae0db6..0000000
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/oof/OofClientTestIT.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2018 Intel Corp. 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.so.client.oof;
-
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.post;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
-import static org.junit.Assert.assertEquals;
-import org.junit.Test;
-import org.onap.so.BaseIntegrationTest;
-import org.onap.so.client.exception.BadResponseException;
-import org.onap.so.client.oof.beans.LicenseInfo;
-import org.onap.so.client.oof.beans.ModelInfo;
-import org.onap.so.client.oof.beans.OofRequest;
-import org.onap.so.client.oof.beans.OofRequestParameters;
-import org.onap.so.client.oof.beans.PlacementDemand;
-import org.onap.so.client.oof.beans.PlacementInfo;
-import org.onap.so.client.oof.beans.RequestInfo;
-import org.onap.so.client.oof.beans.ResourceModelInfo;
-import org.onap.so.client.oof.beans.ServiceInfo;
-import org.onap.so.client.oof.beans.SubscriberInfo;
-import org.skyscreamer.jsonassert.JSONAssert;
-import org.springframework.beans.factory.annotation.Autowired;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import java.util.ArrayList;
-import java.util.List;
-
-
-public class OofClientTestIT extends BaseIntegrationTest {
-
-    @Autowired
-    private OofClient client;
-
-    @Test
-    public void testPostDemands_success() throws BadResponseException, JsonProcessingException {
-        String mockResponse =
-                "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"status\", \"requestStatus\": \"accepted\"}";
-
-        ModelInfo modelInfo = new ModelInfo();
-        modelInfo.setModelCustomizationName("modelCustomizationName-Service");
-        modelInfo.setModelInvariantId("modelInvariantId-Service");
-        modelInfo.setModelName("modelName-Service");
-        modelInfo.setModelType("modelType-Service");
-        modelInfo.setModelVersion("modelVersion-Service");
-        modelInfo.setModelVersionId("modelVersionId-Service");
-
-        ServiceInfo serviceInfo = new ServiceInfo();
-        serviceInfo.setModelInfo(modelInfo);
-        serviceInfo.setServiceInstanceId("serviceInstanceId");
-        serviceInfo.setServiceName("serviceName");
-
-        SubscriberInfo subscriberInfo = new SubscriberInfo();
-        subscriberInfo.setGlobalSubscriberId("globalSubscriberId");
-        subscriberInfo.setSubscriberCommonSiteId("subscriberCommonSiteId");
-        subscriberInfo.setSubscriberName("subscriberName");
-
-        ResourceModelInfo resourceModelInfo = new ResourceModelInfo();
-        resourceModelInfo.setModelType("modelType");
-        resourceModelInfo.setModelCustomizationName("modelCustomizationName");
-        resourceModelInfo.setModelInvariantId("invarianteId");
-        resourceModelInfo.setModelName("modelName");
-        resourceModelInfo.setModelVersion("version");
-        resourceModelInfo.setModelVersionId("versionId");
-
-        PlacementDemand placementDemand = new PlacementDemand();
-        placementDemand.setResourceModelInfo(resourceModelInfo);
-        placementDemand.setResourceModuleName("resourceModuleName");
-        placementDemand.setServiceResourceId("serviceResourceId");
-        placementDemand.setTenantId("tenantId");
-
-        OofRequestParameters oofRequestParameters = new OofRequestParameters();
-        oofRequestParameters.setCustomerLatitude("customerLatitude");
-        oofRequestParameters.setCustomerLongitude("customerLongitude");
-        oofRequestParameters.setCustomerName("customerName");
-
-        ArrayList<PlacementDemand> placementDemands = new ArrayList<>();
-        placementDemands.add(placementDemand);
-
-        PlacementInfo placementInfo = new PlacementInfo();
-        placementInfo.setPlacementDemands(placementDemands);
-        placementInfo.setRequestParameters(oofRequestParameters);
-        placementInfo.setSubscriberInfo(subscriberInfo);
-
-        RequestInfo requestInfo = new RequestInfo();
-        requestInfo.setTransactionId("transactionId");
-        List<String> optimizer = new ArrayList<>();
-        optimizer.add("optimizer1");
-        optimizer.add("optimizer2");
-        requestInfo.setOptimizers(optimizer);
-        requestInfo.setCallbackUrl("callBackUrl");
-        requestInfo.setNumSolutions(1);
-        requestInfo.setRequestId("requestId");
-        requestInfo.setSourceId("sourceId");
-        requestInfo.setTimeout(30L);
-        requestInfo.setRequestType("requestType");
-
-        OofRequest oofRequest = new OofRequest();
-        oofRequest.setRequestInformation(requestInfo);
-        oofRequest.setPlacementInformation(placementInfo);
-        oofRequest.setServiceInformation(serviceInfo);
-        oofRequest.setLicenseInformation(new LicenseInfo());
-
-        wireMockServer.stubFor(post(urlEqualTo("/api/oof/v1/placement")).willReturn(
-                aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
-
-        client.postDemands(oofRequest);
-
-        String oofRequestOutput = oofRequest.toJsonString();
-        JSONAssert.assertEquals("{\n" + "  \"requestInfo\" : {\n" + "    \"transactionId\" : \"transactionId\",\n"
-                + "    \"requestId\" : \"requestId\",\n" + "    \"callbackUrl\" : \"callBackUrl\",\n"
-                + "    \"sourceId\" : \"sourceId\",\n" + "    \"requestType\" : \"requestType\",\n"
-                + "    \"numSolutions\" : 1,\n" + "    \"optimizers\" : [ \"optimizer1\", \"optimizer2\" ],\n"
-                + "    \"timeout\" : 30\n" + "  },\n" + "  \"serviceInfo\" : {\n"
-                + "    \"serviceInstanceId\" : \"serviceInstanceId\",\n" + "    \"serviceName\" : \"serviceName\",\n"
-                + "    \"modelInfo\" : {\n" + "      \"modelType\" : \"modelType-Service\",\n"
-                + "      \"modelInvariantId\" : \"modelInvariantId-Service\",\n"
-                + "      \"modelVersionId\" : \"modelVersionId-Service\",\n"
-                + "      \"modelName\" : \"modelName-Service\",\n"
-                + "      \"modelVersion\" : \"modelVersion-Service\",\n"
-                + "      \"modelCustomizationName\" : \"modelCustomizationName-Service\"\n" + "    }\n" + "  },\n"
-                + "  \"placementInfo\" : {\n" + "    \"requestParameters\" : {\n"
-                + "      \"customerLatitude\" : \"customerLatitude\",\n"
-                + "      \"customerLongitude\" : \"customerLongitude\",\n"
-                + "      \"customerName\" : \"customerName\"\n" + "    },\n" + "    \"subscriberInfo\" : {\n"
-                + "      \"globalSubscriberId\" : \"globalSubscriberId\",\n"
-                + "      \"subscriberName\" : \"subscriberName\",\n"
-                + "      \"subscriberCommonSiteId\" : \"subscriberCommonSiteId\"\n" + "    },\n"
-                + "    \"placementDemands\" : [ {\n" + "      \"resourceModuleName\" : \"resourceModuleName\",\n"
-                + "      \"serviceResourceId\" : \"serviceResourceId\",\n" + "      \"tenantId\" : \"tenantId\",\n"
-                + "      \"resourceModelInfo\" : {\n" + "        \"modelType\" : \"modelType\",\n"
-                + "        \"modelInvariantId\" : \"invarianteId\",\n" + "        \"modelVersionId\" : \"versionId\",\n"
-                + "        \"modelName\" : \"modelName\",\n" + "        \"modelVersion\" : \"version\",\n"
-                + "        \"modelCustomizationName\" : \"modelCustomizationName\"\n" + "      }\n" + "    } ]\n"
-                + "  },\n" + "  \"licenseInfo\" : { \n" + "    \"licenseDemands\" : [ ]\n" + "}\n" + "}",
-                oofRequestOutput, false);
-    }
-
-    @Test
-    public void testAsyncResponse_success() throws BadResponseException, JsonProcessingException {
-        String mockResponse =
-                "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"status\", \"requestStatus\": \"accepted\"}";
-
-        wireMockServer.stubFor(post(urlEqualTo("/api/oof/v1/placement")).willReturn(
-                aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
-
-        client.postDemands(new OofRequest());
-    }
-
-    @Test(expected = BadResponseException.class)
-    public void testPostDemands_error_failed() throws JsonProcessingException, BadResponseException {
-        String mockResponse =
-                "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"missing data\", \"requestStatus\": \"failed\"}";
-
-        wireMockServer.stubFor(post(urlEqualTo("/api/oof/v1/placement")).willReturn(
-                aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
-
-
-        client.postDemands(new OofRequest());
-
-        // TODO assertEquals("missing data", );
-
-    }
-
-    @Test(expected = BadResponseException.class)
-    public void testPostDemands_error_noMessage() throws JsonProcessingException, BadResponseException {
-        String mockResponse =
-                "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"\", \"requestStatus\": \"failed\"}";
-
-        wireMockServer.stubFor(post(urlEqualTo("/api/oof/v1/placement")).willReturn(
-                aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
-
-
-        client.postDemands(new OofRequest());
-
-    }
-
-    @Test(expected = BadResponseException.class)
-    public void testPostDemands_error_noStatus() throws JsonProcessingException, BadResponseException {
-        String mockResponse =
-                "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"missing data\", \"requestStatus\": null}";
-
-        wireMockServer.stubFor(post(urlEqualTo("/api/oof/v1/placement")).willReturn(
-                aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
-
-
-        client.postDemands(new OofRequest());
-
-    }
-
-    @Test(expected = BadResponseException.class)
-    public void testPostDemands_error_empty() throws JsonProcessingException, BadResponseException {
-        String mockResponse = "{ }";
-
-        wireMockServer.stubFor(post(urlEqualTo("/api/oof/v1/placement")).willReturn(
-                aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
-
-
-        client.postDemands(new OofRequest());
-    }
-
-}
diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sniro/SniroClientTestIT.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sniro/SniroClientTestIT.java
deleted file mode 100644
index 56c5238..0000000
--- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/sniro/SniroClientTestIT.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 - 2018 AT&T Intellectual Property. 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.so.client.sniro;
-
-import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
-import static com.github.tomakehurst.wiremock.client.WireMock.post;
-import static com.github.tomakehurst.wiremock.client.WireMock.urlEqualTo;
-import org.junit.Test;
-import org.onap.so.BaseIntegrationTest;
-import org.onap.so.client.exception.BadResponseException;
-import org.onap.so.client.sniro.beans.SniroConductorRequest;
-import org.onap.so.client.sniro.beans.SniroManagerRequest;
-import org.springframework.beans.factory.annotation.Autowired;
-import com.fasterxml.jackson.core.JsonProcessingException;
-
-
-public class SniroClientTestIT extends BaseIntegrationTest {
-
-    @Autowired
-    private SniroClient client;
-
-
-    @Test(expected = Test.None.class)
-    public void testPostDemands_success() throws BadResponseException, JsonProcessingException {
-        String mockResponse =
-                "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"corys cool\", \"requestStatus\": \"accepted\"}";
-
-        wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2")).willReturn(
-                aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
-
-        client.postDemands(new SniroManagerRequest());
-
-    }
-
-    @Test(expected = BadResponseException.class)
-    public void testPostDemands_error_failed() throws JsonProcessingException, BadResponseException {
-        String mockResponse =
-                "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"missing data\", \"requestStatus\": \"failed\"}";
-
-        wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2")).willReturn(
-                aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
-
-
-        client.postDemands(new SniroManagerRequest());
-
-        // TODO assertEquals("missing data", );
-
-    }
-
-    @Test(expected = BadResponseException.class)
-    public void testPostDemands_error_noMessage() throws JsonProcessingException, BadResponseException {
-        String mockResponse =
-                "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"\", \"requestStatus\": \"failed\"}";
-
-        wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2")).willReturn(
-                aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
-
-
-        client.postDemands(new SniroManagerRequest());
-
-    }
-
-    @Test(expected = BadResponseException.class)
-    public void testPostDemands_error_noStatus() throws JsonProcessingException, BadResponseException {
-        String mockResponse =
-                "{\"transactionId\": \"123456789\", \"requestId\": \"1234\", \"statusMessage\": \"missing data\", \"requestStatus\": null}";
-
-        wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2")).willReturn(
-                aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
-
-
-        client.postDemands(new SniroManagerRequest());
-
-    }
-
-    @Test(expected = BadResponseException.class)
-    public void testPostDemands_error_empty() throws JsonProcessingException, BadResponseException {
-        String mockResponse = "{ }";
-
-        wireMockServer.stubFor(post(urlEqualTo("/sniro/api/placement/v2")).willReturn(
-                aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
-
-
-        client.postDemands(new SniroManagerRequest());
-    }
-
-    @Test(expected = Test.None.class)
-    public void testPostRelease_success() throws BadResponseException, JsonProcessingException {
-        String mockResponse = "{\"status\": \"success\", \"message\": \"corys cool\"}";
-
-        wireMockServer.stubFor(post(urlEqualTo("/v1/release-orders")).willReturn(
-                aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
-
-        client.postRelease(new SniroConductorRequest());
-    }
-
-    @Test(expected = BadResponseException.class)
-    public void testPostRelease_error_failed() throws BadResponseException, JsonProcessingException {
-        String mockResponse = "{\"status\": \"failure\", \"message\": \"corys cool\"}";
-
-        wireMockServer.stubFor(post(urlEqualTo("/v1/release-orders")).willReturn(
-                aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
-
-        client.postRelease(new SniroConductorRequest());
-    }
-
-    @Test(expected = BadResponseException.class)
-    public void testPostRelease_error_noStatus() throws BadResponseException, JsonProcessingException {
-        String mockResponse = "{\"status\": \"\", \"message\": \"corys cool\"}";
-
-        wireMockServer.stubFor(post(urlEqualTo("/v1/release-orders")).willReturn(
-                aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
-
-        client.postRelease(new SniroConductorRequest());
-
-    }
-
-    @Test(expected = BadResponseException.class)
-    public void testPostRelease_error_noMessage() throws BadResponseException, JsonProcessingException {
-        String mockResponse = "{\"status\": \"failure\", \"message\": null}";
-
-        wireMockServer.stubFor(post(urlEqualTo("/v1/release-orders")).willReturn(
-                aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
-
-        client.postRelease(new SniroConductorRequest());
-
-    }
-
-    @Test(expected = BadResponseException.class)
-    public void testPostRelease_error_empty() throws BadResponseException, JsonProcessingException {
-        String mockResponse = "{ }";
-
-        wireMockServer.stubFor(post(urlEqualTo("/v1/release-orders")).willReturn(
-                aResponse().withStatus(200).withHeader("Content-Type", "application/json").withBody(mockResponse)));
-
-        client.postRelease(new SniroConductorRequest());
-
-    }
-
-}
