diff --git a/mso-api-handlers/mso-requests-db/src/hibernate.reveng.xml b/mso-api-handlers/mso-requests-db/src/hibernate.reveng.xml
new file mode 100644
index 0000000..b9ac472
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/hibernate.reveng.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ============LICENSE_START=======================================================
+  ECOMP MSO
+  ================================================================================
+  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=========================================================
+  -->
+
+<!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://www.hibernate.org/dtd//hibernate-reverse-engineering-3.0.dtd" >
+
+<hibernate-reverse-engineering>
+
+   <schema-selection match-schema="MSO"/>
+     <table-filter match-schema="MSO" match-name=".*"/>
+     <type-mapping> 
+        <sql-type jdbc-type="OTHER" hibernate-type="java.sql.Timestamp" /> 
+    </type-mapping>
+</hibernate-reverse-engineering>
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/META-INF/MANIFEST.MF b/mso-api-handlers/mso-requests-db/src/main/java/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..5e94951
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/META-INF/MANIFEST.MF
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/HibernateUtil.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/HibernateUtil.java
new file mode 100644
index 0000000..21bece9
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/HibernateUtil.java
@@ -0,0 +1,59 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * 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.openecomp.mso.requestsdb;
+
+
+import org.hibernate.SessionFactory;
+import org.hibernate.cfg.Configuration;
+import org.openecomp.mso.logger.MessageEnum;
+import org.openecomp.mso.logger.MsoLogger;
+
+@SuppressWarnings("deprecation")
+public class HibernateUtil {
+
+    //private static SessionFactory SESSION_FACTORY;
+    private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.APIH);
+    
+     private static SessionFactory SESSION_FACTORY;
+
+
+    static {
+        try {
+
+         if ("MYSQL".equals (System.getProperty ("mso.db")) || "MARIADB".equals(System.getProperty("mso.db"))) {
+                SESSION_FACTORY = new Configuration ().configure ("hibernate-mysql.cfg.xml").buildSessionFactory ();
+            } else {
+            	LOGGER.error (MessageEnum.APIH_DB_ACCESS_EXC_REASON, "DB Connection not specified to the JVM,choose either:-Dmso.db=MARIADB, -Dmso.db=MYSQL or -Dmso.container=AJSC", "", "", MsoLogger.ErrorCode.DataError , "DB Connection not specified to the JVM,choose either:-Dmso.db=MARIADB, -Dmso.db=MYSQL or -Dmso.container=AJSC");
+            }
+        } catch (Exception ex) {
+            LOGGER.error (MessageEnum.APIH_DB_ACCESS_EXC_REASON, ex.getMessage (), "", "", MsoLogger.ErrorCode.DataError , "Problem in getting DB connection type", ex);
+            throw ex;
+        }
+    }
+
+    public static SessionFactory getSessionFactory () {
+        return SESSION_FACTORY;
+    }
+
+    private HibernateUtil () {
+        // Avoid creation of an instance
+    }
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraActiveRequests.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraActiveRequests.java
new file mode 100644
index 0000000..992cf6a
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraActiveRequests.java
@@ -0,0 +1,41 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * 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.openecomp.mso.requestsdb;
+
+
+/**
+ * InfraActiveRequests
+ */
+public class InfraActiveRequests extends InfraRequests {
+
+	/**
+     * Serialization id.
+     */
+    private static final long serialVersionUID = 5003555140088137254L;
+
+	public InfraActiveRequests() {
+	    super ();
+	}
+
+	public InfraActiveRequests(String requestId, String action) {
+	    super (requestId, action);
+	}
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraRequests.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraRequests.java
new file mode 100644
index 0000000..4312819
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/InfraRequests.java
@@ -0,0 +1,405 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * 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.openecomp.mso.requestsdb;
+
+// Generated Jul 27, 2015 3:05:00 PM by Hibernate Tools 3.4.0.CR1
+
+import java.sql.Timestamp;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.openecomp.mso.requestsdb.adapter.TimestampXMLAdapter;
+
+/**
+ * InfraActiveRequests generated by hbm2java
+ */
+public class InfraRequests implements java.io.Serializable {
+
+    /**
+     * Serialization id.
+     */
+    private static final long serialVersionUID = -661307666798018192L;
+
+    private String requestId;
+	private String clientRequestId;
+	private String action;
+	private String requestStatus;
+	private String statusMessage;
+	private Long progress;
+	private Timestamp startTime;
+	private Timestamp endTime;
+	private String source;
+	private String vnfId;
+	private String vnfName;
+	private String vnfType;
+	private String serviceType;
+	private String aicNodeClli;
+	private String tenantId;
+	private String provStatus;
+	private String vnfParams;
+	private String vnfOutputs;
+	private String requestBody;
+	private String responseBody;
+	private String lastModifiedBy;
+	private Timestamp modifyTime;
+	private String requestType;
+	private String volumeGroupId;
+	private String volumeGroupName;
+	private String vfModuleId;
+	private String vfModuleName;
+	private String vfModuleModelName;
+	private String aaiServiceId;
+	private String aicCloudRegion;
+	private String callBackUrl;
+	private String correlator;
+	private String serviceInstanceId;
+	private String serviceInstanceName;
+	private String requestScope;
+	private String requestAction;
+	private String networkId;
+	private String networkName;
+	private String networkType;
+	
+
+	public InfraRequests() {
+	}
+
+	public InfraRequests(String requestId, String action) {
+		this.requestId = requestId;
+		this.action = action;
+	}
+
+	public String getRequestId() {
+		return this.requestId;
+	}
+
+	public void setRequestId(String requestId) {
+		this.requestId = requestId;
+	}
+
+	public String getClientRequestId() {
+		return clientRequestId;
+	}
+
+	public void setClientRequestId(String clientRequestId) {
+		this.clientRequestId = clientRequestId;
+	}
+
+	public String getAction() {
+		return this.action;
+	}
+
+	public void setAction(String action) {
+		this.action = action;
+	}
+
+	public String getRequestStatus() {
+		return this.requestStatus;
+	}
+
+	public void setRequestStatus(String requestStatus) {
+		this.requestStatus = requestStatus;
+	}
+
+	public String getStatusMessage() {
+		return this.statusMessage;
+	}
+
+	public void setStatusMessage(String statusMessage) {
+		this.statusMessage = statusMessage;
+	}
+
+	public Long getProgress() {
+		return this.progress;
+	}
+
+	public void setProgress(Long progress) {
+		this.progress = progress;
+	}
+
+    @XmlJavaTypeAdapter(TimestampXMLAdapter.class)
+	public Timestamp getStartTime() {
+		return this.startTime;
+	}
+
+	public void setStartTime(Timestamp startTime) {
+		this.startTime = startTime;
+	}
+
+    @XmlJavaTypeAdapter(TimestampXMLAdapter.class)
+	public Timestamp getEndTime() {
+		return this.endTime;
+	}
+
+	public void setEndTime(Timestamp endTime) {
+		this.endTime = endTime;
+	}
+
+	public String getSource() {
+		return this.source;
+	}
+
+	public void setSource(String source) {
+		this.source = source;
+	}
+
+	public String getVnfId() {
+		return this.vnfId;
+	}
+
+	public void setVnfId(String vnfId) {
+		this.vnfId = vnfId;
+	}
+
+	public String getVnfName() {
+		return this.vnfName;
+	}
+
+	public void setVnfName(String vnfName) {
+		this.vnfName = vnfName;
+	}
+
+	public String getVnfType() {
+		return this.vnfType;
+	}
+
+	public void setVnfType(String vnfType) {
+		this.vnfType = vnfType;
+	}
+
+	public String getServiceType() {
+		return this.serviceType;
+	}
+
+	public void setServiceType(String serviceType) {
+		this.serviceType = serviceType;
+	}
+
+	public String getAicNodeClli() {
+		return this.aicNodeClli;
+	}
+
+	public void setAicNodeClli(String aicNodeClli) {
+		this.aicNodeClli = aicNodeClli;
+	}
+
+	public String getTenantId() {
+		return this.tenantId;
+	}
+
+	public void setTenantId(String tenantId) {
+		this.tenantId = tenantId;
+	}
+
+	public String getProvStatus() {
+		return this.provStatus;
+	}
+
+	public void setProvStatus(String provStatus) {
+		this.provStatus = provStatus;
+	}
+
+	public String getVnfParams() {
+		return this.vnfParams;
+	}
+
+	public void setVnfParams(String vnfParams) {
+		this.vnfParams = vnfParams;
+	}
+
+	public String getVnfOutputs() {
+		return this.vnfOutputs;
+	}
+
+	public void setVnfOutputs(String vnfOutputs) {
+		this.vnfOutputs = vnfOutputs;
+	}
+
+	public String getRequestBody() {
+		return this.requestBody;
+	}
+
+	public void setRequestBody(String requestBody) {
+		this.requestBody = requestBody;
+	}
+
+	public String getResponseBody() {
+		return this.responseBody;
+	}
+
+	public void setResponseBody(String responseBody) {
+		this.responseBody = responseBody;
+	}
+
+	public String getLastModifiedBy() {
+		return this.lastModifiedBy;
+	}
+
+	public void setLastModifiedBy(String lastModifiedBy) {
+		this.lastModifiedBy = lastModifiedBy;
+	}
+
+    @XmlJavaTypeAdapter(TimestampXMLAdapter.class)
+	public Timestamp getModifyTime() {
+		return this.modifyTime;
+	}
+
+	public void setModifyTime(Timestamp modifyTime) {
+		this.modifyTime = modifyTime;
+	}
+
+	public String getRequestType() {
+		return this.requestType;
+	}
+
+	public void setRequestType(String requestType) {
+		this.requestType = requestType;
+	}
+	
+	public String getVolumeGroupId() {
+		return this.volumeGroupId;
+	}
+
+	public void setVolumeGroupId(String volumeGroupId) {
+		this.volumeGroupId = volumeGroupId;
+	}
+	
+	public String getVolumeGroupName() {
+		return this.volumeGroupName;
+	}
+
+	public void setVolumeGroupName(String volumeGroupName) {
+		this.volumeGroupName = volumeGroupName;
+	}
+	
+	public String getVfModuleId() {
+		return this.vfModuleId;
+	}
+
+	public void setVfModuleId(String vfModuleId) {
+		this.vfModuleId = vfModuleId;
+	}
+	
+	public String getVfModuleName() {
+		return this.vfModuleName;
+	}
+
+	public void setVfModuleName(String vfModuleName) {
+		this.vfModuleName = vfModuleName;
+	}
+	
+	public String getVfModuleModelName() {
+		return this.vfModuleModelName;
+	}
+
+	public void setVfModuleModelName(String vfModuleModelName) {
+		this.vfModuleModelName = vfModuleModelName;
+	}
+	
+	public String getAaiServiceId() {
+		return this.aaiServiceId;
+	}
+
+	public void setAaiServiceId(String aaiServiceId) {
+		this.aaiServiceId = aaiServiceId;
+	}
+
+	public String getAicCloudRegion() {
+		return this.aicCloudRegion;
+	}
+
+	public void setAicCloudRegion(String aicCloudRegion) {
+		this.aicCloudRegion = aicCloudRegion;
+	}
+
+	public String getCallBackUrl() {
+		return callBackUrl;
+	}
+
+	public void setCallBackUrl(String callBackUrl) {
+		this.callBackUrl = callBackUrl;
+	}
+
+	public String getCorrelator() {
+		return correlator;
+	}
+
+	public void setCorrelator(String correlator) {
+		this.correlator = correlator;
+	}
+
+	public String getServiceInstanceId() {
+		return serviceInstanceId;
+	}
+
+	public void setServiceInstanceId(String serviceInstanceId) {
+		this.serviceInstanceId = serviceInstanceId;
+	}
+
+	public String getServiceInstanceName() {
+		return serviceInstanceName;
+	}
+
+	public void setServiceInstanceName(String serviceInstanceName) {
+		this.serviceInstanceName = serviceInstanceName;
+	}
+
+	public String getRequestScope() {
+		return requestScope;
+	}
+
+	public void setRequestScope(String requestScope) {
+		this.requestScope = requestScope;
+	}
+	
+	public String getRequestAction() {
+		return requestAction;
+	}
+
+	public void setRequestAction(String requestAction) {
+		this.requestAction = requestAction;
+	}
+
+	public String getNetworkId() {
+		return networkId;
+	}
+
+	public void setNetworkId(String networkId) {
+		this.networkId = networkId;
+	}
+
+	public String getNetworkName() {
+		return networkName;
+	}
+
+	public void setNetworkName(String networkName) {
+		this.networkName = networkName;
+	}
+
+	public String getNetworkType() {
+		return networkType;
+	}
+
+	public void setNetworkType(String networkType) {
+		this.networkType = networkType;
+	}
+	
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/MockRequestsDatabase.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/MockRequestsDatabase.java
new file mode 100644
index 0000000..22179e9
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/MockRequestsDatabase.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * 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.openecomp.mso.requestsdb;
+
+
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class MockRequestsDatabase {
+	
+	private Map<String, InfraActiveRequests> activeRequests;
+	
+	public MockRequestsDatabase() {
+		activeRequests = new HashMap<String, InfraActiveRequests>();
+	}
+	
+	public void addRecord(InfraActiveRequests record) {
+		String serviceType = record.getServiceType();
+		String serviceInstanceId = record.getServiceInstanceId();
+		String key = serviceType + "::" + serviceInstanceId;
+		activeRequests.put(key, record);
+	}
+	
+	public void deleteRecord(String serviceType, String serviceInstanceId) {
+		String key = serviceType + "::" + serviceInstanceId;
+		activeRequests.remove(key);
+	}
+	
+	public InfraActiveRequests getRecord(String serviceType, String serviceInstanceId) {
+		String key = serviceType + "::" + serviceInstanceId;
+		InfraActiveRequests record = activeRequests.get(key);
+		return record;
+	}
+	
+	public InfraActiveRequests checkDuplicate(String serviceType, String serviceInstanceId) {
+		return getRecord(serviceType, serviceInstanceId);
+	}
+	
+	public InfraActiveRequests checkRetry(String serviceType, String serviceInstanceId) {
+		InfraActiveRequests record = getRecord(serviceType, serviceInstanceId);
+		InfraActiveRequests returnRecord = null;
+		if (record != null) {
+			String requestAction = record.getRequestAction();
+			if (requestAction == null || !requestAction.equals("GetLayer3ServiceDetailsRequest")) {
+				String status = record.getRequestStatus();
+				if (status != null && status.equals("COMPLETED")) {
+					return returnRecord = record;
+				}
+			}
+		}
+		return returnRecord;
+	}
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java
new file mode 100644
index 0000000..8961b26
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/RequestsDatabase.java
@@ -0,0 +1,494 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * 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.openecomp.mso.requestsdb;
+
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.http.HttpStatus;
+import org.hibernate.Criteria;
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.criterion.Criterion;
+import org.hibernate.criterion.Order;
+import org.hibernate.criterion.Restrictions;
+import org.hibernate.persister.entity.AbstractEntityPersister;
+
+import org.openecomp.mso.logger.MsoLogger;
+
+public final class RequestsDatabase {
+
+    private static MsoLogger msoLogger = MsoLogger.getMsoLogger (MsoLogger.Catalog.GENERAL);
+
+    private static final String SOURCE = "source";
+    private static final String START_TIME = "startTime";
+    private static final String REQUEST_TYPE = "requestType";
+    private static final String SERVICE_INSTANCE_ID = "serviceInstanceId";
+    private static final String SERVICE_INSTANCE_NAME = "serviceInstanceName";
+    private static final String VNF_INSTANCE_NAME = "vnfName";
+    private static final String VNF_INSTANCE_ID = "vnfId";
+    private static final String VOLUME_GROUP_INSTANCE_NAME = "volumeGroupName";
+    private static final String VOLUME_GROUP_INSTANCE_ID = "volumeGroupId";
+    private static final String VFMODULE_INSTANCE_NAME = "vfModuleName";
+    private static final String VFMODULE_INSTANCE_ID = "vfModuleId";
+    private static final String NETWORK_INSTANCE_NAME = "networkName";
+    private static final String NETWORK_INSTANCE_ID = "networkId";
+    private static final String GLOBAL_SUBSCRIBER_ID = "globalSubscriberId";
+    private static final String SERVICE_NAME_VERSION_ID = "serviceNameVersionId";
+    private static final String SERVICE_ID = "serviceId";
+    private static final String SERVICE_VERSION = "serviceVersion";
+    private static final String SERVICE_TYPE = "serviceType";
+    private static final String REQUEST_ID = "requestId";
+    private static MockRequestsDatabase mockDB = null;
+
+    /**
+     * Avoids creating an instance of this utility class.
+     */
+    private RequestsDatabase () {
+    }
+
+    public static boolean healthCheck () {
+        Session session = HibernateUtil.getSessionFactory ().openSession ();
+        try {
+            Query query = session.createSQLQuery (" show tables ");
+
+            List<?> list = query.list();
+
+        } finally {
+            if (session != null && session.isOpen ()) {
+                session.close ();
+            }
+        }
+        return true;
+    }
+
+
+    public static int updateInfraStatus (String requestId, String requestStatus, String lastModifiedBy) {
+        long startTime = System.currentTimeMillis ();
+        msoLogger.debug ("Update infra request record " + requestId + " with status " + requestStatus);
+        Session session = HibernateUtil.getSessionFactory ().openSession ();
+
+        int result = 0;
+        try {
+            session.beginTransaction ();
+            Query query = session.createQuery ("update InfraActiveRequests set requestStatus = :requestStatus, modifyTime = :modifyTime, lastModifiedBy = :lastModifiedBy where requestId = :requestId ");
+            query.setParameter ("requestStatus", requestStatus);
+            query.setParameter (REQUEST_ID, requestId);
+            query.setParameter ("lastModifiedBy", lastModifiedBy);
+            Calendar modifyTime = Calendar.getInstance ();
+            Timestamp modifyTimeStamp = new Timestamp (modifyTime.getTimeInMillis ());
+            query.setParameter ("modifyTime", modifyTimeStamp);
+            result = query.executeUpdate ();
+            session.getTransaction ().commit ();
+        } finally {
+            if (session != null && session.isOpen ()) {
+                session.close ();
+            }
+            msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "updateInfraStatus", null);
+        }
+        return result;
+    }
+
+    public static int updateInfraStatus (String requestId, String requestStatus, long progress, String lastModifiedBy) {
+        long startTime = System.currentTimeMillis ();
+        msoLogger.debug ("Update infra request record " + requestId + " with status " + requestStatus);
+        Session session = HibernateUtil.getSessionFactory ().openSession ();
+
+        int result = 0;
+        try {
+            session.beginTransaction ();
+            Query query = session.createQuery ("update InfraActiveRequests set requestStatus = :requestStatus, modifyTime = :modifyTime, progress = :progress, lastModifiedBy = :lastModifiedBy where requestId = :requestId ");
+            query.setParameter ("requestStatus", requestStatus);
+            query.setParameter (REQUEST_ID, requestId);
+            query.setParameter ("progress", progress);
+            query.setParameter ("lastModifiedBy", lastModifiedBy);
+            Calendar modifyTime = Calendar.getInstance ();
+            Timestamp modifyTimeStamp = new Timestamp (modifyTime.getTimeInMillis ());
+            query.setParameter ("modifyTime", modifyTimeStamp);
+            result = query.executeUpdate ();
+            session.getTransaction ().commit ();
+        } finally {
+            if (session != null && session.isOpen ()) {
+                session.close ();
+            }
+            msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "updateInfraStatus", null);
+        }
+        return result;
+    }
+
+    public static int updateInfraFinalStatus (String requestId, String requestStatus, String statusMessage, long progress, String responseBody, String lastModifiedBy) {
+        long startTime = System.currentTimeMillis ();
+        msoLogger.debug ("Update infra request record " + requestId + " with status " + requestStatus);
+        Session session = HibernateUtil.getSessionFactory ().openSession ();
+
+        int result = 0;
+        try {
+            session.beginTransaction ();
+            Query query = session.createQuery ("update InfraActiveRequests set requestStatus = :requestStatus, statusMessage = :statusMessage, progress = :progress, endTime = :endTime, responseBody = :responseBody, lastModifiedBy = :lastModifiedBy where id.requestId = :requestId ");
+            query.setParameter ("requestStatus", requestStatus);
+            query.setParameter ("requestId", requestId);
+            Calendar endTime = Calendar.getInstance ();
+            Timestamp endTimeStamp = new Timestamp (endTime.getTimeInMillis ());
+            query.setParameter ("endTime", endTimeStamp);
+            query.setParameter ("statusMessage", statusMessage);
+            query.setParameter ("progress", progress);
+            query.setParameter ("responseBody", responseBody);
+            query.setParameter ("lastModifiedBy", lastModifiedBy);
+            result = query.executeUpdate ();
+            session.getTransaction ().commit ();
+        } finally {
+            if (session != null && session.isOpen ()) {
+                session.close ();
+            }
+            msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "updateInfraFinalStatus", null);
+        }
+        return result;
+    }
+
+    
+    private static List<InfraActiveRequests> executeInfraQuery (List <Criterion> criteria, Order order) {
+
+        long startTime = System.currentTimeMillis ();
+        msoLogger.debug ("Execute query on infra active request table");
+        
+        List <InfraActiveRequests> results = new ArrayList<InfraActiveRequests>();
+
+        Session session = HibernateUtil.getSessionFactory ().openSession ();
+        try {
+            session.beginTransaction ();
+            Criteria crit = session.createCriteria (InfraActiveRequests.class);
+            for (Criterion criterion : criteria) {
+                crit.add (criterion);
+            }
+            crit.addOrder (order);
+
+           // @SuppressWarnings("unchecked")
+            results = crit.list ();
+
+        } finally {
+            if (session != null && session.isOpen ()) {
+                session.close ();
+            }
+            msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "getInfraActiveRequest", null);
+        }
+        return results;
+    }
+    
+    public static InfraActiveRequests getRequestFromInfraActive (String requestId) {
+        long startTime = System.currentTimeMillis ();
+        msoLogger.debug ("Get request " + requestId + " from InfraActiveRequests DB");
+
+        Session session = HibernateUtil.getSessionFactory ().openSession ();
+        InfraActiveRequests ar = null;
+        try {
+            session.beginTransaction ();
+            Query query = session.createQuery ("from InfraActiveRequests where requestId = :requestId OR clientRequestId = :requestId");
+            query.setParameter (REQUEST_ID, requestId);
+            ar = (InfraActiveRequests) query.uniqueResult ();
+        } finally {
+            if (session != null && session.isOpen ()) {
+                session.close ();
+            }
+            msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "InfraRequestDB", "getRequestFromInfraActive", null);
+        }
+        return ar;
+    }
+    
+    public static InfraActiveRequests checkInstanceNameDuplicate (HashMap<String,String> instanceIdMap, String instanceName, String requestScope) {
+
+        List <Criterion> criteria = new LinkedList <> ();
+       
+        if(instanceName != null && !instanceName.equals("")) {
+        	
+        	if(requestScope.equals("service")){
+        		criteria.add (Restrictions.eq (SERVICE_INSTANCE_NAME, instanceName));
+        	} else if(requestScope.equals("vnf")){
+        		criteria.add (Restrictions.eq (VNF_INSTANCE_NAME, instanceName));
+        	} else if(requestScope.equals("volumeGroup")){
+        		criteria.add (Restrictions.eq (VOLUME_GROUP_INSTANCE_NAME, instanceName));
+        	} else if(requestScope.equals("vfModule")){
+        		criteria.add (Restrictions.eq (VFMODULE_INSTANCE_NAME, instanceName));
+        	} else if(requestScope.equals("network")){
+        		criteria.add (Restrictions.eq (NETWORK_INSTANCE_NAME, instanceName));
+        	}
+        
+        } else {
+            if(instanceIdMap != null){
+            	if(requestScope.equals("service") && instanceIdMap.get("serviceInstanceId") != null){
+            		criteria.add (Restrictions.eq (SERVICE_INSTANCE_ID, instanceIdMap.get("serviceInstanceId")));
+             	}
+            
+            	if(requestScope.equals("vnf") && instanceIdMap.get("vnfInstanceId") != null){
+            		criteria.add (Restrictions.eq (VNF_INSTANCE_ID, instanceIdMap.get("vnfInstanceId")));
+             	}
+            
+            	if(requestScope.equals("vfModule") && instanceIdMap.get("vfModuleInstanceId") != null){
+            		criteria.add (Restrictions.eq (VFMODULE_INSTANCE_ID, instanceIdMap.get("vfModuleInstanceId")));
+             	}
+            
+            	if(requestScope.equals("volumeGroup") && instanceIdMap.get("volumeGroupInstanceId") != null){
+            		criteria.add (Restrictions.eq (VOLUME_GROUP_INSTANCE_ID, instanceIdMap.get("volumeGroupInstanceId")));
+             	}
+            
+            	if(requestScope.equals("network") && instanceIdMap.get("networkInstanceId") != null){
+            		criteria.add (Restrictions.eq (NETWORK_INSTANCE_ID, instanceIdMap.get("networkInstanceId")));
+            	}
+            }
+        }
+        
+        criteria.add (Restrictions.in ("requestStatus", new String[] { "PENDING", "IN_PROGRESS", "TIMEOUT" }));
+        
+        Order order = Order.desc (START_TIME);
+        
+        List<InfraActiveRequests> dupList = executeInfraQuery(criteria, order);
+        
+        InfraActiveRequests infraActiveRequests = null;
+        
+        if(dupList != null && dupList.size() > 0){
+        	infraActiveRequests = dupList.get(0);
+        }
+         	
+        return infraActiveRequests; 
+    }
+      
+    public static List<InfraActiveRequests> getOrchestrationFiltersFromInfraActive (Map<String, List<String>> orchestrationMap) {
+        
+    	
+    	List <Criterion> criteria = new LinkedList <> ();
+    	for (Map.Entry<String, List<String>> entry : orchestrationMap.entrySet())
+    	{
+    		String mapKey = entry.getKey();
+
+    	    if(mapKey.equalsIgnoreCase("vnfInstanceId")){
+    	    	mapKey = "vnfId";
+     	    } else if(mapKey.equalsIgnoreCase("vnfInstanceName")) {
+    	    	mapKey = "vnfName";
+    	    } else if(mapKey.equalsIgnoreCase("vfModuleInstanceId")) {
+    	    	mapKey = "vfModuleId";
+    	    } else if(mapKey.equalsIgnoreCase("vfModuleInstanceName")) {
+    	    	mapKey = "vfModuleName";
+    	    } else if(mapKey.equalsIgnoreCase("volumeGroupInstanceId")) {
+    	    	mapKey = "volumeGroupId";
+    	    } else if(mapKey.equalsIgnoreCase("volumeGroupInstanceName")) {
+    	    	mapKey = "volumeGroupName";
+    	    } else if(mapKey.equalsIgnoreCase("networkInstanceId")) {
+    	    	mapKey = "networkId";
+    	    } else if(mapKey.equalsIgnoreCase("networkInstanceName")) {
+    	    	mapKey = "networkName";
+    	    } else if(mapKey.equalsIgnoreCase("lcpCloudRegionId")) {
+    	    	mapKey = "aicCloudRegion";
+    	    } 
+    	    
+    	    criteria.add(Restrictions.eq(mapKey, entry.getValue().get(1)));  	    
+    	    
+    	}
+    	
+         Order order = Order.asc (START_TIME);
+
+        return executeInfraQuery (criteria, order);
+    }
+
+
+    public static List <InfraActiveRequests> getRequestListFromInfraActive (String queryAttributeName,
+                                                                            String queryValue,
+                                                                            String requestType) {
+        long startTime = System.currentTimeMillis ();
+        msoLogger.debug ("Get list of infra requests from DB with " + queryAttributeName + " = " + queryValue);
+
+        Session session = HibernateUtil.getSessionFactory ().openSession ();
+        try {
+            session.beginTransaction ();
+            Criteria crit = session.createCriteria (InfraActiveRequests.class)
+                    .add (Restrictions.eq (queryAttributeName, queryValue));
+            crit.add (Restrictions.eqOrIsNull (REQUEST_TYPE, requestType));
+            crit.addOrder (Order.desc (START_TIME));
+            crit.addOrder (Order.asc (SOURCE));
+
+            @SuppressWarnings("unchecked")
+            List <InfraActiveRequests> arList = crit.list ();
+            if (arList != null && !arList.isEmpty ()) {
+                return arList;
+            }
+        } finally {
+            if (session != null && session.isOpen ()) {
+                session.close ();
+            }
+           // msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "getRequestListFromInfraActive", null);
+        }
+        return null;
+    }
+
+
+    public static InfraActiveRequests getRequestFromInfraActive (String requestId, String requestType) {
+        long startTime = System.currentTimeMillis ();
+        msoLogger.debug ("Get infra request from DB with id " + requestId);
+
+        Session session = HibernateUtil.getSessionFactory ().openSession ();
+        InfraActiveRequests ar = null;
+        try {
+            session.beginTransaction ();
+            Query query = session.createQuery ("from InfraActiveRequests where (requestId = :requestId OR clientRequestId = :requestId) and requestType = :requestType");
+            query.setParameter (REQUEST_ID, requestId);
+            query.setParameter (REQUEST_TYPE, requestType);
+            ar = (InfraActiveRequests) query.uniqueResult ();
+        } finally {
+            if (session != null && session.isOpen ()) {
+                session.close ();
+            }
+            msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "getRequestFromInfraActive", null);
+        }
+        return ar;
+    }
+
+
+    public static InfraActiveRequests checkDuplicateByVnfName (String vnfName, String action, String requestType) {
+
+        long startTime = System.currentTimeMillis ();
+        msoLogger.debug ("Get infra request from DB for VNF " + vnfName + " and action " + action + " and requestType " + requestType);
+
+        InfraActiveRequests ar = null;
+        Session session = HibernateUtil.getSessionFactory ().openSession ();
+
+        try {
+            session.beginTransaction ();
+            Query query = session.createQuery ("from InfraActiveRequests where vnfName = :vnfName and action = :action and (requestStatus = 'PENDING' or requestStatus = 'IN_PROGRESS' or requestStatus = 'TIMEOUT') and requestType = :requestType ORDER BY startTime DESC");
+            query.setParameter ("vnfName", vnfName);
+            query.setParameter ("action", action);
+            query.setParameter (REQUEST_TYPE, requestType);
+            @SuppressWarnings("unchecked")
+            List <InfraActiveRequests> results = query.list ();
+            if (!results.isEmpty ()) {
+                ar = results.get (0);
+            }
+        } finally {
+            if (session != null && session.isOpen ()) {
+                session.close ();
+            }
+            msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "checkDuplicateByVnfName", null);
+        }
+
+        return ar;
+    }
+
+    public static InfraActiveRequests checkDuplicateByVnfId (String vnfId, String action, String requestType) {
+
+        long startTime = System.currentTimeMillis ();
+        msoLogger.debug ("Get list of infra requests from DB for VNF " + vnfId + " and action " + action);
+
+        InfraActiveRequests ar = null;
+        Session session = HibernateUtil.getSessionFactory ().openSession ();
+
+        try {
+            session.beginTransaction ();
+            Query query = session.createQuery ("from InfraActiveRequests where vnfId = :vnfId and action = :action and (requestStatus = 'PENDING' or requestStatus = 'IN_PROGRESS' or requestStatus = 'TIMEOUT') and requestType = :requestType ORDER BY startTime DESC");
+            query.setParameter ("vnfId", vnfId);
+            query.setParameter ("action", action);
+            query.setParameter (REQUEST_TYPE, requestType);
+            @SuppressWarnings("unchecked")
+            List <InfraActiveRequests> results = query.list ();
+            if (!results.isEmpty ()) {
+                ar = results.get (0);
+            }
+        } finally {
+            if (session != null && session.isOpen ()) {
+                session.close ();
+            }
+            msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "checkDuplicateByVnfId", null);
+        }
+
+        return ar;
+    }
+
+    public static void setMockDB(MockRequestsDatabase mockDB) {
+        RequestsDatabase.mockDB = mockDB;
+    }
+
+    /**
+     * Fetch a specific SiteStatus by SiteName.
+     *
+     * @param siteName The unique name of the site
+     * @return SiteStatus object or null if none found
+     */
+    public static SiteStatus getSiteStatus (String siteName) {
+        Session session = HibernateUtil.getSessionFactory ().openSession ();
+
+        long startTime = System.currentTimeMillis ();
+        SiteStatus siteStatus = null;
+        msoLogger.debug ("Request database - get Site Status with Site name:" + siteName);
+        try {
+            String hql = "FROM SiteStatus WHERE siteName = :site_name";
+            Query query = session.createQuery (hql);
+            query.setParameter ("site_name", siteName);
+
+            siteStatus = (SiteStatus) query.uniqueResult ();
+        } finally {
+            if (session != null && session.isOpen ()) {
+                session.close ();
+            }
+            msoLogger.debug ("getSiteStatus - Successfully: " + siteStatus);
+        }
+        return siteStatus;
+    }
+
+    /**
+     * Fetch a specific SiteStatus by SiteName.
+     *
+     * @param siteName The unique name of the site
+     * @param status The updated status of the Site
+     */
+    public static void updateSiteStatus (String siteName, boolean status) {
+        Session session = HibernateUtil.getSessionFactory ().openSession ();
+        session.beginTransaction ();
+
+        long startTime = System.currentTimeMillis ();
+        msoLogger.debug ("Request database - save Site Status with Site name:" + siteName);
+        try {
+            String hql = "FROM SiteStatus WHERE siteName = :site_name";
+            Query query = session.createQuery (hql);
+            query.setParameter ("site_name", siteName);
+
+            SiteStatus siteStatus = (SiteStatus) query.uniqueResult ();
+            if (siteStatus == null) {
+                siteStatus = new SiteStatus ();
+                siteStatus.setSiteName (siteName);
+                siteStatus.setStatus (status);
+                //siteStatus.setCreated(new Timestamp(new Date().getTime()));
+                session.save (siteStatus);
+            } else {
+                siteStatus.setStatus(status);
+                //siteStatus.setCreated(new Timestamp(new Date().getTime()));
+                session.merge (siteStatus);
+            }
+            session.getTransaction ().commit ();
+        } finally {
+            if (session != null && session.isOpen ()) {
+                session.close ();
+            }
+            msoLogger.recordMetricEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "RequestDB", "updateSiteStatus", null);
+        }
+    }
+
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/SiteStatus.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/SiteStatus.java
new file mode 100644
index 0000000..4218096
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/SiteStatus.java
@@ -0,0 +1,72 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * 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.openecomp.mso.requestsdb;
+
+
+import org.openecomp.mso.logger.MsoLogger;
+
+import java.sql.Timestamp;
+
+
+public class SiteStatus {
+
+    private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.GENERAL);
+
+    private boolean status;
+    private String siteName;
+    private Timestamp created;
+
+    public SiteStatus() {
+    }
+
+    public Timestamp getCreated() {
+        return created;
+    }
+
+    public void setCreated(Timestamp created) {
+        this.created = created;
+    }
+
+    public String getSiteName() {
+        return siteName;
+    }
+
+    public void setSiteName(String siteName) {
+        this.siteName = siteName;
+    }
+
+    public void setStatus(boolean status) {
+        this.status = status;
+    }
+
+    public boolean getStatus() {
+        return status;
+    }
+
+    @Override
+    public String toString() {
+        return "SiteStatus{" +
+                "status=" + status +
+                ", siteName='" + siteName + '\'' +
+                ", created=" + created +
+                '}';
+    }
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapter.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapter.java
new file mode 100644
index 0000000..1e3f46d
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapter.java
@@ -0,0 +1,42 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * 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.openecomp.mso.requestsdb.adapter;
+
+
+import java.sql.Timestamp;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+public class TimestampXMLAdapter extends XmlAdapter <Long, Timestamp> {
+
+    @Override
+    public Long marshal (Timestamp v) throws Exception {
+        return v.getTime ();
+    }
+
+    @Override
+    public Timestamp unmarshal (Long v) throws Exception {
+        if (v == null) {
+            return new Timestamp(0);
+        }
+        return new Timestamp (v);
+    }
+}
diff --git a/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/package-info.java b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/package-info.java
new file mode 100644
index 0000000..542d711
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/java/org/openecomp/mso/requestsdb/adapter/package-info.java
@@ -0,0 +1,26 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - MSO
+ * ================================================================================
+ * 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=========================================================
+ */
+
+/**
+ * XML adapters.
+ */
+
+package org.openecomp.mso.requestsdb.adapter;
+
diff --git a/mso-api-handlers/mso-requests-db/src/main/resources/InfraActiveRequests.hbm.xml b/mso-api-handlers/mso-requests-db/src/main/resources/InfraActiveRequests.hbm.xml
new file mode 100644
index 0000000..b98177a
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/resources/InfraActiveRequests.hbm.xml
@@ -0,0 +1,146 @@
+<?xml version="1.0"?>
+<!--
+  ============LICENSE_START=======================================================
+  ECOMP MSO
+  ================================================================================
+  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=========================================================
+  -->
+
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<!-- Generated Jul 27, 2015 3:05:00 PM by Hibernate Tools 3.4.0.CR1 -->
+<hibernate-mapping>
+    <class name="org.openecomp.mso.requestsdb.InfraActiveRequests" table="INFRA_ACTIVE_REQUESTS">
+        <id name="requestId" type="string">
+            <column name="REQUEST_ID" length="45"/>
+            <generator class="assigned"/>
+        </id>
+        <property name="clientRequestId" type="string" unique="true">
+            <column name="CLIENT_REQUEST_ID" length="45" unique="true"/>
+        </property>
+        <property name="action" type="string">
+            <column name="ACTION" length="45" not-null="true"/>
+        </property>
+        <property name="requestStatus" type="string">
+            <column name="REQUEST_STATUS" length="20"/>
+        </property>
+        <property name="statusMessage" type="string">
+            <column name="STATUS_MESSAGE" length="2000"/>
+        </property>
+        <property name="progress" type="java.lang.Long">
+            <column name="PROGRESS" precision="11" scale="0"/>
+        </property>
+        <property name="startTime" type="timestamp">
+            <column name="START_TIME"/>
+        </property>
+        <property name="endTime" type="timestamp">
+            <column name="END_TIME"/>
+        </property>
+        <property name="source" type="string">
+            <column name="SOURCE" length="45"/>
+        </property>
+        <property name="vnfId" type="string">
+            <column name="VNF_ID" length="45"/>
+        </property>
+        <property name="vnfName" type="string">
+            <column name="VNF_NAME" length="80"/>
+        </property>
+        <property name="vnfType" type="string">
+            <column name="VNF_TYPE" length="200"/>
+        </property>
+        <property name="serviceType" type="string">
+            <column name="SERVICE_TYPE" length="45"/>
+        </property>
+        <property name="aicNodeClli" type="string">
+            <column name="AIC_NODE_CLLI" length="11"/>
+        </property>
+        <property name="tenantId" type="string">
+            <column name="TENANT_ID" length="45"/>
+        </property>
+        <property name="provStatus" type="string">
+            <column name="PROV_STATUS" length="20"/>
+        </property>
+        <property name="vnfParams" type="text">
+            <column name="VNF_PARAMS"/>
+        </property>
+        <property name="vnfOutputs" type="text">
+            <column name="VNF_OUTPUTS"/>
+        </property>
+        <property name="requestBody" type="text">
+            <column name="REQUEST_BODY"/>
+        </property>
+        <property name="responseBody" type="text">
+            <column name="RESPONSE_BODY"/>
+        </property>
+        <property name="lastModifiedBy" type="string">
+            <column name="LAST_MODIFIED_BY" length="50"/>
+        </property>
+        <property name="modifyTime" type="timestamp">
+            <column name="MODIFY_TIME"/>
+        </property>
+        <property name="requestType" type="string">
+            <column name="REQUEST_TYPE" length="20"/>
+        </property>
+        <property name="volumeGroupId" type="string">
+            <column name="VOLUME_GROUP_ID" length="45"/>
+        </property>
+        <property name="volumeGroupName" type="string">
+            <column name="VOLUME_GROUP_NAME" length="45"/>
+        </property>
+        <property name="vfModuleId" type="string">
+            <column name="VF_MODULE_ID" length="45"/>
+        </property>
+        <property name="vfModuleName" type="string">
+            <column name="VF_MODULE_NAME" length="200"/>
+        </property>
+        <property name="vfModuleModelName" type="string">
+            <column name="VF_MODULE_MODEL_NAME" length="200"/>
+        </property>
+         <property name="aaiServiceId" type="string">
+            <column name="AAI_SERVICE_ID" length="50"/>
+        </property>
+        <property name="aicCloudRegion" type="string">
+            <column name="AIC_CLOUD_REGION" length="11"/>
+        </property>
+        <property name="callBackUrl" type="string">
+            <column name="CALLBACK_URL" length="200"/>
+        </property>
+        <property name="correlator" type="string">
+            <column name="CORRELATOR" length="80"/>
+        </property>
+        <property name="serviceInstanceId" type="string">
+            <column name="SERVICE_INSTANCE_ID" length="45"/>
+        </property>
+        <property name="serviceInstanceName" type="string">
+            <column name="SERVICE_INSTANCE_NAME" length="80"/>
+        </property>
+        <property name="requestScope" type="string">
+            <column name="REQUEST_SCOPE" length="20"/>
+        </property>
+        <property name="requestAction" type="string">
+            <column name="REQUEST_ACTION" length="45" not-null="true"/>
+        </property>
+        <property name="networkId" type="string">
+            <column name="NETWORK_ID" length="45"/>
+        </property>
+        <property name="networkName" type="string">
+            <column name="NETWORK_NAME" length="80"/>
+        </property>
+        <property name="networkType" type="string">
+            <column name="NETWORK_TYPE" length="80"/>
+        </property>
+    </class>
+</hibernate-mapping>
diff --git a/mso-api-handlers/mso-requests-db/src/main/resources/SiteStatus.hbm.xml b/mso-api-handlers/mso-requests-db/src/main/resources/SiteStatus.hbm.xml
new file mode 100644
index 0000000..95ccfda
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/resources/SiteStatus.hbm.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ============LICENSE_START=======================================================
+  ECOMP MSO
+  ================================================================================
+  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=========================================================
+  -->
+
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping package="org.openecomp.mso.requestsdb">
+	<class name="SiteStatus" table="SITE_STATUS">
+		<meta attribute="class-description">
+			This class describes a Site Status
+		</meta>
+		
+		<id name="siteName" type="string" column="SITE_NAME"/>
+
+		<property name="status" column="STATUS" type="boolean" length="256"/>
+		<property name="created" column="CREATION_TIMESTAMP" type="timestamp" generated="insert" insert="false" update="false"/>
+	</class>
+</hibernate-mapping>
diff --git a/mso-api-handlers/mso-requests-db/src/main/resources/hibernate-mysql.cfg.xml b/mso-api-handlers/mso-requests-db/src/main/resources/hibernate-mysql.cfg.xml
new file mode 100644
index 0000000..531b771
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/resources/hibernate-mysql.cfg.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ============LICENSE_START=======================================================
+  ECOMP MSO
+  ================================================================================
+  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=========================================================
+  -->
+
+<!DOCTYPE hibernate-configuration PUBLIC
+		"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+		"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
+<hibernate-configuration>
+    <session-factory>
+        <property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>
+        <property name="hibernate.show_sql">false</property>
+        <property name="hibernate.format_sql">true</property>
+        <property name="connection.datasource">java:jboss/datasources/mso-requests</property>
+		
+<!-- 		<property name="hibernate.hbm2ddl.auto">create</property> -->
+
+        <mapping resource="InfraActiveRequests.hbm.xml"></mapping>
+        <mapping resource="SiteStatus.hbm.xml"></mapping>
+    </session-factory>
+</hibernate-configuration>
diff --git a/mso-api-handlers/mso-requests-db/src/main/resources/hibernate-requests-ajsc.cfg.xml b/mso-api-handlers/mso-requests-db/src/main/resources/hibernate-requests-ajsc.cfg.xml
new file mode 100644
index 0000000..14bd7b5
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/main/resources/hibernate-requests-ajsc.cfg.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ============LICENSE_START=======================================================
+  ECOMP MSO
+  ================================================================================
+  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=========================================================
+  -->
+
+<!DOCTYPE hibernate-configuration PUBLIC
+		"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+		"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
+<hibernate-configuration>
+	   <session-factory>
+        <property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>
+        <property name="hibernate.show_sql">false</property>
+        <property name="hibernate.format_sql">true</property>
+
+        <mapping resource="InfraActiveRequests.hbm.xml"></mapping>
+        <mapping resource="SiteStatus.hbm.xml"></mapping>
+       </session-factory>
+     <!-- <session-factory name="MSORequestsFactory">
+      	<property name="connection.url">${REQUESTS_CONNECTION_URL}</property>
+        <property name="connection.username">${REQUESTS_USERNAME}</property>
+        <property name="connection.password">${REQUESTS_PASSWORD}</property>
+        <property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>
+        <property name="hibernate.default_schema">mso_requests</property>
+        <property name="connection.driver_class">org.mariadb.jdbc.Driver</property>
+        <property name="hibernate.current_session_context_class">thread</property>
+        <property name="hibernate.show_sql">false</property>
+        <property name="hibernate.format_sql">true</property>    
+
+         
+        <property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property> 
+		<property name="hibernate.c3p0.min_size">${REQUESTS_MIN_POOL_SIZE}</property> 
+		<property name="hibernate.c3p0.max_size">${REQUESTS_MAX_POOL_SIZE}</property> 
+		<property name="hibernate.c3p0.timeout">${REQUESTS_TIMEOUT}</property> 
+		<property name="hibernate.c3p0.max_statements">50</property> 
+		<property name="hibernate.c3p0.idle_test_period">1000</property> 
+		<property name="hibernate.connection.provider_class">org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider</property> 
+		
+  
+
+        <mapping resource="InfraActiveRequests.hbm.xml"></mapping>     
+
+    </session-factory> -->
+</hibernate-configuration>
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/HibernateUtilESTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/HibernateUtilESTest.java
new file mode 100644
index 0000000..6ae0a64
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/HibernateUtilESTest.java
@@ -0,0 +1,24 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Wed Dec 14 15:15:07 GMT 2016
+ */
+
+package org.openecomp.mso.requestsdb;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.evosuite.runtime.PrivateAccess;
+import org.junit.runner.RunWith;
+import org.openecomp.mso.requestsdb.HibernateUtil;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class HibernateUtilESTest extends HibernateUtilESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test0()  throws Throwable  {
+      HibernateUtil hibernateUtil0 = (HibernateUtil)PrivateAccess.callDefaultConstructorOfTheClassUnderTest();
+      assertNotNull(hibernateUtil0);
+  }
+}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/HibernateUtilESTestscaffolding.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/HibernateUtilESTestscaffolding.java
new file mode 100644
index 0000000..e2e9b60
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/HibernateUtilESTestscaffolding.java
@@ -0,0 +1,107 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Wed Dec 14 15:15:07 GMT 2016
+ */
+
+package org.openecomp.mso.requestsdb;
+
+import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
+import org.junit.BeforeClass;
+import org.junit.Before;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.evosuite.runtime.sandbox.Sandbox;
+import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
+
+@EvoSuiteClassExclude
+public class HibernateUtilESTestscaffolding {
+
+  @org.junit.Rule 
+  public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
+
+  private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); 
+
+  private org.evosuite.runtime.thread.ThreadStopper threadStopper =  new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
+
+  @BeforeClass 
+  public static void initEvoSuiteFramework() { 
+    org.evosuite.runtime.RuntimeSettings.className = "org.openecomp.mso.requestsdb.HibernateUtil"; 
+    org.evosuite.runtime.GuiSupport.initialize(); 
+    org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; 
+    org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; 
+    org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; 
+    org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; 
+    org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); 
+    org.evosuite.runtime.classhandling.JDKClassResetter.init(); 
+    initializeClasses();
+    org.evosuite.runtime.Runtime.getInstance().resetRuntime(); 
+  } 
+
+  @AfterClass 
+  public static void clearEvoSuiteFramework(){ 
+    Sandbox.resetDefaultSecurityManager(); 
+    java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); 
+  } 
+
+  @Before 
+  public void initTestCase(){ 
+    threadStopper.storeCurrentThreads();
+    threadStopper.startRecordingTime();
+    org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); 
+    org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); 
+    org.evosuite.runtime.GuiSupport.setHeadless(); 
+    org.evosuite.runtime.Runtime.getInstance().resetRuntime(); 
+    org.evosuite.runtime.agent.InstrumentingAgent.activate(); 
+  } 
+
+  @After 
+  public void doneWithTestCase(){ 
+    threadStopper.killAndJoinClientThreads();
+    org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); 
+    org.evosuite.runtime.classhandling.JDKClassResetter.reset(); 
+    resetClasses(); 
+    org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); 
+    org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); 
+    org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); 
+  } 
+
+  private static void initializeClasses() {
+    org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(HibernateUtilESTestscaffolding.class.getClassLoader() ,
+      "org.openecomp.mso.logger.MessageEnum",
+      "com.att.eelf.i18n.EELFResolvableErrorEnum",
+      "org.openecomp.mso.logger.MsoLogger$Catalog",
+      "org.openecomp.mso.logger.MsoLogger$StatusCode",
+      "org.hibernate.SessionFactory",
+      "com.att.eelf.i18n.EELFResourceManager$RESOURCE_TYPES",
+      "com.att.eelf.configuration.EELFManager",
+      "com.att.eelf.configuration.EELFLogger",
+      "com.att.eelf.i18n.EELFMsgs",
+      "org.openecomp.mso.entity.MsoRequest",
+      "com.att.eelf.configuration.EELFLogger$Level",
+      "org.openecomp.mso.requestsdb.HibernateUtil",
+      "org.openecomp.mso.logger.MsoLogger$ResponseCode",
+      "com.att.eelf.configuration.SLF4jWrapper",
+      "com.att.eelf.i18n.EELFResourceManager",
+      "org.openecomp.mso.logger.MsoLogger",
+      "org.openecomp.mso.logger.MsoLogger$ErrorCode"
+    );
+  } 
+
+  private static void resetClasses() {
+    org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(HibernateUtilESTestscaffolding.class.getClassLoader()); 
+
+    org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
+      "com.att.eelf.i18n.EELFResourceManager",
+      "org.openecomp.mso.logger.MessageEnum",
+      "org.openecomp.mso.logger.MsoLogger$Catalog",
+      "org.openecomp.mso.logger.MsoLogger",
+      "com.att.eelf.i18n.EELFMsgs",
+      "com.att.eelf.i18n.EELFResourceManager$RESOURCE_TYPES",
+      "com.att.eelf.configuration.EELFLogger$Level",
+      "com.att.eelf.configuration.EELFManager",
+      "org.openecomp.mso.logger.MsoLogger$ErrorCode",
+      "org.openecomp.mso.requestsdb.HibernateUtil"
+    );
+  }
+}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraActiveRequestsESTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraActiveRequestsESTest.java
new file mode 100644
index 0000000..96ed0be
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraActiveRequestsESTest.java
@@ -0,0 +1,29 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Wed Dec 14 15:13:40 GMT 2016
+ */
+
+package org.openecomp.mso.requestsdb;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.junit.runner.RunWith;
+import org.openecomp.mso.requestsdb.InfraActiveRequests;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class InfraActiveRequestsESTest extends InfraActiveRequestsESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test0()  throws Throwable  {
+      InfraActiveRequests infraActiveRequests0 = new InfraActiveRequests();
+      assertNull(infraActiveRequests0.getVolumeGroupId());
+  }
+
+  @Test(timeout = 4000)
+  public void test1()  throws Throwable  {
+      InfraActiveRequests infraActiveRequests0 = new InfraActiveRequests("#)r", "#)r");
+      assertNull(infraActiveRequests0.getNetworkName());
+  }
+}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraActiveRequestsESTestscaffolding.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraActiveRequestsESTestscaffolding.java
new file mode 100644
index 0000000..012b17a
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraActiveRequestsESTestscaffolding.java
@@ -0,0 +1,84 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Wed Dec 14 15:13:40 GMT 2016
+ */
+
+package org.openecomp.mso.requestsdb;
+
+import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
+import org.junit.BeforeClass;
+import org.junit.Before;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.evosuite.runtime.sandbox.Sandbox;
+import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
+
+@EvoSuiteClassExclude
+public class InfraActiveRequestsESTestscaffolding {
+
+  @org.junit.Rule 
+  public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
+
+  private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); 
+
+  private org.evosuite.runtime.thread.ThreadStopper threadStopper =  new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
+
+  @BeforeClass 
+  public static void initEvoSuiteFramework() { 
+    org.evosuite.runtime.RuntimeSettings.className = "org.openecomp.mso.requestsdb.InfraActiveRequests"; 
+    org.evosuite.runtime.GuiSupport.initialize(); 
+    org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; 
+    org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; 
+    org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; 
+    org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; 
+    org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); 
+    org.evosuite.runtime.classhandling.JDKClassResetter.init(); 
+    initializeClasses();
+    org.evosuite.runtime.Runtime.getInstance().resetRuntime(); 
+  } 
+
+  @AfterClass 
+  public static void clearEvoSuiteFramework(){ 
+    Sandbox.resetDefaultSecurityManager(); 
+    java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); 
+  } 
+
+  @Before 
+  public void initTestCase(){ 
+    threadStopper.storeCurrentThreads();
+    threadStopper.startRecordingTime();
+    org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); 
+    org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); 
+    org.evosuite.runtime.GuiSupport.setHeadless(); 
+    org.evosuite.runtime.Runtime.getInstance().resetRuntime(); 
+    org.evosuite.runtime.agent.InstrumentingAgent.activate(); 
+  } 
+
+  @After 
+  public void doneWithTestCase(){ 
+    threadStopper.killAndJoinClientThreads();
+    org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); 
+    org.evosuite.runtime.classhandling.JDKClassResetter.reset(); 
+    resetClasses(); 
+    org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); 
+    org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); 
+    org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); 
+  } 
+
+  private static void initializeClasses() {
+    org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(InfraActiveRequestsESTestscaffolding.class.getClassLoader() ,
+      "org.openecomp.mso.requestsdb.InfraActiveRequests",
+      "org.openecomp.mso.requestsdb.InfraRequests"
+    );
+  } 
+
+  private static void resetClasses() {
+    org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(InfraActiveRequestsESTestscaffolding.class.getClassLoader()); 
+
+    org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
+      "org.openecomp.mso.requestsdb.InfraRequests",
+      "org.openecomp.mso.requestsdb.InfraActiveRequests"
+    );
+  }
+}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraRequestsESTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraRequestsESTest.java
new file mode 100644
index 0000000..e3f5710
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraRequestsESTest.java
@@ -0,0 +1,2029 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Wed Dec 14 15:15:48 GMT 2016
+ */
+
+package org.openecomp.mso.requestsdb;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+import static org.evosuite.runtime.EvoAssertions.*;
+import java.sql.Timestamp;
+import java.time.Clock;
+import java.time.DateTimeException;
+import java.time.Instant;
+import java.time.LocalDateTime;
+import java.time.Month;
+import java.time.ZoneId;
+import java.time.ZoneOffset;
+import java.time.temporal.ChronoUnit;
+import java.time.temporal.TemporalUnit;
+import java.time.temporal.UnsupportedTemporalTypeException;
+import java.util.Date;
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.evosuite.runtime.System;
+import org.evosuite.runtime.mock.java.net.MockURI;
+import org.evosuite.runtime.mock.java.time.MockClock;
+import org.evosuite.runtime.mock.java.time.MockInstant;
+import org.evosuite.runtime.mock.java.time.MockLocalDateTime;
+import org.evosuite.runtime.mock.java.util.MockDate;
+import org.junit.runner.RunWith;
+import org.openecomp.mso.requestsdb.InfraRequests;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class InfraRequestsESTest extends InfraRequestsESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test000()  throws Throwable  {
+      System.setCurrentTimeMillis(0L);
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setRequestStatus("org.openecomp.mso.requestsdb.InfraRequests");
+      Instant instant0 = MockInstant.ofEpochSecond((-1L));
+      Timestamp timestamp0 = Timestamp.from(instant0);
+      infraRequests0.setModifyTime(timestamp0);
+      infraRequests0.setTenantId("7z3rvWw}>");
+      infraRequests0.setVnfParams("7z3rvWw}>");
+      infraRequests0.setVfModuleModelName("H(+:J_^eh02J");
+      InfraRequests infraRequests1 = new InfraRequests("", "zCyMQj^e");
+      infraRequests1.setProvStatus("7z3rvWw}>");
+      infraRequests1.getProgress();
+      infraRequests0.setProgress((Long) null);
+      infraRequests0.setRequestId("");
+      infraRequests0.getStartTime();
+      Timestamp timestamp1 = infraRequests0.getModifyTime();
+      infraRequests0.getEndTime();
+      Timestamp timestamp2 = infraRequests0.getModifyTime();
+      assertSame(timestamp2, timestamp1);
+  }
+
+  @Test(timeout = 4000)
+  public void test001()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("&^pJug .NI><P", "&^pJug .NI><P");
+      infraRequests0.setNetworkType("jxNkugb+TFTHEb");
+      infraRequests0.setVfModuleName("&^pJug .NI><P");
+      Timestamp timestamp0 = new Timestamp(0L);
+      timestamp0.toLocalDateTime();
+      timestamp0.clone();
+      infraRequests0.setStartTime(timestamp0);
+      infraRequests0.setVolumeGroupName("&^pJug .NI><P");
+      infraRequests0.setRequestAction(" g)]V!'`TH5O");
+      infraRequests0.setServiceInstanceId("DfLF%$Jbfi.Q31<");
+      infraRequests0.getStartTime();
+      infraRequests0.getStartTime();
+      infraRequests0.setAicCloudRegion("sz.!~p3obl/");
+      infraRequests0.setClientRequestId("sz.!~p3obl/");
+      infraRequests0.setVnfParams((String) null);
+      infraRequests0.getEndTime();
+      infraRequests0.getStartTime();
+      infraRequests0.getStartTime();
+      infraRequests0.getEndTime();
+      infraRequests0.getModifyTime();
+      infraRequests0.getModifyTime();
+      Timestamp timestamp1 = infraRequests0.getEndTime();
+      assertNull(timestamp1);
+  }
+
+  @Test(timeout = 4000)
+  public void test002()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      Timestamp timestamp0 = new Timestamp(153L);
+      Instant instant0 = timestamp0.toInstant();
+      Timestamp timestamp1 = Timestamp.from(instant0);
+      infraRequests0.setStartTime(timestamp1);
+      Timestamp timestamp2 = infraRequests0.getStartTime();
+      assertNotSame(timestamp2, timestamp0);
+  }
+
+  @Test(timeout = 4000)
+  public void test003()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("", "");
+      Timestamp timestamp0 = new Timestamp((-1852L));
+      infraRequests0.setEndTime(timestamp0);
+      Timestamp timestamp1 = infraRequests0.getEndTime();
+      assertEquals(148000000, timestamp1.getNanos());
+  }
+
+  @Test(timeout = 4000)
+  public void test004()  throws Throwable  {
+      System.setCurrentTimeMillis(0L);
+      InfraRequests infraRequests0 = new InfraRequests((String) null, (String) null);
+      infraRequests0.setAction("");
+      infraRequests0.setLastModifiedBy("et'?MxG");
+      infraRequests0.setSource((String) null);
+      infraRequests0.setRequestStatus("i>Ckz=#\"! &-");
+      infraRequests0.setVnfName((String) null);
+      infraRequests0.setRequestBody("");
+      infraRequests0.setProvStatus("");
+      infraRequests0.setRequestBody((String) null);
+      infraRequests0.setAicCloudRegion("m&WTLl(Z@56C");
+      infraRequests0.getNetworkId();
+      infraRequests0.setNetworkId("zcYzTK3rhfL`Cw");
+      infraRequests0.getStartTime();
+      System.setCurrentTimeMillis(2579L);
+      infraRequests0.getModifyTime();
+      infraRequests0.getStartTime();
+      infraRequests0.setAicCloudRegion("=o7|rLO^");
+      infraRequests0.getEndTime();
+      infraRequests0.getEndTime();
+      infraRequests0.getNetworkId();
+      System.setCurrentTimeMillis(0L);
+      System.setCurrentTimeMillis(0L);
+      infraRequests0.getStartTime();
+      infraRequests0.getSource();
+      String string0 = infraRequests0.getNetworkId();
+      assertEquals("zcYzTK3rhfL`Cw", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test005()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      Long long0 = new Long(1283L);
+      infraRequests0.setProvStatus("'4~OJS*DL/lP");
+      Long.sum((-978L), 1283L);
+      infraRequests0.setProgress(long0);
+      infraRequests0.setServiceInstanceName("'4~OJS*DL/lP");
+      infraRequests0.getSource();
+      infraRequests0.setRequestId("");
+      infraRequests0.getSource();
+      infraRequests0.setVnfParams((String) null);
+      infraRequests0.getNetworkId();
+      infraRequests0.getEndTime();
+      infraRequests0.getNetworkId();
+      infraRequests0.getModifyTime();
+      infraRequests0.getProgress();
+      infraRequests0.getSource();
+      infraRequests0.getModifyTime();
+      infraRequests0.getNetworkId();
+      infraRequests0.getSource();
+      infraRequests0.getModifyTime();
+      infraRequests0.getEndTime();
+      infraRequests0.getEndTime();
+      infraRequests0.getModifyTime();
+      infraRequests0.getProgress();
+      infraRequests0.getProgress();
+      Timestamp timestamp0 = infraRequests0.getStartTime();
+      assertNull(timestamp0);
+  }
+
+  @Test(timeout = 4000)
+  public void test006()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.getEndTime();
+      infraRequests0.setVfModuleModelName("");
+      infraRequests0.setVfModuleId("");
+      infraRequests0.getStartTime();
+      infraRequests0.getVfModuleModelName();
+      infraRequests0.getSource();
+      infraRequests0.setVfModuleModelName("");
+      infraRequests0.setAction("");
+      infraRequests0.setVnfType("32ex<U{");
+      infraRequests0.setVfModuleId("~!_Y!cPw*c_>H$");
+      infraRequests0.getModifyTime();
+      System.setCurrentTimeMillis(0L);
+      infraRequests0.getEndTime();
+      infraRequests0.setRequestStatus("");
+      infraRequests0.setServiceInstanceName("");
+      infraRequests0.getStartTime();
+      infraRequests0.getVfModuleModelName();
+      infraRequests0.setVolumeGroupName("");
+      infraRequests0.getProgress();
+      infraRequests0.setProvStatus("");
+      System.setCurrentTimeMillis(0L);
+      infraRequests0.getStartTime();
+      System.setCurrentTimeMillis(0L);
+      infraRequests0.getVfModuleModelName();
+      infraRequests0.getNetworkId();
+      infraRequests0.getNetworkId();
+      infraRequests0.getVfModuleModelName();
+      System.setCurrentTimeMillis(0L);
+      infraRequests0.getProgress();
+      Timestamp timestamp0 = infraRequests0.getStartTime();
+      assertNull(timestamp0);
+  }
+
+  @Test(timeout = 4000)
+  public void test007()  throws Throwable  {
+      System.setCurrentTimeMillis((-2047L));
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setVolumeGroupName("k*}2I)_;C'i,[i>aRNU");
+      infraRequests0.setSource("%az=");
+      infraRequests0.getModifyTime();
+      infraRequests0.setRequestAction("");
+      infraRequests0.setClientRequestId("");
+      infraRequests0.setAicNodeClli("");
+      infraRequests0.setCallBackUrl("");
+      infraRequests0.setAction("");
+      infraRequests0.getNetworkId();
+      infraRequests0.getNetworkId();
+      infraRequests0.getProgress();
+      infraRequests0.getProgress();
+      infraRequests0.getNetworkId();
+      infraRequests0.getProgress();
+      infraRequests0.getModifyTime();
+      infraRequests0.setRequestScope("URuw\"b-");
+      infraRequests0.setNetworkName("");
+      infraRequests0.getStartTime();
+      infraRequests0.getAicNodeClli();
+      infraRequests0.getProgress();
+      infraRequests0.setCallBackUrl("");
+      infraRequests0.getEndTime();
+      infraRequests0.setVnfId("");
+      infraRequests0.getProgress();
+      infraRequests0.getNetworkId();
+      Long long0 = infraRequests0.getProgress();
+      assertNull(long0);
+  }
+
+  @Test(timeout = 4000)
+  public void test008()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests((String) null, (String) null);
+      infraRequests0.setClientRequestId((String) null);
+      infraRequests0.setVfModuleModelName((String) null);
+      Long long0 = new Long((-43L));
+      Long.compare((-1L), 0L);
+      Long.compare(819L, (-43L));
+      infraRequests0.setProgress(long0);
+      infraRequests0.getModifyTime();
+      infraRequests0.getStartTime();
+      infraRequests0.setAction("");
+      infraRequests0.getSource();
+      infraRequests0.getSource();
+      infraRequests0.getStartTime();
+      infraRequests0.setNetworkId((String) null);
+      infraRequests0.getNetworkId();
+      Long long1 = infraRequests0.getProgress();
+      assertEquals((-43L), (long)long1);
+  }
+
+  @Test(timeout = 4000)
+  public void test009()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.getStartTime();
+      infraRequests0.setRequestScope("");
+      System.setCurrentTimeMillis(0L);
+      infraRequests0.setVnfType("");
+      infraRequests0.setProvStatus("");
+      infraRequests0.setRequestScope("LB1xoi:3Wz.5'5uxZ");
+      infraRequests0.setVfModuleId("+x66Ol");
+      infraRequests0.setVfModuleModelName("org.openecomp.mso.requestsdb.InfraRequests");
+      infraRequests0.setVnfOutputs("LB1xoi:3Wz.5'5uxZ");
+      infraRequests0.setCorrelator("{%N>'KCKdC");
+      infraRequests0.getEndTime();
+      infraRequests0.getVfModuleModelName();
+      infraRequests0.getSource();
+      infraRequests0.getStartTime();
+      infraRequests0.getNetworkId();
+      infraRequests0.setRequestBody("jBcy6j^");
+      infraRequests0.setAaiServiceId("m,{Gy9PQsY5J/aU!uX");
+      infraRequests0.setVolumeGroupId("");
+      infraRequests0.getEndTime();
+      infraRequests0.getEndTime();
+      infraRequests0.getVfModuleId();
+      infraRequests0.getModifyTime();
+      infraRequests0.getEndTime();
+      infraRequests0.getModifyTime();
+      String string0 = infraRequests0.getSource();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test010()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.getVfModuleId();
+      infraRequests0.getEndTime();
+      infraRequests0.setVfModuleId((String) null);
+      infraRequests0.setServiceType("");
+      infraRequests0.getModifyTime();
+      infraRequests0.getAicNodeClli();
+      infraRequests0.setAaiServiceId((String) null);
+      infraRequests0.getVfModuleModelName();
+      infraRequests0.getVfModuleId();
+      infraRequests0.getEndTime();
+      infraRequests0.setVfModuleModelName((String) null);
+      infraRequests0.getModifyTime();
+      infraRequests0.getVfModuleModelName();
+      infraRequests0.getEndTime();
+      infraRequests0.setVnfName((String) null);
+      infraRequests0.getVfModuleId();
+      infraRequests0.getAicNodeClli();
+      infraRequests0.getAicNodeClli();
+      infraRequests0.getNetworkId();
+      infraRequests0.getVfModuleId();
+      infraRequests0.getSource();
+      infraRequests0.getAicNodeClli();
+      infraRequests0.getSource();
+      infraRequests0.getServiceType();
+      infraRequests0.getModifyTime();
+      String string0 = infraRequests0.getVfModuleId();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test011()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setVnfName("s4 -bpK");
+      infraRequests0.setLastModifiedBy("");
+      infraRequests0.getProgress();
+      infraRequests0.getServiceType();
+      infraRequests0.setVfModuleName((String) null);
+      infraRequests0.setVnfName("");
+      infraRequests0.setVnfType("");
+      infraRequests0.getVfModuleId();
+      infraRequests0.setResponseBody("");
+      infraRequests0.getStartTime();
+      infraRequests0.setStartTime((Timestamp) null);
+      infraRequests0.setCorrelator("");
+      infraRequests0.getVnfType();
+      infraRequests0.getNetworkId();
+      infraRequests0.setServiceInstanceId("");
+      infraRequests0.getProgress();
+      infraRequests0.getAicNodeClli();
+      infraRequests0.getNetworkId();
+      infraRequests0.setCorrelator((String) null);
+      infraRequests0.getNetworkId();
+      infraRequests0.getVnfType();
+      infraRequests0.getVfModuleModelName();
+      infraRequests0.getAicNodeClli();
+      infraRequests0.setVnfName("");
+      System.setCurrentTimeMillis((-1L));
+      infraRequests0.setProvStatus("");
+      infraRequests0.getVfModuleId();
+      infraRequests0.getSource();
+      infraRequests0.getAicNodeClli();
+      String string0 = infraRequests0.getServiceType();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test012()  throws Throwable  {
+      System.setCurrentTimeMillis(1L);
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setEndTime((Timestamp) null);
+      infraRequests0.setTenantId("");
+      infraRequests0.setRequestStatus("");
+      infraRequests0.setClientRequestId("");
+      infraRequests0.setAction("");
+      infraRequests0.setCorrelator("");
+      infraRequests0.setAicNodeClli("");
+      infraRequests0.getVnfParams();
+      System.setCurrentTimeMillis(1L);
+      infraRequests0.setVolumeGroupName("");
+      infraRequests0.setVfModuleId((String) null);
+      infraRequests0.setVnfParams("");
+      infraRequests0.getSource();
+      infraRequests0.getVfModuleModelName();
+      infraRequests0.getSource();
+      infraRequests0.getVnfParams();
+      infraRequests0.getServiceType();
+      infraRequests0.setAaiServiceId("i`q1kSghF");
+      infraRequests0.setStatusMessage((String) null);
+      infraRequests0.getProgress();
+      infraRequests0.getModifyTime();
+      infraRequests0.getVnfType();
+      infraRequests0.getProgress();
+      infraRequests0.getServiceType();
+      String string0 = infraRequests0.getVfModuleId();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test013()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setRequestScope("");
+      infraRequests0.setAaiServiceId(")9?S*`\"0>k");
+      infraRequests0.getEndTime();
+      infraRequests0.setVolumeGroupName("");
+      infraRequests0.setServiceInstanceId("");
+      infraRequests0.getProgress();
+      infraRequests0.getRequestScope();
+      Long long0 = infraRequests0.getProgress();
+      assertNull(long0);
+  }
+
+  @Test(timeout = 4000)
+  public void test014()  throws Throwable  {
+      System.setCurrentTimeMillis(3986L);
+      InfraRequests infraRequests0 = new InfraRequests("", (String) null);
+      infraRequests0.setVnfName((String) null);
+      infraRequests0.getResponseBody();
+      infraRequests0.setAction((String) null);
+      infraRequests0.setCallBackUrl("(tW~,tC");
+      infraRequests0.setClientRequestId("$Y$nNqJ`e'KL#@v>:");
+      infraRequests0.setVolumeGroupId("mSK_k$P)79N/:l");
+      infraRequests0.setResponseBody("");
+      infraRequests0.setSource("(tW~,tC");
+      infraRequests0.setProvStatus((String) null);
+      infraRequests0.setVfModuleName("9");
+      infraRequests0.getServiceType();
+      infraRequests0.getVnfParams();
+      infraRequests0.getVnfType();
+      infraRequests0.getVnfParams();
+      infraRequests0.getStartTime();
+      infraRequests0.getVnfType();
+      infraRequests0.getStartTime();
+      infraRequests0.getSource();
+      infraRequests0.getVfModuleModelName();
+      infraRequests0.getStartTime();
+      infraRequests0.getAicNodeClli();
+      System.setCurrentTimeMillis((-1622L));
+      infraRequests0.getVfModuleModelName();
+      String string0 = infraRequests0.getResponseBody();
+      assertEquals("", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test015()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("wkT`'", "kMn9?");
+      infraRequests0.setVfModuleName("");
+      infraRequests0.setNetworkType("");
+      infraRequests0.getVfModuleModelName();
+      infraRequests0.setProvStatus("kMn9?");
+      infraRequests0.getRequestScope();
+      infraRequests0.setVfModuleModelName((String) null);
+      infraRequests0.setAicCloudRegion("wkT`'");
+      infraRequests0.setServiceInstanceName("7Stei0W{<@QDoE9~");
+      infraRequests0.setRequestAction("");
+      infraRequests0.getServiceType();
+      infraRequests0.getVnfParams();
+      infraRequests0.getAicNodeClli();
+      infraRequests0.getRequestScope();
+      infraRequests0.getNetworkType();
+      infraRequests0.getStartTime();
+      infraRequests0.getNetworkType();
+      infraRequests0.getStartTime();
+      infraRequests0.getRequestAction();
+      infraRequests0.setCorrelator("!5");
+      infraRequests0.getSource();
+      infraRequests0.getServiceType();
+      infraRequests0.getVfModuleModelName();
+      infraRequests0.getVnfParams();
+      infraRequests0.getModifyTime();
+      infraRequests0.getVnfParams();
+      infraRequests0.getProvStatus();
+      infraRequests0.getAicNodeClli();
+      infraRequests0.getVfModuleModelName();
+      assertEquals("wkT`'", infraRequests0.getRequestId());
+      assertEquals("kMn9?", infraRequests0.getAction());
+  }
+
+  @Test(timeout = 4000)
+  public void test016()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("", (String) null);
+      infraRequests0.setRequestId("");
+      infraRequests0.setVfModuleId("");
+      infraRequests0.setRequestScope("");
+      infraRequests0.setVfModuleId("");
+      infraRequests0.setSource((String) null);
+      infraRequests0.setClientRequestId("");
+      infraRequests0.setVnfName("3?/m3##");
+      infraRequests0.setVfModuleName("");
+      infraRequests0.setSource("y [b8^A,yt|auh|y");
+      infraRequests0.setRequestScope("y [b8^A,yt|auh|y");
+      infraRequests0.setClientRequestId("");
+      infraRequests0.getEndTime();
+      infraRequests0.setVolumeGroupName("r7szQIK?~Q");
+      infraRequests0.getRequestAction();
+      infraRequests0.getVfModuleModelName();
+      infraRequests0.setServiceInstanceId("y [b8^A,yt|auh|y");
+      infraRequests0.getServiceType();
+      infraRequests0.getNetworkType();
+      System.setCurrentTimeMillis(3509L);
+      infraRequests0.getClientRequestId();
+      infraRequests0.setTenantId((String) null);
+      infraRequests0.getVfModuleModelName();
+      infraRequests0.getVnfType();
+      infraRequests0.getVnfParams();
+      infraRequests0.getServiceType();
+      infraRequests0.getVnfParams();
+      String string0 = infraRequests0.getVfModuleModelName();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test017()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("", "");
+      LocalDateTime localDateTime0 = MockLocalDateTime.of(264, 1, 1, 0, 1, 0);
+      Timestamp timestamp0 = Timestamp.valueOf(localDateTime0);
+      infraRequests0.setEndTime(timestamp0);
+      infraRequests0.setServiceInstanceId("TmMT");
+      infraRequests0.setServiceInstanceName("");
+      infraRequests0.setAicNodeClli(";");
+      infraRequests0.setAicCloudRegion("");
+      infraRequests0.setAction("");
+      infraRequests0.setServiceInstanceId("");
+      infraRequests0.setAaiServiceId("");
+      infraRequests0.getVnfType();
+      infraRequests0.getSource();
+      infraRequests0.getVnfParams();
+      infraRequests0.getVfModuleId();
+      infraRequests0.getStartTime();
+      infraRequests0.getProvStatus();
+      infraRequests0.getServiceType();
+      infraRequests0.getProvStatus();
+      infraRequests0.getServiceType();
+      System.setCurrentTimeMillis(1);
+      infraRequests0.setVnfParams((String) null);
+      infraRequests0.getServiceInstanceName();
+      infraRequests0.getEndTime();
+      infraRequests0.setAicNodeClli((String) null);
+      infraRequests0.getNetworkType();
+      infraRequests0.getEndTime();
+      infraRequests0.getRequestScope();
+      System.setCurrentTimeMillis(0);
+  }
+
+  @Test(timeout = 4000)
+  public void test018()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setCorrelator("nBvp})-N}");
+      infraRequests0.setSource("dOe#{Gx#~I(,F)0(");
+      infraRequests0.setVnfId("");
+      infraRequests0.getVolumeGroupName();
+      infraRequests0.getCorrelator();
+      infraRequests0.getModifyTime();
+      infraRequests0.getRequestScope();
+      infraRequests0.getVfModuleModelName();
+      String string0 = infraRequests0.getProvStatus();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test019()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("HY7\"yA%CG", "");
+      infraRequests0.setVnfType("");
+      infraRequests0.setAicNodeClli("");
+      infraRequests0.setNetworkId("HY7\"yA%CG");
+      infraRequests0.setAicNodeClli("");
+      infraRequests0.getProgress();
+      infraRequests0.setProgress((Long) null);
+      infraRequests0.setServiceType("");
+      infraRequests0.setLastModifiedBy("");
+      infraRequests0.getRequestScope();
+      infraRequests0.getProvStatus();
+      infraRequests0.setVolumeGroupName((String) null);
+      infraRequests0.getLastModifiedBy();
+      infraRequests0.getProvStatus();
+      infraRequests0.setAicCloudRegion("");
+      infraRequests0.getRequestScope();
+      infraRequests0.getProvStatus();
+      assertEquals("HY7\"yA%CG", infraRequests0.getRequestId());
+      assertEquals("", infraRequests0.getAction());
+  }
+
+  @Test(timeout = 4000)
+  public void test020()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setRequestBody("");
+      infraRequests0.setTenantId("");
+      infraRequests0.setRequestType("");
+      infraRequests0.setCallBackUrl("");
+      infraRequests0.setRequestAction(">Q'MsuT`)ThP6");
+      infraRequests0.setVfModuleId("");
+      infraRequests0.setResponseBody("");
+      infraRequests0.getVnfName();
+      infraRequests0.getProgress();
+      infraRequests0.setVnfName("");
+      infraRequests0.getVfModuleModelName();
+      infraRequests0.setClientRequestId((String) null);
+      infraRequests0.getServiceType();
+      infraRequests0.getVfModuleId();
+      infraRequests0.getVnfName();
+      infraRequests0.getVfModuleModelName();
+      infraRequests0.getNetworkId();
+      infraRequests0.getRequestAction();
+      infraRequests0.getNetworkType();
+      infraRequests0.getCorrelator();
+      infraRequests0.setLastModifiedBy((String) null);
+      infraRequests0.getCorrelator();
+      infraRequests0.getNetworkId();
+      infraRequests0.getTenantId();
+      infraRequests0.getVolumeGroupName();
+      String string0 = infraRequests0.getVolumeGroupName();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test021()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.getNetworkId();
+      infraRequests0.setRequestAction((String) null);
+      Long long0 = new Long((-965L));
+      infraRequests0.setProgress(long0);
+      infraRequests0.getSource();
+      infraRequests0.setNetworkType("5K\u0002}.V3dm%yU_&r");
+      infraRequests0.setVnfOutputs("5K\u0002}.V3dm%yU_&r");
+      String string0 = infraRequests0.getVnfOutputs();
+      assertEquals("5K\u0002}.V3dm%yU_&r", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test022()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setRequestBody("");
+      infraRequests0.setNetworkName("K|it");
+      infraRequests0.setAction("hcA}j,");
+      infraRequests0.setLastModifiedBy("");
+      infraRequests0.getCallBackUrl();
+      infraRequests0.getVfModuleId();
+      infraRequests0.getRequestScope();
+      String string0 = infraRequests0.getRequestBody();
+      assertEquals("", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test023()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("0", "0");
+      infraRequests0.setNetworkType("0");
+      infraRequests0.getStatusMessage();
+      infraRequests0.getProvStatus();
+      infraRequests0.getVnfParams();
+      infraRequests0.getStatusMessage();
+      infraRequests0.setVfModuleName((String) null);
+      infraRequests0.getResponseBody();
+      infraRequests0.setStatusMessage("[3aRfG;XuP");
+      infraRequests0.setVolumeGroupId((String) null);
+      infraRequests0.setAction("");
+      infraRequests0.getEndTime();
+      infraRequests0.getStartTime();
+      infraRequests0.getServiceType();
+      infraRequests0.getResponseBody();
+      infraRequests0.getVfModuleId();
+      infraRequests0.getServiceInstanceName();
+      infraRequests0.getEndTime();
+      infraRequests0.getNetworkType();
+      infraRequests0.getVnfOutputs();
+      infraRequests0.getVnfType();
+      infraRequests0.getRequestScope();
+      infraRequests0.getStartTime();
+      infraRequests0.getRequestAction();
+      infraRequests0.getProgress();
+      infraRequests0.getLastModifiedBy();
+      infraRequests0.getStatusMessage();
+      infraRequests0.getVolumeGroupName();
+      infraRequests0.getVnfName();
+      System.setCurrentTimeMillis(1480L);
+      String string0 = infraRequests0.getVnfName();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test024()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setRequestType("2AfD]In8p;DK-]O`8}s");
+      infraRequests0.getClientRequestId();
+      infraRequests0.setClientRequestId((String) null);
+      infraRequests0.setResponseBody("2AfD]In8p;DK-]O`8}s");
+      infraRequests0.setAaiServiceId("2AfD]In8p;DK-]O`8}s");
+      infraRequests0.setRequestBody((String) null);
+      infraRequests0.setVfModuleId("");
+      Timestamp timestamp0 = new Timestamp(0L);
+      infraRequests0.setEndTime(timestamp0);
+      infraRequests0.setVfModuleModelName((String) null);
+      infraRequests0.getAicNodeClli();
+      infraRequests0.getAicNodeClli();
+      infraRequests0.setVnfName("}}xiNsZQ:D73z4dha");
+      Clock clock0 = MockClock.systemDefaultZone();
+      Timestamp timestamp1 = infraRequests0.getEndTime();
+      timestamp0.before(timestamp1);
+      Instant instant0 = MockInstant.now(clock0);
+      Instant instant1 = MockInstant.minusNanos(instant0, (-290L));
+      ChronoUnit chronoUnit0 = ChronoUnit.DECADES;
+      // Undeclared exception!
+      try { 
+        MockInstant.plus(instant1, 0L, (TemporalUnit) chronoUnit0);
+        fail("Expecting exception: UnsupportedTemporalTypeException");
+      
+      } catch(UnsupportedTemporalTypeException e) {
+         //
+         // Unsupported unit: Decades
+         //
+         verifyException("java.time.Instant", e);
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test025()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.getTenantId();
+      infraRequests0.setServiceType("");
+      infraRequests0.getModifyTime();
+      infraRequests0.setModifyTime((Timestamp) null);
+      infraRequests0.getClientRequestId();
+      infraRequests0.setVolumeGroupId((String) null);
+      infraRequests0.getRequestId();
+      infraRequests0.getVfModuleName();
+      infraRequests0.getServiceInstanceName();
+      infraRequests0.setNetworkId("");
+      infraRequests0.setNetworkName((String) null);
+      infraRequests0.getResponseBody();
+      infraRequests0.getNetworkId();
+      Timestamp timestamp0 = infraRequests0.getModifyTime();
+      assertNull(timestamp0);
+  }
+
+  @Test(timeout = 4000)
+  public void test026()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.getVolumeGroupName();
+      infraRequests0.setResponseBody(")Y?y`MhJSG>i");
+      infraRequests0.setVfModuleId((String) null);
+      infraRequests0.setRequestStatus((String) null);
+      infraRequests0.getResponseBody();
+      infraRequests0.setVnfOutputs("q+6_~:+S5N.3.Lge\"");
+      infraRequests0.setVfModuleModelName("q+6_~:+S5N.3.Lge\"");
+      infraRequests0.setSource("q+6_~:+S5N.3.Lge\"");
+      infraRequests0.setServiceInstanceName(")Y?y`MhJSG>i");
+      infraRequests0.getServiceType();
+      infraRequests0.getModifyTime();
+      infraRequests0.setNetworkName("YUNs`H&7xu@i2P/1_");
+      InfraRequests infraRequests1 = new InfraRequests();
+      infraRequests1.setVfModuleModelName("");
+      infraRequests1.setRequestStatus("org.openecomp.mso.requestsdb.InfraRequests");
+      infraRequests0.setRequestId("6A'N2)N@dyHD|PV");
+      infraRequests1.getNetworkType();
+      infraRequests0.getNetworkName();
+      infraRequests1.getLastModifiedBy();
+      infraRequests0.getRequestBody();
+      infraRequests1.setServiceInstanceId("");
+      infraRequests0.setServiceInstanceName(":fK$0REpUY");
+      assertEquals(")Y?y`MhJSG>i", infraRequests0.getResponseBody());
+  }
+
+  @Test(timeout = 4000)
+  public void test027()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setServiceType("i3b%q%2jvX");
+      infraRequests0.getServiceType();
+      infraRequests0.setClientRequestId("i3b%q%2jvX");
+      infraRequests0.setVnfId("");
+      infraRequests0.getSource();
+      ChronoUnit chronoUnit0 = ChronoUnit.NANOS;
+      // Undeclared exception!
+      try { 
+        MockInstant.plus((Instant) null, (-1L), (TemporalUnit) chronoUnit0);
+        fail("Expecting exception: NullPointerException");
+      
+      } catch(NullPointerException e) {
+         //
+         // no message in exception (getMessage() returned null)
+         //
+         verifyException("org.evosuite.runtime.mock.java.time.MockInstant", e);
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test028()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("org.openecomp.mso.requestsdb.InfraRequests", "");
+      infraRequests0.setRequestType("");
+      infraRequests0.setRequestBody("org.openecomp.mso.requestsdb.InfraRequests");
+      infraRequests0.setAction("");
+      infraRequests0.getVnfParams();
+      InfraRequests infraRequests1 = new InfraRequests();
+      infraRequests0.setVfModuleName((String) null);
+      infraRequests0.getVfModuleName();
+      infraRequests1.setVfModuleName("?ynVFwCW]h");
+      infraRequests0.setVnfParams("");
+      infraRequests1.setResponseBody((String) null);
+      infraRequests1.setLastModifiedBy((String) null);
+      infraRequests1.setClientRequestId("oCb )W1D3x;e}QaJ");
+      infraRequests0.setServiceInstanceName("");
+      infraRequests0.getVfModuleId();
+      infraRequests1.getClientRequestId();
+      infraRequests1.getModifyTime();
+      infraRequests0.setSource("org.openecomp.mso.requestsdb.InfraRequests");
+      infraRequests1.setVfModuleName("org.openecomp.mso.requestsdb.InfraRequests");
+      String string0 = infraRequests1.getAaiServiceId();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test029()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setServiceType("");
+      infraRequests0.setVfModuleModelName("QE|");
+      infraRequests0.setStatusMessage("/`_aGH,(,:O9e'");
+      infraRequests0.setStatusMessage("/`_aGH,(,:O9e'");
+      infraRequests0.setLastModifiedBy((String) null);
+      infraRequests0.setServiceInstanceName("QE|");
+      infraRequests0.setCallBackUrl("QE|");
+      infraRequests0.setCallBackUrl("QE|");
+      Long long0 = new Long(0L);
+      Long.getLong("/`_aGH,(,:O9e'", 0L);
+      Long.getLong("QE|", (Long) null);
+      infraRequests0.setProgress(long0);
+      infraRequests0.setVfModuleName("QE|");
+      infraRequests0.setSource("");
+      infraRequests0.setVfModuleId("QE|");
+      infraRequests0.setVolumeGroupId("");
+      infraRequests0.getTenantId();
+      infraRequests0.getClientRequestId();
+      String string0 = infraRequests0.getServiceInstanceName();
+      assertEquals("QE|", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test030()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.getResponseBody();
+      infraRequests0.setServiceInstanceName((String) null);
+      InfraRequests infraRequests1 = new InfraRequests((String) null, ";*MXO3Cx^<r~)I#t");
+      infraRequests1.setSource("H>f%;>>.T7]h8?L]*");
+      infraRequests1.setRequestScope((String) null);
+      infraRequests1.setNetworkName("");
+      infraRequests0.setRequestAction("FLknU%");
+      infraRequests1.setCallBackUrl("");
+      InfraRequests infraRequests2 = new InfraRequests(";*MXO3Cx^<r~)I#t", ";*MXO3Cx^<r~)I#t");
+      infraRequests2.setCorrelator("");
+      infraRequests1.getNetworkName();
+      infraRequests0.setRequestBody((String) null);
+      assertNull(infraRequests0.getRequestScope());
+  }
+
+  @Test(timeout = 4000)
+  public void test031()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.getNetworkId();
+      infraRequests0.setVfModuleModelName((String) null);
+      infraRequests0.setNetworkType((String) null);
+      infraRequests0.setAction((String) null);
+      infraRequests0.setVfModuleModelName("d@?@e`uVahW|y");
+      infraRequests0.setVolumeGroupName("$1");
+      infraRequests0.getResponseBody();
+      infraRequests0.getVnfParams();
+      infraRequests0.getRequestAction();
+      infraRequests0.setClientRequestId("N] J}ueWB9R)u");
+      infraRequests0.getVfModuleId();
+      infraRequests0.getNetworkType();
+      infraRequests0.getModifyTime();
+      infraRequests0.getNetworkId();
+      infraRequests0.getModifyTime();
+      infraRequests0.getVolumeGroupName();
+      infraRequests0.getAicNodeClli();
+      infraRequests0.setVnfOutputs("d@?@e`uVahW|y");
+      infraRequests0.getVfModuleModelName();
+      infraRequests0.getRequestAction();
+      infraRequests0.getRequestAction();
+      infraRequests0.setVnfId("2dCOj.");
+      System.setCurrentTimeMillis(509L);
+      infraRequests0.getNetworkId();
+      infraRequests0.getProgress();
+      infraRequests0.getVfModuleId();
+      infraRequests0.getVfModuleId();
+      infraRequests0.getProgress();
+      String string0 = infraRequests0.getAicNodeClli();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test032()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setVfModuleName("");
+      infraRequests0.setVfModuleModelName("1Hr");
+      infraRequests0.setNetworkType("");
+      infraRequests0.setCallBackUrl("");
+      infraRequests0.setSource("[@Z");
+      infraRequests0.setRequestBody(">!b;YwVyr(8");
+      infraRequests0.setRequestBody("[@Z");
+      infraRequests0.setServiceInstanceId("1Hr");
+      infraRequests0.setClientRequestId((String) null);
+      infraRequests0.setRequestAction(">!b;YwVyr(8");
+      infraRequests0.setVnfName(">!b;YwVyr(8");
+      infraRequests0.setAicCloudRegion("[@Z");
+      infraRequests0.setNetworkId("OU%$T'av6Ca'8.%");
+      infraRequests0.setCallBackUrl("1Hr");
+      infraRequests0.setServiceInstanceId("");
+      infraRequests0.setNetworkName("OU%$T'av6Ca'8.%");
+      infraRequests0.setNetworkName("gB~~7^R}E0VY*jjv");
+      infraRequests0.getSource();
+      infraRequests0.getLastModifiedBy();
+      infraRequests0.getVfModuleName();
+      String string0 = infraRequests0.getRequestStatus();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test033()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("", "c~]g[*");
+      infraRequests0.setServiceType("");
+      infraRequests0.setAaiServiceId("c~]g[*");
+      infraRequests0.setVnfType("8u=!kEh2}E<wR-=T3Eu");
+      infraRequests0.setAicNodeClli("c~]g[*");
+      infraRequests0.getVnfType();
+      infraRequests0.setVnfName("~x");
+      infraRequests0.setVnfOutputs("8u=!kEh2}E<wR-=T3Eu");
+      infraRequests0.setServiceType("");
+      infraRequests0.setVnfOutputs("CxZIOx,v-");
+      infraRequests0.getVfModuleModelName();
+      infraRequests0.getAicNodeClli();
+      assertEquals("c~]g[*", infraRequests0.getAction());
+      
+      infraRequests0.setAction("Z+$8\"UD&O@G");
+      assertEquals("", infraRequests0.getRequestId());
+  }
+
+  @Test(timeout = 4000)
+  public void test034()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      Timestamp timestamp0 = new Timestamp((-2655L));
+      infraRequests0.setModifyTime(timestamp0);
+      Timestamp timestamp1 = infraRequests0.getModifyTime();
+      timestamp1.after(timestamp0);
+      infraRequests0.setStartTime(timestamp1);
+      infraRequests0.getAaiServiceId();
+      infraRequests0.getRequestStatus();
+      infraRequests0.setRequestStatus("I1e1@rWiu`h-");
+      infraRequests0.setVolumeGroupName("I1e1@rWiu`h-");
+      infraRequests0.setAicNodeClli("H/;N:1&TC[5,}");
+      String string0 = infraRequests0.getClientRequestId();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test035()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setNetworkType("org.openecomp.mso.requestsdb.InfraRequests");
+      infraRequests0.getVnfOutputs();
+      infraRequests0.getProgress();
+      infraRequests0.setClientRequestId((String) null);
+      infraRequests0.setRequestAction("YN8");
+      infraRequests0.setProvStatus("");
+      infraRequests0.getServiceInstanceId();
+      infraRequests0.getProvStatus();
+      infraRequests0.setRequestScope((String) null);
+      infraRequests0.getAicNodeClli();
+      infraRequests0.getRequestScope();
+      infraRequests0.getServiceInstanceName();
+      infraRequests0.setVnfName((String) null);
+      infraRequests0.getVolumeGroupName();
+      infraRequests0.getTenantId();
+      infraRequests0.getNetworkId();
+      infraRequests0.setStatusMessage((String) null);
+      infraRequests0.setTenantId("org.openecomp.mso.requestsdb.InfraRequests");
+      // Undeclared exception!
+      try { 
+        Timestamp.valueOf((String) null);
+        fail("Expecting exception: IllegalArgumentException");
+      
+      } catch(IllegalArgumentException e) {
+         //
+         // null string
+         //
+         verifyException("java.sql.Timestamp", e);
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test036()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.getVolumeGroupId();
+      infraRequests0.setVnfParams("xeM>h;aPCLLMO/");
+      infraRequests0.setAaiServiceId("xeM>h;aPCLLMO/");
+      infraRequests0.setProvStatus("");
+      infraRequests0.setVfModuleId("xeM>h;aPCLLMO/");
+      infraRequests0.setVnfOutputs("");
+      infraRequests0.setAaiServiceId((String) null);
+      infraRequests0.setClientRequestId("S|%I {=}otjRfuQa8Ab");
+      infraRequests0.setRequestBody("S|%I {=}otjRfuQa8Ab");
+      infraRequests0.setModifyTime((Timestamp) null);
+      infraRequests0.getRequestBody();
+      infraRequests0.setAaiServiceId("");
+      infraRequests0.setRequestId("4_X\":Ety|S,O-RObu");
+      infraRequests0.getCorrelator();
+      infraRequests0.setVnfOutputs("%~+Mc");
+      infraRequests0.getVolumeGroupId();
+      infraRequests0.setVnfId("");
+      assertNull(infraRequests0.getStatusMessage());
+  }
+
+  @Test(timeout = 4000)
+  public void test037()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("org.openecomp.mso.requestsdb.InfraRequests", "YpJ&");
+      infraRequests0.setRequestType("");
+      infraRequests0.setSource("org.openecomp.mso.requestsdb.InfraRequests");
+      infraRequests0.getNetworkId();
+      infraRequests0.getSource();
+      infraRequests0.setVfModuleName("org.openecomp.mso.requestsdb.InfraRequests");
+      infraRequests0.setRequestType((String) null);
+      infraRequests0.getStatusMessage();
+      infraRequests0.getVolumeGroupName();
+      infraRequests0.getVnfName();
+      infraRequests0.getModifyTime();
+      MockDate mockDate0 = new MockDate((-1949L));
+      Instant instant0 = mockDate0.toInstant();
+      Instant instant1 = MockInstant.plusSeconds(instant0, (-1949L));
+      Date.from(instant1);
+      infraRequests0.getRequestBody();
+      infraRequests0.getNetworkId();
+      infraRequests0.setModifyTime((Timestamp) null);
+      infraRequests0.getEndTime();
+      infraRequests0.getProvStatus();
+      infraRequests0.getRequestAction();
+      infraRequests0.getVfModuleName();
+      infraRequests0.getRequestAction();
+      assertEquals("YpJ&", infraRequests0.getAction());
+      assertEquals("org.openecomp.mso.requestsdb.InfraRequests", infraRequests0.getRequestId());
+  }
+
+  @Test(timeout = 4000)
+  public void test038()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("", "");
+      infraRequests0.setAicCloudRegion((String) null);
+      infraRequests0.setRequestType("_P-9");
+      infraRequests0.getRequestBody();
+      infraRequests0.setRequestStatus("");
+      infraRequests0.setCorrelator(".3!");
+      infraRequests0.setRequestId((String) null);
+      String string0 = infraRequests0.getRequestType();
+      assertEquals("_P-9", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test039()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setAaiServiceId("");
+      infraRequests0.setCallBackUrl("");
+      infraRequests0.setVnfOutputs("]8N<");
+      infraRequests0.setVfModuleId("");
+      infraRequests0.setCorrelator("]8N<");
+      infraRequests0.setResponseBody("");
+      infraRequests0.setNetworkType("]8N<");
+      infraRequests0.getProgress();
+      infraRequests0.setCallBackUrl("");
+      infraRequests0.getCallBackUrl();
+      infraRequests0.setServiceType("]8N<");
+      infraRequests0.getVnfId();
+      infraRequests0.setRequestAction("");
+      infraRequests0.setVnfName("");
+      infraRequests0.setVnfName("x'+i.S`");
+      infraRequests0.getTenantId();
+      infraRequests0.getAicCloudRegion();
+      infraRequests0.getTenantId();
+      infraRequests0.setStartTime((Timestamp) null);
+      infraRequests0.setRequestId("c");
+      infraRequests0.getRequestType();
+      infraRequests0.getEndTime();
+      infraRequests0.setModifyTime((Timestamp) null);
+      String string0 = infraRequests0.getVnfName();
+      assertEquals("x'+i.S`", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test040()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setNetworkId("8FcIWeVboHbH");
+      infraRequests0.setVnfId("");
+      infraRequests0.setStatusMessage("");
+      infraRequests0.getClientRequestId();
+      infraRequests0.setNetworkName((String) null);
+      infraRequests0.setVnfName((String) null);
+      infraRequests0.setCallBackUrl("sK9}!C'50J,");
+      infraRequests0.setVolumeGroupId("oC");
+      infraRequests0.getVnfOutputs();
+      infraRequests0.setVnfName("sK9}!C'50J,");
+      infraRequests0.setRequestScope("sK9}!C'50J,");
+      infraRequests0.getRequestAction();
+      infraRequests0.setVnfParams("oC");
+      infraRequests0.getVolumeGroupName();
+      infraRequests0.setResponseBody((String) null);
+      infraRequests0.setNetworkId((String) null);
+      infraRequests0.setProvStatus("");
+      infraRequests0.setAicNodeClli("");
+      infraRequests0.getAaiServiceId();
+      infraRequests0.getCallBackUrl();
+      infraRequests0.getResponseBody();
+      infraRequests0.setAaiServiceId((String) null);
+      infraRequests0.getResponseBody();
+      infraRequests0.getEndTime();
+      infraRequests0.setModifyTime((Timestamp) null);
+      infraRequests0.getServiceType();
+      infraRequests0.setResponseBody("");
+      infraRequests0.getServiceInstanceId();
+      infraRequests0.setRequestBody("J2E*wkiH'm}");
+      assertEquals("sK9}!C'50J,", infraRequests0.getCallBackUrl());
+  }
+
+  @Test(timeout = 4000)
+  public void test041()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setRequestStatus("gUu8 g");
+      infraRequests0.setClientRequestId("org.openecomp.mso.requestsdb.InfraRequests");
+      infraRequests0.setVnfOutputs("");
+      infraRequests0.setResponseBody("");
+      infraRequests0.setVnfId("");
+      infraRequests0.setAaiServiceId("org.openecomp.mso.requestsdb.InfraRequests");
+      infraRequests0.setAicNodeClli("org.openecomp.mso.requestsdb.InfraRequests");
+      infraRequests0.setVnfParams("org.openecomp.mso.requestsdb.InfraRequests");
+      infraRequests0.setResponseBody("");
+      infraRequests0.getModifyTime();
+      infraRequests0.getVnfOutputs();
+      infraRequests0.getRequestStatus();
+      infraRequests0.setVfModuleId("GrYS{|<Q&Zg22qy+qi");
+      infraRequests0.setStartTime((Timestamp) null);
+      infraRequests0.getVnfOutputs();
+      String string0 = infraRequests0.getRequestAction();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test042()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setServiceInstanceId((String) null);
+      infraRequests0.setAction("niZk9/S^^Ok_H^a{");
+      infraRequests0.setVfModuleId("niZk9/S^^Ok_H^a{");
+      infraRequests0.setVolumeGroupId("");
+      infraRequests0.setNetworkId("");
+      infraRequests0.setVnfId("");
+      infraRequests0.setRequestType("?_I%o");
+      infraRequests0.setProvStatus("niZk9/S^^Ok_H^a{");
+      infraRequests0.setCallBackUrl("");
+      infraRequests0.setServiceInstanceName("XA&Ybqzx!ro6hEU");
+      infraRequests0.setLastModifiedBy("");
+      infraRequests0.setRequestId("");
+      infraRequests0.getRequestScope();
+      infraRequests0.getNetworkName();
+      infraRequests0.getVnfId();
+      infraRequests0.setAaiServiceId("");
+      infraRequests0.setTenantId("XA&Ybqzx!ro6hEU");
+      infraRequests0.setVolumeGroupId("{O)c");
+      infraRequests0.getAction();
+      infraRequests0.getVolumeGroupName();
+      infraRequests0.getTenantId();
+      infraRequests0.setServiceInstanceId("");
+      assertNull(infraRequests0.getNetworkType());
+  }
+
+  @Test(timeout = 4000)
+  public void test043()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("", "");
+      infraRequests0.setTenantId("");
+      infraRequests0.setNetworkName("");
+      infraRequests0.setAction("");
+      Long long0 = new Long(210L);
+      Long.compare(1164L, 210L);
+      infraRequests0.setProgress(long0);
+      infraRequests0.setVfModuleName("");
+      Timestamp timestamp0 = new Timestamp(0L);
+      timestamp0.toInstant();
+      timestamp0.setTime(210L);
+      Instant instant0 = MockInstant.ofEpochMilli(210L);
+      timestamp0.toLocalDateTime();
+      Date.from(instant0);
+      infraRequests0.setModifyTime(timestamp0);
+      infraRequests0.setAicCloudRegion("org.openecomp.mso.requestsdb.InfraRequests");
+      infraRequests0.setRequestAction("qa^[z3j");
+      infraRequests0.setVnfType("");
+      infraRequests0.getEndTime();
+      infraRequests0.setVnfId("wI");
+      infraRequests0.getAicCloudRegion();
+      infraRequests0.setServiceType("");
+      infraRequests0.getAction();
+      Timestamp timestamp1 = infraRequests0.getStartTime();
+      assertNull(timestamp1);
+  }
+
+  @Test(timeout = 4000)
+  public void test044()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("y_J8g=Q8E|gns?USs", "~6yl5nFR7N_I'Tv@.");
+      infraRequests0.setCallBackUrl("_w^p*-dH4_6v");
+      infraRequests0.setVolumeGroupName("y_J8g=Q8E|gns?USs");
+      String string0 = infraRequests0.getAction();
+      assertEquals("~6yl5nFR7N_I'Tv@.", string0);
+      
+      InfraRequests infraRequests1 = new InfraRequests("S?cD1SU", "");
+      assertEquals("S?cD1SU", infraRequests1.getRequestId());
+  }
+
+  @Test(timeout = 4000)
+  public void test045()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setVolumeGroupName("");
+      infraRequests0.setServiceInstanceName("");
+      infraRequests0.setVfModuleName("");
+      infraRequests0.setStatusMessage("");
+      infraRequests0.setVnfName("GG-<o?t l");
+      infraRequests0.setVnfName("");
+      infraRequests0.setRequestBody("");
+      infraRequests0.setCallBackUrl("");
+      infraRequests0.setRequestAction("");
+      infraRequests0.setVnfType("");
+      infraRequests0.setVnfId("");
+      infraRequests0.setServiceInstanceId("{CyVx7 >*vO|");
+      infraRequests0.setVnfId("");
+      infraRequests0.getProvStatus();
+      infraRequests0.setProvStatus("{CyVx7 >*vO|");
+      infraRequests0.setAicNodeClli("?g9!S#sMQWI4rg");
+      infraRequests0.setVnfParams("");
+      infraRequests0.setRequestAction("GG-<o?t l");
+      infraRequests0.getRequestType();
+      infraRequests0.getVolumeGroupName();
+      infraRequests0.getRequestAction();
+      infraRequests0.getRequestStatus();
+      InfraRequests infraRequests1 = new InfraRequests();
+      String string0 = infraRequests1.getServiceInstanceId();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test046()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("", "");
+      infraRequests0.setVnfName("");
+      infraRequests0.setServiceInstanceId("");
+      infraRequests0.setVolumeGroupId("");
+      infraRequests0.setNetworkId("?");
+      infraRequests0.setVnfName("");
+      infraRequests0.setServiceType("");
+      infraRequests0.setSource("");
+      infraRequests0.getRequestType();
+      InfraRequests infraRequests1 = new InfraRequests();
+      infraRequests1.setVolumeGroupName(")Na<;z");
+      infraRequests1.setRequestAction("");
+      infraRequests1.getAicNodeClli();
+      infraRequests1.setResponseBody((String) null);
+      infraRequests1.setVnfType((String) null);
+      infraRequests1.getVnfName();
+      infraRequests1.getVnfType();
+      infraRequests0.getServiceInstanceId();
+      infraRequests0.setRequestType("");
+      infraRequests1.getVnfName();
+      infraRequests0.getRequestBody();
+      infraRequests1.getVnfType();
+      infraRequests1.setRequestAction("Yy");
+      infraRequests0.setVnfParams("DnrZ78}s");
+      infraRequests0.setServiceInstanceId("]V55Aq\u0003(z<Ct92L`F");
+      infraRequests1.setVfModuleName((String) null);
+      assertNull(infraRequests1.getNetworkId());
+  }
+
+  @Test(timeout = 4000)
+  public void test047()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("", "");
+      infraRequests0.getAction();
+      infraRequests0.setVnfName("");
+      infraRequests0.getNetworkType();
+      infraRequests0.getVnfParams();
+      infraRequests0.setLastModifiedBy((String) null);
+      String string0 = infraRequests0.getAaiServiceId();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test048()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setNetworkType("");
+      infraRequests0.setStatusMessage("");
+      infraRequests0.setRequestAction("");
+      infraRequests0.setSource("");
+      infraRequests0.setVnfId((String) null);
+      infraRequests0.setLastModifiedBy((String) null);
+      infraRequests0.setVolumeGroupId((String) null);
+      infraRequests0.setRequestScope("");
+      infraRequests0.getServiceType();
+      infraRequests0.setRequestBody((String) null);
+      infraRequests0.getProgress();
+      infraRequests0.setVnfType((String) null);
+      infraRequests0.setSource((String) null);
+      infraRequests0.getVfModuleModelName();
+      infraRequests0.getStatusMessage();
+      infraRequests0.setResponseBody("");
+      infraRequests0.setRequestStatus((String) null);
+      infraRequests0.getAicCloudRegion();
+      Timestamp timestamp0 = new Timestamp(2519L);
+      infraRequests0.setEndTime(timestamp0);
+      String string0 = infraRequests0.getRequestBody();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test049()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("$V/<$XAp+o>Im\"*", "$V/<$XAp+o>Im\"*");
+      infraRequests0.setNetworkName("$V/<$XAp+o>Im\"*");
+      infraRequests0.setVnfName((String) null);
+      infraRequests0.setVfModuleId("");
+      infraRequests0.getServiceInstanceName();
+      infraRequests0.setAaiServiceId("");
+      infraRequests0.setRequestScope("");
+      infraRequests0.getAaiServiceId();
+      infraRequests0.getModifyTime();
+      infraRequests0.setNetworkName((String) null);
+      infraRequests0.setSource("");
+      infraRequests0.getRequestBody();
+      infraRequests0.setVnfType("");
+      infraRequests0.setStatusMessage("");
+      assertNull(infraRequests0.getVolumeGroupId());
+  }
+
+  @Test(timeout = 4000)
+  public void test050()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setRequestStatus("");
+      infraRequests0.getServiceInstanceName();
+      infraRequests0.setRequestBody((String) null);
+      infraRequests0.getAction();
+      infraRequests0.setVnfParams("");
+      infraRequests0.setAction((String) null);
+      infraRequests0.getSource();
+      infraRequests0.getAicCloudRegion();
+      infraRequests0.getRequestType();
+      infraRequests0.getClientRequestId();
+      infraRequests0.getServiceInstanceId();
+      infraRequests0.setResponseBody("");
+      infraRequests0.getVolumeGroupId();
+      infraRequests0.getRequestStatus();
+      infraRequests0.getRequestScope();
+      infraRequests0.setAicCloudRegion("");
+      Long long0 = new Long(0L);
+      Long.getLong("TQRm 6Q}I>x7UHTd!cH");
+      // Undeclared exception!
+      try { 
+        Long.remainderUnsigned((-1L), 0L);
+        fail("Expecting exception: ArithmeticException");
+      
+      } catch(ArithmeticException e) {
+         //
+         // BigInteger divide by zero
+         //
+         verifyException("java.math.MutableBigInteger", e);
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test051()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("", "");
+      infraRequests0.setProvStatus("");
+      infraRequests0.setClientRequestId("");
+      infraRequests0.setVnfType("BJ@B");
+      infraRequests0.setProvStatus("");
+      infraRequests0.setRequestType("");
+      infraRequests0.setAaiServiceId("k^;d!:UH+Z");
+      infraRequests0.setRequestType("");
+      infraRequests0.setTenantId("");
+      infraRequests0.getCallBackUrl();
+      InfraRequests infraRequests1 = new InfraRequests();
+      infraRequests1.setVnfName("C,,\"N");
+      infraRequests0.setVnfParams((String) null);
+      InfraRequests infraRequests2 = new InfraRequests("", "");
+      infraRequests1.setVolumeGroupId("");
+      infraRequests2.setTenantId("k^;d!:UH+Z");
+      infraRequests1.setVfModuleName("");
+      infraRequests2.setVnfType("eDfR<b$HYx");
+      infraRequests2.setStatusMessage((String) null);
+      infraRequests2.setVnfId("");
+      infraRequests1.getVolumeGroupId();
+      infraRequests0.setAicCloudRegion("BJ@B");
+      infraRequests1.setNetworkType("");
+      String string0 = infraRequests2.getRequestBody();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test052()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("", "");
+      infraRequests0.setRequestStatus("");
+      infraRequests0.getAicNodeClli();
+      infraRequests0.setVolumeGroupName("=xQ^U6%j?LcGU");
+      infraRequests0.setVolumeGroupId("~L$J");
+      infraRequests0.setVnfOutputs("C");
+      infraRequests0.setVnfId("YU GUY+c}[>6+QI83q");
+      infraRequests0.setVfModuleName("");
+      infraRequests0.getRequestId();
+      infraRequests0.setVfModuleModelName("S9h|[hF*h/aEBZ--");
+      infraRequests0.setCallBackUrl("");
+      infraRequests0.getVnfId();
+      infraRequests0.setVnfParams("");
+      infraRequests0.getSource();
+      infraRequests0.getVnfType();
+      InfraRequests infraRequests1 = new InfraRequests("", "");
+      infraRequests0.setAaiServiceId("S9h|[hF*h/aEBZ--");
+      infraRequests0.setVnfParams("");
+      infraRequests1.getRequestBody();
+      Month month0 = Month.MARCH;
+      // Undeclared exception!
+      try { 
+        MockLocalDateTime.of(1, month0, 1, 1, 0, (-1068));
+        fail("Expecting exception: DateTimeException");
+      
+      } catch(DateTimeException e) {
+         //
+         // Invalid value for SecondOfMinute (valid values 0 - 59): -1068
+         //
+         verifyException("java.time.temporal.ValueRange", e);
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test053()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setLastModifiedBy("M+YL/d");
+      infraRequests0.setCorrelator("M+YL/d");
+      infraRequests0.getLastModifiedBy();
+      Month month0 = Month.MAY;
+      // Undeclared exception!
+      try { 
+        MockLocalDateTime.of((-574), month0, (-574), (-574), 0);
+        fail("Expecting exception: DateTimeException");
+      
+      } catch(DateTimeException e) {
+         //
+         // Invalid value for DayOfMonth (valid values 1 - 28/31): -574
+         //
+         verifyException("java.time.temporal.ValueRange", e);
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test054()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setRequestType("");
+      infraRequests0.setEndTime((Timestamp) null);
+      Long long0 = new Long(0L);
+      Long.compare(0L, 0L);
+      Long.min(0L, 0L);
+      infraRequests0.setProvStatus("");
+      Long.compare(0L, 0L);
+      Long.max(0, 0L);
+      Long.divideUnsigned((-1239L), 561L);
+      Long.divideUnsigned(0, 31L);
+      Long.sum(0, 31L);
+      Long.getLong("}'{?rnxwE~m.*b/<", (-2588L));
+      infraRequests0.setProgress(long0);
+      infraRequests0.setProvStatus("");
+      infraRequests0.setVnfParams("");
+      infraRequests0.setRequestScope("Gz0xF^~M`");
+      infraRequests0.setRequestType("");
+      infraRequests0.getAaiServiceId();
+      infraRequests0.setCallBackUrl("");
+      infraRequests0.setNetworkName("");
+      infraRequests0.setRequestStatus("No<5t");
+      infraRequests0.setVolumeGroupId("");
+      infraRequests0.getEndTime();
+      infraRequests0.getProgress();
+      String string0 = infraRequests0.getRequestScope();
+      assertEquals("Gz0xF^~M`", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test055()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("K66EFm]%0}Hi", "K66EFm]%0}Hi");
+      infraRequests0.setVnfName("K66EFm]%0}Hi");
+      infraRequests0.getVfModuleModelName();
+      infraRequests0.getProgress();
+      infraRequests0.setStatusMessage("K66EFm]%0}Hi");
+      infraRequests0.setVolumeGroupId((String) null);
+      infraRequests0.setVolumeGroupName("K66EFm]%0}Hi");
+      infraRequests0.setRequestBody("J1UB");
+      assertNull(infraRequests0.getResponseBody());
+  }
+
+  @Test(timeout = 4000)
+  public void test056()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("", "UwUvkc");
+      infraRequests0.setVolumeGroupName("UwUvkc");
+      infraRequests0.getVfModuleId();
+      ZoneOffset zoneOffset0 = ZoneOffset.MIN;
+      ZoneOffset zoneOffset1 = (ZoneOffset)ZoneId.ofOffset("", zoneOffset0);
+      LocalDateTime localDateTime0 = MockLocalDateTime.now((ZoneId) zoneOffset1);
+      Timestamp timestamp0 = Timestamp.valueOf(localDateTime0);
+      infraRequests0.setModifyTime(timestamp0);
+      String string0 = infraRequests0.getRequestId();
+      assertEquals("", string0);
+      
+      infraRequests0.getCorrelator();
+      assertEquals("UwUvkc", infraRequests0.getAction());
+  }
+
+  @Test(timeout = 4000)
+  public void test057()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.getVnfName();
+      infraRequests0.setAction((String) null);
+      infraRequests0.getVfModuleName();
+      infraRequests0.getNetworkId();
+      infraRequests0.getVnfId();
+      infraRequests0.setRequestId((String) null);
+      infraRequests0.setNetworkId((String) null);
+      infraRequests0.setRequestStatus((String) null);
+      infraRequests0.setAaiServiceId("wL6o_:EmO)#");
+      infraRequests0.setSource((String) null);
+      infraRequests0.setVnfType("yMKDqB`W?]q");
+      infraRequests0.setRequestType((String) null);
+      infraRequests0.setRequestType("");
+      infraRequests0.setRequestScope((String) null);
+      infraRequests0.getVfModuleName();
+      infraRequests0.getVolumeGroupName();
+      infraRequests0.getSource();
+      infraRequests0.setAicCloudRegion((String) null);
+      infraRequests0.getSource();
+      infraRequests0.getRequestBody();
+      infraRequests0.getAaiServiceId();
+      infraRequests0.setVnfType((String) null);
+      String string0 = infraRequests0.getClientRequestId();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test058()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("", "");
+      infraRequests0.setSource("c");
+      infraRequests0.setRequestType("*Q}l.yW`VI`i_Q8YL]");
+      infraRequests0.setRequestId("");
+      infraRequests0.setCorrelator("Y;5!~N0v@x");
+      infraRequests0.setNetworkType("");
+      infraRequests0.setRequestAction("Y;5!~N0v@x");
+      infraRequests0.setLastModifiedBy("");
+      infraRequests0.setSource("");
+      infraRequests0.setAction("");
+      infraRequests0.setTenantId("");
+      infraRequests0.setAicCloudRegion("");
+      infraRequests0.getRequestScope();
+      infraRequests0.setAicNodeClli("Y;5!~N0v@x");
+      infraRequests0.getAicCloudRegion();
+      infraRequests0.setVnfId("qn|b,'x[1 h*z\"#h");
+      assertNull(infraRequests0.getRequestScope());
+  }
+
+  @Test(timeout = 4000)
+  public void test059()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("", "");
+      infraRequests0.setVnfType("SRPBs.zeX&dK@&XRQj");
+      infraRequests0.setCallBackUrl("");
+      infraRequests0.setVnfType("%a26GFoFhBEe");
+      infraRequests0.setServiceInstanceName((String) null);
+      infraRequests0.setVfModuleName((String) null);
+      infraRequests0.getLastModifiedBy();
+      infraRequests0.getVnfType();
+      String string0 = infraRequests0.getServiceInstanceName();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test060()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.getEndTime();
+      MockDate mockDate0 = new MockDate(965L);
+      Instant instant0 = mockDate0.toInstant();
+      Date.from(instant0);
+      infraRequests0.setEndTime((Timestamp) null);
+      infraRequests0.getEndTime();
+      infraRequests0.getCorrelator();
+      Long long0 = new Long(965L);
+      infraRequests0.setProgress(long0);
+      String string0 = infraRequests0.getTenantId();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test061()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("qx?)", "qx?)");
+      Timestamp timestamp0 = new Timestamp(1390L);
+      infraRequests0.setStartTime(timestamp0);
+      infraRequests0.getRequestScope();
+      infraRequests0.setVolumeGroupId("qx?)");
+      infraRequests0.getVolumeGroupId();
+      infraRequests0.setProvStatus((String) null);
+      timestamp0.setNanos(0);
+      infraRequests0.setCorrelator("");
+      infraRequests0.setVnfOutputs("");
+      infraRequests0.setModifyTime(timestamp0);
+      infraRequests0.getServiceType();
+      infraRequests0.setVolumeGroupName("5#&B!D");
+      infraRequests0.setVfModuleId("a");
+      infraRequests0.setNetworkName("a");
+      infraRequests0.getClientRequestId();
+      infraRequests0.setRequestScope("qx?)");
+      infraRequests0.setVolumeGroupName((String) null);
+      infraRequests0.getRequestId();
+      infraRequests0.setRequestScope("-W#aB<Km<U(");
+      infraRequests0.getVnfParams();
+      infraRequests0.getServiceInstanceName();
+      infraRequests0.getCorrelator();
+      infraRequests0.setAicNodeClli("");
+      infraRequests0.setAction("");
+      infraRequests0.setStartTime(timestamp0);
+      assertNull(infraRequests0.getServiceInstanceName());
+  }
+
+  @Test(timeout = 4000)
+  public void test062()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("N.Z5|phE", "");
+      infraRequests0.getClientRequestId();
+      assertEquals("N.Z5|phE", infraRequests0.getRequestId());
+      assertEquals("", infraRequests0.getAction());
+  }
+
+  @Test(timeout = 4000)
+  public void test063()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("", "h.");
+      infraRequests0.setRequestStatus("");
+      infraRequests0.getVnfParams();
+      infraRequests0.setNetworkType("");
+      assertEquals("h.", infraRequests0.getAction());
+      assertEquals("", infraRequests0.getRequestId());
+  }
+
+  @Test(timeout = 4000)
+  public void test064()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("", "");
+      infraRequests0.setRequestType("");
+      infraRequests0.getServiceInstanceId();
+      infraRequests0.setVnfParams("`jECciBa[T7M");
+      infraRequests0.setRequestBody("4ap}Bu0R,P");
+      String string0 = infraRequests0.getRequestType();
+      assertEquals("", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test065()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      String string0 = infraRequests0.getAicCloudRegion();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test066()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("org.openecomp.mso.requestsdb.InfraRequests", "org.openecomp.mso.requestsdb.InfraRequests");
+      infraRequests0.setRequestStatus("");
+      infraRequests0.getResponseBody();
+      String string0 = infraRequests0.getRequestAction();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test067()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("", (String) null);
+      infraRequests0.setNetworkId("x^qIF~ru");
+      infraRequests0.setServiceInstanceId("IL'5l;^7N^;>0");
+      infraRequests0.setLastModifiedBy("h dET");
+      infraRequests0.setVfModuleModelName("h dET");
+      infraRequests0.setVnfType("");
+      infraRequests0.setVfModuleId("");
+      infraRequests0.setVfModuleName("");
+      infraRequests0.setClientRequestId("");
+      infraRequests0.setVnfId("W1Vd+");
+      infraRequests0.getVnfName();
+      infraRequests0.getNetworkType();
+      infraRequests0.getServiceInstanceId();
+      infraRequests0.setNetworkName("o-");
+      assertNull(infraRequests0.getServiceType());
+  }
+
+  @Test(timeout = 4000)
+  public void test068()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("4E!AHGB", "");
+      infraRequests0.getRequestStatus();
+      String string0 = infraRequests0.getRequestId();
+      assertEquals("4E!AHGB", string0);
+      
+      infraRequests0.setRequestScope("F");
+      infraRequests0.getVfModuleId();
+      infraRequests0.setAicNodeClli("zM4bS");
+      infraRequests0.setServiceInstanceName("4E!AHGB");
+      infraRequests0.setServiceType("");
+      infraRequests0.getVnfType();
+      infraRequests0.setAicNodeClli((String) null);
+      assertEquals("", infraRequests0.getAction());
+  }
+
+  @Test(timeout = 4000)
+  public void test069()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setServiceInstanceName("}<+55QA6'/xzr");
+      infraRequests0.getModifyTime();
+      infraRequests0.getProvStatus();
+      infraRequests0.setVnfOutputs("");
+      infraRequests0.getAction();
+      infraRequests0.setAicCloudRegion("~W -^JP41(-Dg'.+|p$");
+      assertNull(infraRequests0.getServiceType());
+  }
+
+  @Test(timeout = 4000)
+  public void test070()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setAaiServiceId("PJ60cl#^59FDR_>aLqF");
+      infraRequests0.setLastModifiedBy("PJ60cl#^59FDR_>aLqF");
+      infraRequests0.setCorrelator("");
+      infraRequests0.getNetworkType();
+      infraRequests0.setAaiServiceId("PJ60cl#^59FDR_>aLqF");
+      infraRequests0.getAicNodeClli();
+      String string0 = infraRequests0.getVnfType();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test071()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests(" ?)Ec.r]zDe6pa).i", "LZP&!xPsP /f");
+      infraRequests0.setVnfType("5YWNFYfj=3.[9u?N");
+      infraRequests0.setSource("LZP&!xPsP /f");
+      infraRequests0.setVfModuleName("9");
+      infraRequests0.getVnfId();
+      Timestamp timestamp0 = new Timestamp(2083L);
+      LocalDateTime localDateTime0 = timestamp0.toLocalDateTime();
+      Timestamp timestamp1 = Timestamp.valueOf(localDateTime0);
+      infraRequests0.setModifyTime(timestamp1);
+      infraRequests0.getCorrelator();
+      infraRequests0.getEndTime();
+      assertEquals(" ?)Ec.r]zDe6pa).i", infraRequests0.getRequestId());
+      assertEquals("LZP&!xPsP /f", infraRequests0.getAction());
+  }
+
+  @Test(timeout = 4000)
+  public void test072()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setVnfId("");
+      String string0 = infraRequests0.getVnfId();
+      assertEquals("", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test073()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("", "");
+      infraRequests0.setAaiServiceId("");
+      String string0 = infraRequests0.getServiceType();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test074()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setVolumeGroupName("");
+      String string0 = infraRequests0.getVfModuleId();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test075()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setVnfOutputs("");
+      infraRequests0.setNetworkId("RU^6`fci#/");
+      infraRequests0.getVolumeGroupId();
+      infraRequests0.getModifyTime();
+      infraRequests0.setVnfType((String) null);
+      String string0 = infraRequests0.getNetworkName();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test076()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      Long long0 = new Long((-1725L));
+      infraRequests0.setProgress(long0);
+      Long long1 = infraRequests0.getProgress();
+      assertEquals((-1725L), (long)long1);
+  }
+
+  @Test(timeout = 4000)
+  public void test077()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("\"}G", "");
+      Timestamp timestamp0 = new Timestamp((-231L));
+      infraRequests0.setModifyTime(timestamp0);
+      infraRequests0.getServiceInstanceId();
+      infraRequests0.getVnfName();
+      infraRequests0.setVfModuleName("org.openecomp.mso.requestsdb.InfraRequests");
+      assertEquals("\"}G", infraRequests0.getRequestId());
+      assertEquals("", infraRequests0.getAction());
+  }
+
+  @Test(timeout = 4000)
+  public void test078()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.getAicNodeClli();
+      infraRequests0.getAicNodeClli();
+      String string0 = infraRequests0.getVnfOutputs();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test079()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      InfraRequests infraRequests1 = new InfraRequests();
+      infraRequests1.getEndTime();
+      infraRequests0.setStartTime((Timestamp) null);
+      infraRequests0.setTenantId("#X=o2!~:^_LF!mu%");
+      assertNull(infraRequests0.getVfModuleModelName());
+  }
+
+  @Test(timeout = 4000)
+  public void test080()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.getNetworkId();
+      infraRequests0.setRequestAction((String) null);
+      infraRequests0.getSource();
+      infraRequests0.setVnfOutputs("5K\u0002}.V3dm%yU_&r");
+      assertNull(infraRequests0.getRequestScope());
+  }
+
+  @Test(timeout = 4000)
+  public void test081()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests((String) null, "org.openecomp.mso.requestsdb.InfraRequests");
+      infraRequests0.setVfModuleName((String) null);
+      infraRequests0.setServiceType("org.openecomp.mso.requestsdb.InfraRequests");
+      infraRequests0.getServiceInstanceId();
+      infraRequests0.getRequestId();
+      infraRequests0.getVolumeGroupId();
+      String string0 = infraRequests0.getNetworkType();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test082()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setVolumeGroupId("<LXzO");
+      assertNull(infraRequests0.getRequestType());
+  }
+
+  @Test(timeout = 4000)
+  public void test083()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setRequestAction("");
+      infraRequests0.setServiceInstanceId("");
+      infraRequests0.setAicNodeClli("");
+      assertNull(infraRequests0.getServiceType());
+  }
+
+  @Test(timeout = 4000)
+  public void test084()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("", "Z={83xlme_b)?zb8");
+      infraRequests0.setSource("");
+      infraRequests0.getStartTime();
+      infraRequests0.getSource();
+      infraRequests0.getModifyTime();
+      assertEquals("Z={83xlme_b)?zb8", infraRequests0.getAction());
+      assertEquals("", infraRequests0.getRequestId());
+  }
+
+  @Test(timeout = 4000)
+  public void test085()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setVnfName("d(8}Oc 4|@w8hBNICH");
+      infraRequests0.setRequestScope("d(8}Oc 4|@w8hBNICH");
+      String string0 = infraRequests0.getAaiServiceId();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test086()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setVfModuleId("bS&'!@{LdL0&");
+      infraRequests0.setRequestStatus("bS&'!@{LdL0&");
+      infraRequests0.setRequestAction((String) null);
+      infraRequests0.setVfModuleModelName("z");
+      infraRequests0.getSource();
+      infraRequests0.getServiceInstanceName();
+      infraRequests0.getVnfName();
+      String string0 = infraRequests0.getAction();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test087()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.getRequestType();
+      infraRequests0.setVnfOutputs((String) null);
+      infraRequests0.getCorrelator();
+      infraRequests0.setCallBackUrl((String) null);
+      infraRequests0.setVnfParams(">'n");
+      assertNull(infraRequests0.getVfModuleModelName());
+  }
+
+  @Test(timeout = 4000)
+  public void test088()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("I\"as", (String) null);
+      infraRequests0.getVolumeGroupName();
+      infraRequests0.getRequestBody();
+      infraRequests0.setTenantId((String) null);
+      infraRequests0.getResponseBody();
+      // Undeclared exception!
+      try { 
+        MockURI.create((String) null);
+        fail("Expecting exception: NullPointerException");
+      
+      } catch(NullPointerException e) {
+         //
+         // no message in exception (getMessage() returned null)
+         //
+         verifyException("java.net.URI$Parser", e);
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test089()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("", "");
+      infraRequests0.setResponseBody("");
+      infraRequests0.setRequestId("");
+      infraRequests0.setNetworkId("");
+      infraRequests0.getEndTime();
+      infraRequests0.getVolumeGroupId();
+      String string0 = infraRequests0.getStatusMessage();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test090()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests((String) null, "&6KF");
+      infraRequests0.setRequestBody("&6KF");
+      assertNull(infraRequests0.getRequestScope());
+  }
+
+  @Test(timeout = 4000)
+  public void test091()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("/WcV", "/WcV");
+      infraRequests0.setVnfParams("\"w");
+      String string0 = infraRequests0.getVnfParams();
+      assertEquals("\"w", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test092()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests(">?ozK", ">?ozK");
+      infraRequests0.setVnfOutputs(">?ozK");
+      infraRequests0.setVnfId("");
+      infraRequests0.getLastModifiedBy();
+      infraRequests0.setAicCloudRegion((String) null);
+      infraRequests0.setProvStatus(">?ozK");
+      infraRequests0.setStatusMessage((String) null);
+      String string0 = infraRequests0.getRequestScope();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test093()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setEndTime((Timestamp) null);
+      infraRequests0.setRequestType("");
+      assertNull(infraRequests0.getProvStatus());
+  }
+
+  @Test(timeout = 4000)
+  public void test094()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("", "Z={83xlme_b)?zb8");
+      infraRequests0.getStartTime();
+  }
+
+  @Test(timeout = 4000)
+  public void test095()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      String string0 = infraRequests0.getRequestStatus();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test096()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("gpXsJ>b/G", "gpXsJ>b/G");
+      infraRequests0.setClientRequestId("gpXsJ>b/G");
+      infraRequests0.setCallBackUrl("");
+      infraRequests0.setNetworkType("TF3Cf[F..K");
+      assertNull(infraRequests0.getAicNodeClli());
+  }
+
+  @Test(timeout = 4000)
+  public void test097()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.getVfModuleName();
+      infraRequests0.setAicCloudRegion((String) null);
+      String string0 = infraRequests0.getVnfName();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test098()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.setNetworkName("K|it");
+      infraRequests0.setAction("hc}j,");
+      infraRequests0.getServiceInstanceId();
+      infraRequests0.getCallBackUrl();
+      String string0 = infraRequests0.getVfModuleId();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test099()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      String string0 = infraRequests0.getServiceInstanceId();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test100()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      infraRequests0.getProvStatus();
+      String string0 = infraRequests0.getVfModuleId();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test101()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests();
+      String string0 = infraRequests0.getCallBackUrl();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test102()  throws Throwable  {
+      InfraRequests infraRequests0 = new InfraRequests("", "j28UDln3go*x");
+      assertEquals("j28UDln3go*x", infraRequests0.getAction());
+      
+      infraRequests0.setAction("X;{A n=y");
+      infraRequests0.setTenantId("");
+      assertEquals("", infraRequests0.getRequestId());
+  }
+}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraRequestsESTestscaffolding.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraRequestsESTestscaffolding.java
new file mode 100644
index 0000000..9ab77f5
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/InfraRequestsESTestscaffolding.java
@@ -0,0 +1,82 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Wed Dec 14 15:15:48 GMT 2016
+ */
+
+package org.openecomp.mso.requestsdb;
+
+import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
+import org.junit.BeforeClass;
+import org.junit.Before;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.evosuite.runtime.sandbox.Sandbox;
+import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
+
+@EvoSuiteClassExclude
+public class InfraRequestsESTestscaffolding {
+
+  @org.junit.Rule 
+  public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
+
+  private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); 
+
+  private org.evosuite.runtime.thread.ThreadStopper threadStopper =  new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
+
+  @BeforeClass 
+  public static void initEvoSuiteFramework() { 
+    org.evosuite.runtime.RuntimeSettings.className = "org.openecomp.mso.requestsdb.InfraRequests"; 
+    org.evosuite.runtime.GuiSupport.initialize(); 
+    org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; 
+    org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; 
+    org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; 
+    org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; 
+    org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); 
+    org.evosuite.runtime.classhandling.JDKClassResetter.init(); 
+    initializeClasses();
+    org.evosuite.runtime.Runtime.getInstance().resetRuntime(); 
+  } 
+
+  @AfterClass 
+  public static void clearEvoSuiteFramework(){ 
+    Sandbox.resetDefaultSecurityManager(); 
+    java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); 
+  } 
+
+  @Before 
+  public void initTestCase(){ 
+    threadStopper.storeCurrentThreads();
+    threadStopper.startRecordingTime();
+    org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); 
+    org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); 
+    org.evosuite.runtime.GuiSupport.setHeadless(); 
+    org.evosuite.runtime.Runtime.getInstance().resetRuntime(); 
+    org.evosuite.runtime.agent.InstrumentingAgent.activate(); 
+  } 
+
+  @After 
+  public void doneWithTestCase(){ 
+    threadStopper.killAndJoinClientThreads();
+    org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); 
+    org.evosuite.runtime.classhandling.JDKClassResetter.reset(); 
+    resetClasses(); 
+    org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); 
+    org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); 
+    org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); 
+  } 
+
+  private static void initializeClasses() {
+    org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(InfraRequestsESTestscaffolding.class.getClassLoader() ,
+      "org.openecomp.mso.requestsdb.InfraRequests"
+    );
+  } 
+
+  private static void resetClasses() {
+    org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(InfraRequestsESTestscaffolding.class.getClassLoader()); 
+
+    org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
+      "org.openecomp.mso.requestsdb.InfraRequests"
+    );
+  }
+}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/RequestsDatabaseESTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/RequestsDatabaseESTest.java
new file mode 100644
index 0000000..7c1b399
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/RequestsDatabaseESTest.java
@@ -0,0 +1,24 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Wed Dec 14 15:15:27 GMT 2016
+ */
+
+package org.openecomp.mso.requestsdb;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.evosuite.runtime.PrivateAccess;
+import org.junit.runner.RunWith;
+import org.openecomp.mso.requestsdb.RequestsDatabase;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class RequestsDatabaseESTest extends RequestsDatabaseESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test0()  throws Throwable  {
+      RequestsDatabase requestsDatabase0 = (RequestsDatabase)PrivateAccess.callDefaultConstructorOfTheClassUnderTest();
+      assertNotNull(requestsDatabase0);
+  }
+}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/RequestsDatabaseESTestscaffolding.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/RequestsDatabaseESTestscaffolding.java
new file mode 100644
index 0000000..6d5c31f
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/RequestsDatabaseESTestscaffolding.java
@@ -0,0 +1,120 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Wed Dec 14 15:15:27 GMT 2016
+ */
+
+package org.openecomp.mso.requestsdb;
+
+import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
+import org.junit.BeforeClass;
+import org.junit.Before;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.evosuite.runtime.sandbox.Sandbox;
+import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
+
+@EvoSuiteClassExclude
+public class RequestsDatabaseESTestscaffolding {
+
+  @org.junit.Rule 
+  public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
+
+  private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); 
+
+  private org.evosuite.runtime.thread.ThreadStopper threadStopper =  new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
+
+  @BeforeClass 
+  public static void initEvoSuiteFramework() { 
+    org.evosuite.runtime.RuntimeSettings.className = "org.openecomp.mso.requestsdb.RequestsDatabase"; 
+    org.evosuite.runtime.GuiSupport.initialize(); 
+    org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; 
+    org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; 
+    org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; 
+    org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; 
+    org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); 
+    org.evosuite.runtime.classhandling.JDKClassResetter.init(); 
+    initializeClasses();
+    org.evosuite.runtime.Runtime.getInstance().resetRuntime(); 
+  } 
+
+  @AfterClass 
+  public static void clearEvoSuiteFramework(){ 
+    Sandbox.resetDefaultSecurityManager(); 
+    java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); 
+  } 
+
+  @Before 
+  public void initTestCase(){ 
+    threadStopper.storeCurrentThreads();
+    threadStopper.startRecordingTime();
+    org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); 
+    org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); 
+    org.evosuite.runtime.GuiSupport.setHeadless(); 
+    org.evosuite.runtime.Runtime.getInstance().resetRuntime(); 
+    org.evosuite.runtime.agent.InstrumentingAgent.activate(); 
+  } 
+
+  @After 
+  public void doneWithTestCase(){ 
+    threadStopper.killAndJoinClientThreads();
+    org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); 
+    org.evosuite.runtime.classhandling.JDKClassResetter.reset(); 
+    resetClasses(); 
+    org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); 
+    org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); 
+    org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); 
+  } 
+
+  private static void initializeClasses() {
+    org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(RequestsDatabaseESTestscaffolding.class.getClassLoader() ,
+      "com.att.eelf.i18n.EELFResourceManager$RESOURCE_TYPES",
+      "com.att.eelf.configuration.EELFLogger",
+      "org.hibernate.engine.spi.Mapping",
+      "org.hibernate.criterion.Order",
+      "org.openecomp.mso.requestsdb.InfraRequests",
+      "org.openecomp.mso.requestsdb.HibernateUtil",
+      "com.att.eelf.configuration.SLF4jWrapper",
+      "org.hibernate.Query",
+      "com.att.eelf.i18n.EELFResourceManager",
+      "org.openecomp.mso.requestsdb.RequestsDatabase",
+      "org.openecomp.mso.logger.MsoLogger$ErrorCode",
+      "org.hibernate.criterion.Criterion",
+      "org.openecomp.mso.requestsdb.InfraActiveRequests",
+      "org.openecomp.mso.logger.MessageEnum",
+      "com.att.eelf.i18n.EELFResolvableErrorEnum",
+      "org.openecomp.mso.logger.MsoLogger$Catalog",
+      "org.openecomp.mso.logger.MsoLogger$StatusCode",
+      "org.hibernate.SessionFactory",
+      "com.att.eelf.configuration.EELFManager",
+      "com.att.eelf.i18n.EELFMsgs",
+      "org.openecomp.mso.entity.MsoRequest",
+      "com.att.eelf.configuration.EELFLogger$Level",
+      "org.hibernate.BasicQueryContract",
+      "org.openecomp.mso.logger.MsoLogger$ResponseCode",
+      "org.openecomp.mso.requestsdb.MockRequestsDatabase",
+      "org.openecomp.mso.requestsdb.SiteStatus",
+      "org.openecomp.mso.logger.MsoLogger"
+    );
+  } 
+
+  private static void resetClasses() {
+    org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(RequestsDatabaseESTestscaffolding.class.getClassLoader()); 
+
+    org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
+      "com.att.eelf.i18n.EELFResourceManager",
+      "org.openecomp.mso.logger.MessageEnum",
+      "org.openecomp.mso.logger.MsoLogger$Catalog",
+      "org.openecomp.mso.logger.MsoLogger",
+      "com.att.eelf.i18n.EELFMsgs",
+      "com.att.eelf.i18n.EELFResourceManager$RESOURCE_TYPES",
+      "com.att.eelf.configuration.EELFLogger$Level",
+      "com.att.eelf.configuration.EELFManager",
+      "org.openecomp.mso.logger.MsoLogger$ErrorCode",
+      "org.openecomp.mso.requestsdb.HibernateUtil",
+      "org.openecomp.mso.logger.MsoLogger$StatusCode",
+      "org.openecomp.mso.logger.MsoLogger$ResponseCode",
+      "org.openecomp.mso.requestsdb.RequestsDatabase"
+    );
+  }
+}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/SiteStatusESTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/SiteStatusESTest.java
new file mode 100644
index 0000000..75d7b19
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/SiteStatusESTest.java
@@ -0,0 +1,91 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Wed Dec 14 15:16:15 GMT 2016
+ */
+
+package org.openecomp.mso.requestsdb;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+import java.sql.Timestamp;
+import java.time.Instant;
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.evosuite.runtime.mock.java.time.MockInstant;
+import org.junit.runner.RunWith;
+import org.openecomp.mso.requestsdb.SiteStatus;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class SiteStatusESTest extends SiteStatusESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test0()  throws Throwable  {
+      SiteStatus siteStatus0 = new SiteStatus();
+      siteStatus0.setSiteName("h8w;`)o;(SRi+0Q-");
+      String string0 = siteStatus0.getSiteName();
+      assertEquals("h8w;`)o;(SRi+0Q-", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test1()  throws Throwable  {
+      SiteStatus siteStatus0 = new SiteStatus();
+      siteStatus0.setSiteName("");
+      String string0 = siteStatus0.getSiteName();
+      assertEquals("", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test2()  throws Throwable  {
+      SiteStatus siteStatus0 = new SiteStatus();
+      Timestamp timestamp0 = new Timestamp((-1L));
+      siteStatus0.setCreated(timestamp0);
+      Timestamp timestamp1 = siteStatus0.getCreated();
+      assertSame(timestamp1, timestamp0);
+  }
+
+  @Test(timeout = 4000)
+  public void test3()  throws Throwable  {
+      SiteStatus siteStatus0 = new SiteStatus();
+      Instant instant0 = MockInstant.ofEpochSecond(5121L);
+      Timestamp timestamp0 = Timestamp.from(instant0);
+      siteStatus0.setCreated(timestamp0);
+      Timestamp timestamp1 = siteStatus0.getCreated();
+      assertEquals(0, timestamp1.getNanos());
+  }
+
+  @Test(timeout = 4000)
+  public void test4()  throws Throwable  {
+      SiteStatus siteStatus0 = new SiteStatus();
+      boolean boolean0 = siteStatus0.getStatus();
+      assertFalse(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test5()  throws Throwable  {
+      SiteStatus siteStatus0 = new SiteStatus();
+      String string0 = siteStatus0.getSiteName();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test6()  throws Throwable  {
+      SiteStatus siteStatus0 = new SiteStatus();
+      siteStatus0.setStatus(true);
+      boolean boolean0 = siteStatus0.getStatus();
+      assertTrue(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test7()  throws Throwable  {
+      SiteStatus siteStatus0 = new SiteStatus();
+      String string0 = siteStatus0.toString();
+      assertEquals("SiteStatus{status=false, siteName='null', created=null}", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test8()  throws Throwable  {
+      SiteStatus siteStatus0 = new SiteStatus();
+      Timestamp timestamp0 = siteStatus0.getCreated();
+      assertNull(timestamp0);
+  }
+}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/SiteStatusESTestscaffolding.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/SiteStatusESTestscaffolding.java
new file mode 100644
index 0000000..2d50450
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/SiteStatusESTestscaffolding.java
@@ -0,0 +1,105 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Wed Dec 14 15:16:15 GMT 2016
+ */
+
+package org.openecomp.mso.requestsdb;
+
+import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
+import org.junit.BeforeClass;
+import org.junit.Before;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.evosuite.runtime.sandbox.Sandbox;
+import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
+
+@EvoSuiteClassExclude
+public class SiteStatusESTestscaffolding {
+
+  @org.junit.Rule 
+  public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
+
+  private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); 
+
+  private org.evosuite.runtime.thread.ThreadStopper threadStopper =  new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
+
+  @BeforeClass 
+  public static void initEvoSuiteFramework() { 
+    org.evosuite.runtime.RuntimeSettings.className = "org.openecomp.mso.requestsdb.SiteStatus"; 
+    org.evosuite.runtime.GuiSupport.initialize(); 
+    org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; 
+    org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; 
+    org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; 
+    org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; 
+    org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); 
+    org.evosuite.runtime.classhandling.JDKClassResetter.init(); 
+    initializeClasses();
+    org.evosuite.runtime.Runtime.getInstance().resetRuntime(); 
+  } 
+
+  @AfterClass 
+  public static void clearEvoSuiteFramework(){ 
+    Sandbox.resetDefaultSecurityManager(); 
+    java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); 
+  } 
+
+  @Before 
+  public void initTestCase(){ 
+    threadStopper.storeCurrentThreads();
+    threadStopper.startRecordingTime();
+    org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); 
+    org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); 
+    org.evosuite.runtime.GuiSupport.setHeadless(); 
+    org.evosuite.runtime.Runtime.getInstance().resetRuntime(); 
+    org.evosuite.runtime.agent.InstrumentingAgent.activate(); 
+  } 
+
+  @After 
+  public void doneWithTestCase(){ 
+    threadStopper.killAndJoinClientThreads();
+    org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); 
+    org.evosuite.runtime.classhandling.JDKClassResetter.reset(); 
+    resetClasses(); 
+    org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); 
+    org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); 
+    org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); 
+  } 
+
+  private static void initializeClasses() {
+    org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(SiteStatusESTestscaffolding.class.getClassLoader() ,
+      "org.openecomp.mso.logger.MessageEnum",
+      "com.att.eelf.i18n.EELFResolvableErrorEnum",
+      "org.openecomp.mso.logger.MsoLogger$Catalog",
+      "org.openecomp.mso.logger.MsoLogger$StatusCode",
+      "com.att.eelf.i18n.EELFResourceManager$RESOURCE_TYPES",
+      "com.att.eelf.configuration.EELFManager",
+      "com.att.eelf.configuration.EELFLogger",
+      "com.att.eelf.i18n.EELFMsgs",
+      "org.openecomp.mso.entity.MsoRequest",
+      "com.att.eelf.configuration.EELFLogger$Level",
+      "org.openecomp.mso.logger.MsoLogger$ResponseCode",
+      "com.att.eelf.configuration.SLF4jWrapper",
+      "com.att.eelf.i18n.EELFResourceManager",
+      "org.openecomp.mso.requestsdb.SiteStatus",
+      "org.openecomp.mso.logger.MsoLogger",
+      "org.openecomp.mso.logger.MsoLogger$ErrorCode"
+    );
+  } 
+
+  private static void resetClasses() {
+    org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(SiteStatusESTestscaffolding.class.getClassLoader()); 
+
+    org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
+      "org.openecomp.mso.logger.MsoLogger$Catalog",
+      "org.openecomp.mso.logger.MsoLogger",
+      "com.att.eelf.i18n.EELFResourceManager",
+      "com.att.eelf.i18n.EELFMsgs",
+      "com.att.eelf.i18n.EELFResourceManager$RESOURCE_TYPES",
+      "com.att.eelf.configuration.EELFLogger$Level",
+      "com.att.eelf.configuration.EELFManager",
+      "org.openecomp.mso.logger.MessageEnum",
+      "org.openecomp.mso.requestsdb.SiteStatus"
+    );
+  }
+}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapterESTest.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapterESTest.java
new file mode 100644
index 0000000..ea32389
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapterESTest.java
@@ -0,0 +1,69 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Wed Dec 14 15:14:31 GMT 2016
+ */
+
+package org.openecomp.mso.requestsdb.adapter;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+import static org.evosuite.runtime.EvoAssertions.*;
+import java.sql.Timestamp;
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.junit.runner.RunWith;
+import org.openecomp.mso.requestsdb.adapter.TimestampXMLAdapter;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class TimestampXMLAdapterESTest extends TimestampXMLAdapterESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test0()  throws Throwable  {
+      TimestampXMLAdapter timestampXMLAdapter0 = new TimestampXMLAdapter();
+      Long long0 = new Long((-3027L));
+      Timestamp timestamp0 = timestampXMLAdapter0.unmarshal(long0);
+      Long long1 = timestampXMLAdapter0.marshal(timestamp0);
+      assertTrue(long1.equals((Object)long0));
+  }
+
+  @Test(timeout = 4000)
+  public void test1()  throws Throwable  {
+      TimestampXMLAdapter timestampXMLAdapter0 = new TimestampXMLAdapter();
+      Long long0 = new Long(861L);
+      Timestamp timestamp0 = timestampXMLAdapter0.unmarshal(long0);
+      Long long1 = timestampXMLAdapter0.marshal(timestamp0);
+      assertEquals(861L, (long)long1);
+  }
+
+  @Test(timeout = 4000)
+  public void test2()  throws Throwable  {
+      TimestampXMLAdapter timestampXMLAdapter0 = new TimestampXMLAdapter();
+      try { 
+        timestampXMLAdapter0.marshal((Timestamp) null);
+        fail("Expecting exception: NullPointerException");
+      
+      } catch(NullPointerException e) {
+         //
+         // no message in exception (getMessage() returned null)
+         //
+         verifyException("org.openecomp.mso.requestsdb.adapter.TimestampXMLAdapter", e);
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test3()  throws Throwable  {
+      TimestampXMLAdapter timestampXMLAdapter0 = new TimestampXMLAdapter();
+      Timestamp timestamp0 = timestampXMLAdapter0.unmarshal((Long) null);
+      Long long0 = timestampXMLAdapter0.marshal(timestamp0);
+      assertEquals(0L, (long)long0);
+  }
+
+  @Test(timeout = 4000)
+  public void test4()  throws Throwable  {
+      TimestampXMLAdapter timestampXMLAdapter0 = new TimestampXMLAdapter();
+      Long long0 = new Long(497L);
+      Timestamp timestamp0 = timestampXMLAdapter0.unmarshal(long0);
+      Long long1 = timestampXMLAdapter0.marshal(timestamp0);
+      assertEquals(497L, (long)long1);
+  }
+}
diff --git a/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapterESTestscaffolding.java b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapterESTestscaffolding.java
new file mode 100644
index 0000000..0fdfcd2
--- /dev/null
+++ b/mso-api-handlers/mso-requests-db/src/test/java/org/openecomp/mso/requestsdb/adapter/TimestampXMLAdapterESTestscaffolding.java
@@ -0,0 +1,77 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Wed Dec 14 15:14:31 GMT 2016
+ */
+
+package org.openecomp.mso.requestsdb.adapter;
+
+import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
+import org.junit.BeforeClass;
+import org.junit.Before;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.evosuite.runtime.sandbox.Sandbox;
+import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
+
+@EvoSuiteClassExclude
+public class TimestampXMLAdapterESTestscaffolding {
+
+  @org.junit.Rule 
+  public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
+
+  private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); 
+
+  private org.evosuite.runtime.thread.ThreadStopper threadStopper =  new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
+
+  @BeforeClass 
+  public static void initEvoSuiteFramework() { 
+    org.evosuite.runtime.RuntimeSettings.className = "org.openecomp.mso.requestsdb.adapter.TimestampXMLAdapter"; 
+    org.evosuite.runtime.GuiSupport.initialize(); 
+    org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; 
+    org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; 
+    org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; 
+    org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; 
+    org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); 
+    org.evosuite.runtime.classhandling.JDKClassResetter.init(); 
+    initializeClasses();
+    org.evosuite.runtime.Runtime.getInstance().resetRuntime(); 
+  } 
+
+  @AfterClass 
+  public static void clearEvoSuiteFramework(){ 
+    Sandbox.resetDefaultSecurityManager(); 
+    java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); 
+  } 
+
+  @Before 
+  public void initTestCase(){ 
+    threadStopper.storeCurrentThreads();
+    threadStopper.startRecordingTime();
+    org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); 
+    org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); 
+    org.evosuite.runtime.GuiSupport.setHeadless(); 
+    org.evosuite.runtime.Runtime.getInstance().resetRuntime(); 
+    org.evosuite.runtime.agent.InstrumentingAgent.activate(); 
+  } 
+
+  @After 
+  public void doneWithTestCase(){ 
+    threadStopper.killAndJoinClientThreads();
+    org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); 
+    org.evosuite.runtime.classhandling.JDKClassResetter.reset(); 
+    resetClasses(); 
+    org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); 
+    org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); 
+    org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); 
+  } 
+
+  private static void initializeClasses() {
+    org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(TimestampXMLAdapterESTestscaffolding.class.getClassLoader() ,
+      "org.openecomp.mso.requestsdb.adapter.TimestampXMLAdapter"
+    );
+  } 
+
+  private static void resetClasses() {
+  }
+}
