diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/adapter_utils/tests/CloudConfigTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/adapter_utils/tests/CloudConfigTest.java
new file mode 100644
index 0000000..8632d02
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/adapter_utils/tests/CloudConfigTest.java
@@ -0,0 +1,173 @@
+/*-
+ * ============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.adapter_utils.tests;
+
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import java.util.Map;
+import org.openecomp.mso.cloud.CloudConfig;
+import org.openecomp.mso.cloud.CloudConfigFactory;
+import org.openecomp.mso.cloud.CloudIdentity;
+import org.openecomp.mso.cloud.CloudSite;
+
+
+/**
+ * This class implements test methods of the CloudConfig features.
+ *
+ *
+ */
+public class CloudConfigTest {
+   
+	private static CloudConfig con;
+	private static CloudConfigFactory cloudConfigFactory= new CloudConfigFactory();
+	
+	public CloudConfigTest () {
+		   
+	}
+	
+	/**
+    * This method is called before any test occurs.
+    * It creates a fake tree from scratch
+    */
+   @BeforeClass
+   public static final void prepare () {
+	   ClassLoader classLoader = CloudConfigTest.class.getClassLoader();
+	   String config = classLoader.getResource("cloud_config.json").toString().substring(5);
+	   
+	   cloudConfigFactory.initializeCloudConfig(config,1);
+	   con = cloudConfigFactory.getCloudConfig();
+   }
+ 
+   /**
+    * This method implements a test for the getCloudConfig method.
+    */
+   @Test
+   public final void testGetCloudConfig () {
+	   assertNotNull(con);
+   }
+
+   /**
+    * This method implements a test for the getCloudSites method.
+    */
+   @Test
+   public final void testGetCloudSites () {
+	   Map<String,CloudSite> siteMap = con.getCloudSites();
+	   assertNotNull(siteMap);
+
+	   CloudSite site1 = siteMap.get("MT");
+	   CloudSite site2 = siteMap.get("DAN");
+	   CloudSite site3 = siteMap.get("MTINJVCC101");
+	   
+	   assertEquals (site1.getRegionId(), "regionOne");
+	   assertEquals (site1.getIdentityServiceId(), "MT_KEYSTONE");
+	   assertEquals (site2.getRegionId(), "RegionOne");
+	   assertEquals (site2.getIdentityServiceId(), "DAN_KEYSTONE");
+	   assertEquals (site3.getRegionId(), "regionTwo");
+	   assertEquals (site3.getIdentityServiceId(), "MTINJVCC101_DCP");
+	 
+   }
+   
+   
+   /**
+    * This method implements a test for the getIdentityServices method.
+    */
+   @Test
+   public final void testGetIdentityServices () {
+	   Map<String,CloudIdentity> identityMap = con.getIdentityServices ();
+	   assertNotNull(identityMap);
+	   
+	   CloudIdentity identity1 = identityMap.get("MT_KEYSTONE");
+	   CloudIdentity identity2 = identityMap.get("DAN_KEYSTONE");
+	   CloudIdentity identity3 = identityMap.get("MTINJVCC101_DCP");
+	   CloudIdentity identity4 = identityMap.get("MTSNJA3DCP1");
+	   
+//	   assertEquals (identity1.getKeystoneUrl(), "http://localhost:5000/v2.0");
+//	   assertEquals (identity1.getIdentityUrl(), "http://localhost:5000/v2.0");
+	   assertEquals (identity1.getMsoId(), "john");
+	   assertEquals (identity1.getMsoPass(), "changeme");
+	   assertEquals (identity1.getAdminTenant(), "admin");
+	   assertEquals (identity1.getMemberRole(), "_member_");
+	   assertEquals (identity1.hasTenantMetadata(), false);
+	   
+//	   assertEquals (identity2.getKeystoneUrl(), "http://localhost:5000/v2.0");
+//	   assertEquals (identity2.getIdentityUrl(), "http://localhost:5000/v2.0");
+	   assertEquals (identity2.getMsoId(), "mockId");
+	   assertEquals (identity2.getMsoPass(), "stack123");
+	   assertEquals (identity2.getAdminTenant(), "service");
+	   assertEquals (identity2.getMemberRole(), "_member_");
+	   assertEquals (identity2.hasTenantMetadata(), false);
+	   
+//	   assertEquals (identity3.getKeystoneUrl(), "http://localhost:5000/v2.0");
+//	   assertEquals (identity3.getIdentityUrl(), "http://localhost:5000/v2.0");
+	   assertEquals (identity3.getMsoId(), "mockIdToo");
+	   assertEquals (identity3.getMsoPass(), "AICG@mm@@2015");
+	   assertEquals (identity3.getAdminTenant(), "service");
+	   assertEquals (identity3.getMemberRole(), "admin");
+	   assertEquals (identity3.hasTenantMetadata(), true);
+	   
+//	   assertEquals (identity4.getKeystoneUrl(), "https://localhost:5000/v2.0");
+//	   assertEquals (identity4.getIdentityUrl(), "https://localhost:5000/v2.0");
+	   assertEquals (identity4.getMsoId(), "mockIdToo");
+	   assertEquals (identity4.getMsoPass(), "2315QRS2015srq");
+	   assertEquals (identity4.getAdminTenant(), "service");
+	   assertEquals (identity4.getMemberRole(), "admin");
+	   assertEquals (identity4.hasTenantMetadata(), true);
+
+   }
+   
+   /**
+    * This method implements a test for the getCloudSite method.
+    */
+   @Test
+   public final void testGetCloudSite () {
+	   CloudSite site1  = con.getCloudSite("MT");
+	   assertNotNull(site1);
+	   assertEquals (site1.getRegionId(), "regionOne");
+	   assertEquals (site1.getIdentityServiceId(), "MT_KEYSTONE");
+	   
+	 
+
+   }
+
+   /**
+    * This method implements a test for the getIdentityService method.
+    */
+   @Test
+   public final void testGetIdentityService () {
+	   CloudIdentity identity1  = con.getIdentityService("MT_KEYSTONE");
+	   assertNotNull(identity1);
+//	   assertEquals (identity1.getKeystoneUrl(), "http://localhost:5000/v2.0");
+//	   assertEquals (identity1.getIdentityUrl(), "http://localhost:5000/v2.0");
+	   assertEquals (identity1.getMsoId(), "john");
+	   assertEquals (identity1.getMsoPass(), "changeme");
+	   assertEquals (identity1.getAdminTenant(), "admin");
+	   assertEquals (identity1.getMemberRole(), "_member_");
+	   assertEquals (identity1.hasTenantMetadata(), false);
+	   
+	   CloudIdentity identity2  = con.getIdentityService("Test");
+	   assertNull(identity2);
+   }
+
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoCommonUtilsTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoCommonUtilsTest.java
new file mode 100644
index 0000000..9f17283
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoCommonUtilsTest.java
@@ -0,0 +1,130 @@
+/*-
+ * ============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.adapter_utils.tests;
+
+
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+import org.openecomp.mso.logger.MsoAlarmLogger;
+import org.openecomp.mso.openstack.exceptions.MsoAdapterException;
+import org.openecomp.mso.openstack.exceptions.MsoException;
+import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory;
+import org.openecomp.mso.openstack.exceptions.MsoIOException;
+import org.openecomp.mso.openstack.exceptions.MsoOpenstackException;
+import org.openecomp.mso.openstack.utils.MsoCommonUtils;
+import org.openecomp.mso.properties.MsoJavaProperties;
+import org.openecomp.mso.properties.MsoPropertiesException;
+import org.openecomp.mso.properties.MsoPropertiesFactory;
+import com.woorea.openstack.base.client.OpenStackBaseException;
+import com.woorea.openstack.base.client.OpenStackConnectException;
+import com.woorea.openstack.base.client.OpenStackRequest;
+import com.woorea.openstack.base.client.OpenStackResponseException;
+
+
+/**
+ * This class implements test methods of the MsoCommonUtils
+ *
+ *
+ */
+public class MsoCommonUtilsTest extends MsoCommonUtils {
+
+	public static MsoPropertiesFactory msoPropertiesFactory = new MsoPropertiesFactory();
+	
+	@Test
+    public final void testExecuteAndRecordOpenstackRequest () {
+		OpenStackRequest openstackRequest = Mockito.mock(OpenStackRequest.class);
+		Mockito.when(openstackRequest.endpoint()).thenReturn("localhost");
+		Mockito.when(openstackRequest.path()).thenReturn("/test");
+		//TODO:Must try a real connection
+		assertNull(super.executeAndRecordOpenstackRequest (openstackRequest));
+
+	}
+
+	@Test
+    public final void testKeystoneErrorToMsoException () {
+		OpenStackBaseException openStackConnectException = new OpenStackConnectException("connect");
+
+		OpenStackBaseException openStackResponseException = new OpenStackResponseException("response",1);
+
+		MsoException me = super.keystoneErrorToMsoException (openStackConnectException,"ContextError");
+
+		assertTrue(me instanceof MsoIOException);
+		assertTrue("connect".equals(me.getMessage()));
+
+
+		MsoException me2 = super.keystoneErrorToMsoException (openStackResponseException,"ContextError");
+		assertTrue(me2 instanceof MsoOpenstackException);
+		assertTrue("ContextError".equals(me2.getContext()));
+		assertTrue(MsoExceptionCategory.OPENSTACK.equals(me2.getCategory()));
+
+	}
+
+	@Test
+	public final void testHeatExceptionToMsoException () {
+		OpenStackBaseException openStackConnectException = new OpenStackConnectException("connect");
+
+		OpenStackBaseException openStackResponseException = new OpenStackResponseException("response",1);
+
+		MsoException me = super.heatExceptionToMsoException (openStackConnectException,"ContextError");
+
+		assertTrue(me instanceof MsoIOException);
+		assertTrue("connect".equals(me.getMessage()));
+
+
+		MsoException me2 = super.heatExceptionToMsoException (openStackResponseException,"ContextError");
+		assertTrue(me2 instanceof MsoOpenstackException);
+		assertTrue("ContextError".equals(me2.getContext()));
+		assertTrue(MsoExceptionCategory.OPENSTACK.equals(me2.getCategory()));
+	}
+
+	@Test
+	public final void testNeutronExceptionToMsoException () {
+		OpenStackBaseException openStackConnectException = new OpenStackConnectException("connect");
+
+		OpenStackBaseException openStackResponseException = new OpenStackResponseException("response",1);
+
+		MsoException me = super.neutronExceptionToMsoException (openStackConnectException,"ContextError");
+
+		assertTrue(me instanceof MsoIOException);
+		assertTrue("connect".equals(me.getMessage()));
+
+		MsoException me2 = super.neutronExceptionToMsoException (openStackResponseException,"ContextError");
+		assertTrue(me2 instanceof MsoOpenstackException);
+		assertTrue("ContextError".equals(me2.getContext()));
+		assertTrue(MsoExceptionCategory.OPENSTACK.equals(me2.getCategory()));
+	}
+
+	@Test
+	public final void testRuntimeExceptionToMsoException () {
+	    RuntimeException re = new RuntimeException ("runtime");
+	    MsoException me = super.runtimeExceptionToMsoException (re, "ContextError");
+
+	    assertTrue (me instanceof MsoAdapterException);
+	    assertTrue("ContextError".equals(me.getContext()));
+        assertTrue(MsoExceptionCategory.INTERNAL.equals(me.getCategory()));
+	}
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoHeatUtilsTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoHeatUtilsTest.java
new file mode 100644
index 0000000..6f8a6e9
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoHeatUtilsTest.java
@@ -0,0 +1,91 @@
+/*-
+ * ============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.adapter_utils.tests;
+
+import java.util.HashMap;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import org.openecomp.mso.cloud.CloudConfigFactory;
+import org.openecomp.mso.openstack.exceptions.MsoAdapterException;
+import org.openecomp.mso.openstack.exceptions.MsoCloudSiteNotFound;
+import org.openecomp.mso.openstack.exceptions.MsoException;
+import org.openecomp.mso.openstack.exceptions.MsoIOException;
+import org.openecomp.mso.openstack.exceptions.MsoStackAlreadyExists;
+import org.openecomp.mso.openstack.exceptions.MsoTenantNotFound;
+import org.openecomp.mso.openstack.utils.MsoCommonUtils;
+import org.openecomp.mso.openstack.utils.MsoHeatUtils;
+import org.openecomp.mso.properties.MsoPropertiesFactory;
+
+
+
+/**
+ * This class implements test methods of the MsoHeatUtils
+ *
+ *
+ */
+public class MsoHeatUtilsTest extends MsoCommonUtils {
+	public static MsoPropertiesFactory msoPropertiesFactory = new MsoPropertiesFactory();
+	public static CloudConfigFactory cloudConfigFactory = new CloudConfigFactory();
+	public static MsoHeatUtils msoHeatUtils;
+	
+	@BeforeClass
+	public static final void loadClasses() {
+		ClassLoader classLoader = CloudConfigTest.class.getClassLoader();
+		String config = classLoader.getResource("cloud_config.json").toString().substring(5);
+		cloudConfigFactory.initializeCloudConfig(config, 1);
+		msoHeatUtils = new MsoHeatUtils("NO_PROP",msoPropertiesFactory,cloudConfigFactory); 
+	}
+	
+	@Test
+    public final void testCreateStackBadCloudConfig ()  {
+		try {
+			msoHeatUtils.createStack ("DOESNOTEXIST", "test", "stackName", "test",  new HashMap<String,Object> (), Boolean.TRUE, 10);
+        } catch (MsoException e) {
+
+        }
+		
+	}
+	
+	@Test
+    public final void testCreateStackFailedConnectionHeatClient () throws MsoStackAlreadyExists, MsoTenantNotFound, MsoException, MsoCloudSiteNotFound {
+		try {
+			msoHeatUtils.createStack ("MT", "test", "stackName", "test",  new HashMap<String,Object> (), Boolean.TRUE, 10);
+		} catch (MsoIOException e) {
+			 
+		}
+		
+	}
+	
+	@Test
+    public final void testCreateStackFailedConnection () throws MsoStackAlreadyExists, MsoTenantNotFound, MsoException, MsoCloudSiteNotFound {
+		try {
+			msoHeatUtils.createStack ("MT", "test", "stackName", "test",  new HashMap<String,Object> (), Boolean.TRUE, 10);
+		} catch (MsoIOException e) {
+			 
+		}
+		
+	}
+	
+	
+	
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoHeatUtilsWithUpdateTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoHeatUtilsWithUpdateTest.java
new file mode 100644
index 0000000..a5d46da
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/adapter_utils/tests/MsoHeatUtilsWithUpdateTest.java
@@ -0,0 +1,132 @@
+/*-
+ * ============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.adapter_utils.tests;
+
+import static org.junit.Assert.fail;
+import static org.mockito.Mockito.when;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+
+import org.openecomp.mso.cloud.CloudConfig;
+import org.openecomp.mso.cloud.CloudConfigFactory;
+import org.openecomp.mso.cloud.CloudIdentity;
+import org.openecomp.mso.cloud.CloudSite;
+import org.openecomp.mso.openstack.exceptions.MsoCloudSiteNotFound;
+import org.openecomp.mso.openstack.exceptions.MsoException;
+import org.openecomp.mso.openstack.exceptions.MsoIOException;
+import org.openecomp.mso.openstack.utils.MsoHeatUtilsWithUpdate;
+import org.openecomp.mso.properties.MsoPropertiesFactory;
+import com.woorea.openstack.base.client.OpenStackConnectException;
+
+@RunWith(MockitoJUnitRunner.class)
+public class MsoHeatUtilsWithUpdateTest {
+
+	public static MsoPropertiesFactory msoPropertiesFactory = new MsoPropertiesFactory();
+	public static CloudConfigFactory cloudConfigFactory = new CloudConfigFactory();
+	
+    @Mock
+    CloudConfig cloudConfig;
+    @InjectMocks
+    MsoHeatUtilsWithUpdate util=new MsoHeatUtilsWithUpdate("NO_PROP",msoPropertiesFactory,cloudConfigFactory);
+
+    private CloudSite cloudSite;
+
+    @Before
+    public void init () {
+        cloudSite = new CloudSite ();
+        cloudSite.setId ("cloud");
+        CloudIdentity cloudIdentity = new CloudIdentity ();
+        cloudSite.setIdentityService (cloudIdentity);
+        cloudIdentity.setKeystoneUrl ("toto");
+        cloudIdentity.setMsoPass (CloudIdentity.encryptPassword ("mockId"));
+
+        when (cloudConfig.getCloudSite ("cloud")).thenReturn (cloudSite);
+        when (cloudConfig.getCloudSite ("none")).thenReturn (null);
+    }
+
+    @Test
+    public void testUpdateStack () {
+        // Heat heat = Mockito.mock (Heat.class);
+        Map <String, Object> stackInputs = new HashMap <> ();
+        try {
+            util.updateStack ("none", "tenantId", "stackName", "heatTemplate", stackInputs, false, 1);
+        } catch (MsoException e) {
+            if (e instanceof MsoCloudSiteNotFound) {
+                // Ok
+            } else {
+                e.printStackTrace ();
+                fail ("Exception caught");
+            }
+        }
+        try {
+            util.updateStack ("cloud", "tenantId", "stackName", "heatTemplate", stackInputs, false, 1);
+        } catch (MsoException e) {
+            if (e instanceof MsoIOException && e.getCause () != null
+                && e.getCause () instanceof OpenStackConnectException) {
+                // Ok, we were able to go up to the connection to OpenStack
+            } else {
+                e.printStackTrace ();
+                fail ("Exception caught");
+            }
+        }
+        try {
+            util.updateStack ("cloud", "tenantId", "stackName", "heatTemplate", stackInputs, false, 1, "environment");
+        } catch (MsoException e) {
+            if (e instanceof MsoIOException && e.getCause () != null
+                && e.getCause () instanceof OpenStackConnectException) {
+                // Ok, we were able to go up to the connection to OpenStack
+            } else {
+                e.printStackTrace ();
+                fail ("Exception caught");
+            }
+        }
+        try {
+            util.updateStack ("cloud", "tenantId", "stackName", "heatTemplate", stackInputs, false, 1, "environment", null);
+        } catch (MsoException e) {
+            if (e instanceof MsoIOException && e.getCause () != null
+                && e.getCause () instanceof OpenStackConnectException) {
+                // Ok, we were able to go up to the connection to OpenStack
+            } else {
+                e.printStackTrace ();
+                fail ("Exception caught");
+            }
+        }
+        try {
+            util.updateStack ("cloud", "tenantId", "stackName", "heatTemplate", stackInputs, false, 1, "environment", null, null);
+        } catch (MsoException e) {
+            if (e instanceof MsoIOException && e.getCause () != null
+                && e.getCause () instanceof OpenStackConnectException) {
+                // Ok, we were able to go up to the connection to OpenStack
+            } else {
+                e.printStackTrace ();
+                fail ("Exception caught");
+            }
+        }
+    }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/cloud/CloudIdentityESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/cloud/CloudIdentityESTest.java
new file mode 100644
index 0000000..69fbb26
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/cloud/CloudIdentityESTest.java
@@ -0,0 +1,400 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Mon Nov 14 08:37:20 GMT 2016
+ */
+
+package org.openecomp.mso.cloud;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+import static org.evosuite.runtime.EvoAssertions.*;
+
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.evosuite.runtime.PrivateAccess;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true)
+public class CloudIdentityESTest {
+
+  @Test(timeout = 4000)
+  public void test00()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudIdentity0.setMsoId("ga-cj*/");
+      cloudIdentity0.hashCode();
+  }
+
+  @Test(timeout = 4000)
+  public void test01()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudIdentity0.setTenantMetadata(true);
+      boolean boolean0 = cloudIdentity0.hasTenantMetadata();
+      assertTrue(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test02()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudIdentity0.setMsoPass("");
+      String string0 = cloudIdentity0.getMsoPass();
+      assertEquals("", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test03()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudIdentity0.setMsoId("hz4IjQ&in.t^IC|");
+      String string0 = cloudIdentity0.getMsoId();
+      assertEquals("hz4IjQ&in.t^IC|", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test04()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudIdentity0.setMemberRole("Exception in encryptPassword");
+      String string0 = cloudIdentity0.getMemberRole();
+      assertEquals("Exception in encryptPassword", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test05()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudIdentity0.setIdentityUrl("ASDC_ARTIFACT_ALREADY_DEPLOYED");
+      String string0 = cloudIdentity0.getIdentityUrl();
+      assertEquals("ASDC_ARTIFACT_ALREADY_DEPLOYED", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test06()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      CloudIdentity.IdentityServerType cloudIdentity_IdentityServerType0 = CloudIdentity.IdentityServerType.KEYSTONE;
+      PrivateAccess.setVariable((Class<CloudIdentity>) CloudIdentity.class, cloudIdentity0, "identityServerType", (Object) cloudIdentity_IdentityServerType0);
+      String string0 = cloudIdentity0.getIdentityServerTypeAsString();
+      assertEquals("KEYSTONE", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test07()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudIdentity0.setId("");
+      String string0 = cloudIdentity0.getId();
+      assertEquals("", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test08()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudIdentity0.setAdminTenant("0hh5nz?kd3N,FTKBX");
+      String string0 = cloudIdentity0.getAdminTenant();
+      assertEquals("0hh5nz?kd3N,FTKBX", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test09()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudIdentity0.setTenantMetadata(true);
+      CloudIdentity cloudIdentity1 = cloudIdentity0.clone();
+      assertTrue(cloudIdentity1.equals((Object)cloudIdentity0));
+      assertTrue(cloudIdentity1.hasTenantMetadata());
+      assertNotSame(cloudIdentity1, cloudIdentity0);
+  }
+
+  @Test(timeout = 4000)
+  public void test10()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudIdentity0.setTenantMetadata(false);
+      CloudIdentity cloudIdentity1 = cloudIdentity0.clone();
+      assertFalse(cloudIdentity1.hasTenantMetadata());
+      assertTrue(cloudIdentity1.equals((Object)cloudIdentity0));
+      assertNotSame(cloudIdentity1, cloudIdentity0);
+  }
+
+  @Test(timeout = 4000)
+  public void test11()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudIdentity0.setMsoPass("0LAxuQ0#K,Ma");
+      // Undeclared exception!
+      try {
+        cloudIdentity0.getMsoPass();
+        fail("Expecting exception: NumberFormatException");
+
+      } catch(NumberFormatException e) {
+         //
+         // For input string: \"0L\"
+         //
+         verifyException("java.lang.NumberFormatException", e);
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test12()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      // Undeclared exception!
+      try {
+        cloudIdentity0.getKeystoneUrl();
+        fail("Expecting exception: NullPointerException");
+
+      } catch(NullPointerException e) {
+         //
+         // no message in exception (getMessage() returned null)
+         //
+         verifyException("org.openecomp.mso.cloud.CloudIdentity", e);
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test13()  throws Throwable  {
+      // Undeclared exception!
+      try {
+        CloudIdentity.encryptPassword((String) null);
+        fail("Expecting exception: NullPointerException");
+
+      } catch(NullPointerException e) {
+         //
+         // no message in exception (getMessage() returned null)
+         //
+         verifyException("org.openecomp.mso.utils.CryptoUtils", e);
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test14()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      CloudIdentity cloudIdentity1 = cloudIdentity0.clone();
+      assertTrue(cloudIdentity1.equals((Object)cloudIdentity0));
+
+      PrivateAccess.setVariable((Class<CloudIdentity>) CloudIdentity.class, cloudIdentity1, "msoPass", (Object) "0~=?Wm,~42b4:K");
+      boolean boolean0 = cloudIdentity0.equals(cloudIdentity1);
+      assertFalse(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test15()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudIdentity0.setMemberRole("r");
+      CloudIdentity cloudIdentity1 = new CloudIdentity();
+      boolean boolean0 = cloudIdentity0.equals(cloudIdentity1);
+      assertFalse(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test16()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      CloudIdentity cloudIdentity1 = cloudIdentity0.clone();
+      assertTrue(cloudIdentity1.equals((Object)cloudIdentity0));
+
+      cloudIdentity1.setMemberRole("RA_SET_CALLBACK_AUTH_EXC");
+      boolean boolean0 = cloudIdentity0.equals(cloudIdentity1);
+      assertFalse(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test17()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudIdentity0.setMemberRole("r");
+      CloudIdentity cloudIdentity1 = cloudIdentity0.clone();
+      boolean boolean0 = cloudIdentity0.equals(cloudIdentity1);
+      assertNotSame(cloudIdentity1, cloudIdentity0);
+      assertTrue(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test18()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      Object object0 = new Object();
+      boolean boolean0 = cloudIdentity0.equals(object0);
+      assertFalse(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test19()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      boolean boolean0 = cloudIdentity0.equals((Object) null);
+      assertFalse(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test20()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      boolean boolean0 = cloudIdentity0.equals(cloudIdentity0);
+      assertTrue(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test22()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudIdentity0.setMsoPass("9Y#4-v1Fu27keLW");
+      cloudIdentity0.hashCode();
+  }
+
+  @Test(timeout = 4000)
+  public void test23()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudIdentity0.setMemberRole("ASDC_GENERAL_METRICS");
+      cloudIdentity0.hashCode();
+  }
+
+  @Test(timeout = 4000)
+  public void test24()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudIdentity0.setIdentityUrl("g9+j0@{H}S|");
+      cloudIdentity0.hashCode();
+  }
+
+  @Test(timeout = 4000)
+  public void test25()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudIdentity0.setId("FSmZDF:2*!OtMq!i");
+      cloudIdentity0.hashCode();
+  }
+
+  @Test(timeout = 4000)
+  public void test26()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudIdentity0.setKeystoneUrl("VdON&(o*x/W!");
+      assertNull(cloudIdentity0.getMemberRole());
+  }
+
+  @Test(timeout = 4000)
+  public void test27()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      String string0 = cloudIdentity0.getKeystoneUrl("A9Z Ol `I1^y]F[EC0", "");
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test28()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      String string0 = cloudIdentity0.getMemberRole();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test29()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      // Undeclared exception!
+      try {
+        cloudIdentity0.getIdentityServerTypeAsString();
+        fail("Expecting exception: NullPointerException");
+
+      } catch(NullPointerException e) {
+         //
+         // no message in exception (getMessage() returned null)
+         //
+         verifyException("org.openecomp.mso.cloud.CloudIdentity", e);
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test30()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudIdentity0.setIdentityUrl("com.att.eelf.i18n.EELFResourceManager$RESOURCE_TYPES");
+      CloudIdentity cloudIdentity1 = new CloudIdentity();
+      boolean boolean0 = cloudIdentity0.equals(cloudIdentity1);
+      assertFalse(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test31()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      String string0 = cloudIdentity0.getId();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test32()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudIdentity0.setTenantMetadata(false);
+      cloudIdentity0.hashCode();
+      assertFalse(cloudIdentity0.hasTenantMetadata());
+  }
+
+  @Test(timeout = 4000)
+  public void test34()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudIdentity0.setAdminTenant("0hh5nz?kd3N,FTKBX");
+      cloudIdentity0.hashCode();
+  }
+
+  @Test(timeout = 4000)
+  public void test35()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      String string0 = cloudIdentity0.getAdminTenant();
+      assertNull(string0);
+
+  }
+
+  @Test(timeout = 4000)
+  public void test37()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      String string0 = cloudIdentity0.getMsoId();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test38()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudIdentity0.getIdentityServerType();
+  }
+
+  @Test(timeout = 4000)
+  public void test39()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      // Undeclared exception!
+      try {
+        cloudIdentity0.getMsoPass();
+        fail("Expecting exception: NullPointerException");
+
+      } catch(NullPointerException e) {
+         //
+         // no message in exception (getMessage() returned null)
+         //
+         verifyException("org.openecomp.mso.utils.CryptoUtils", e);
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test40()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      // Undeclared exception!
+      try {
+        cloudIdentity0.toString();
+        fail("Expecting exception: NullPointerException");
+
+      } catch(NullPointerException e) {
+         //
+         // no message in exception (getMessage() returned null)
+         //
+         verifyException("org.openecomp.mso.cloud.CloudIdentity", e);
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test41()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      // Undeclared exception!
+      try {
+        cloudIdentity0.hasTenantMetadata();
+        fail("Expecting exception: NullPointerException");
+
+      } catch(NullPointerException e) {
+         //
+         // no message in exception (getMessage() returned null)
+         //
+         verifyException("org.openecomp.mso.cloud.CloudIdentity", e);
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test42()  throws Throwable  {
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      String string0 = cloudIdentity0.getIdentityUrl();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test43()  throws Throwable  {
+      String string0 = CloudIdentity.encryptPassword("jaR\"aJmqpa>(&");
+      assertEquals("718A16EDF9EA61E9350A07703082D5B5", string0);
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/cloud/CloudIdentityTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/cloud/CloudIdentityTest.java
new file mode 100644
index 0000000..377a724
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/cloud/CloudIdentityTest.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.cloud;
+
+
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+
+public class CloudIdentityTest {
+
+    @Test
+    public final void testCloudIdentity () {
+        CloudIdentity id = new CloudIdentity ();
+        id.setAdminTenant ("AdminTenant");
+        id.setId ("id");
+//        id.setKeystoneUrl ("keystone");
+        id.setIdentityUrl ("keystone");
+        id.setMemberRole ("member");
+        id.setMsoId ("msoId");
+        id.setMsoPass (CloudIdentity.encryptPassword ("password"));
+        id.setTenantMetadata (true);
+
+        assertTrue (id.getAdminTenant ().equals ("AdminTenant"));
+        assertTrue (id.getId ().equals ("id"));
+//        assertTrue (id.getKeystoneUrl ().equals ("keystone"));
+        assertTrue (id.getMemberRole ().equals ("member"));
+        assertTrue (id.getMsoId ().equals ("msoId"));
+        assertTrue (id.getMsoPass ().equals ("password"));
+        assertTrue (id.hasTenantMetadata ());
+//        assertTrue (id.toString ().contains ("keystone"));
+    }
+
+    @Test
+    public final void testEncryption () {
+        String encrypted = CloudIdentity.encryptPassword ("password");
+        assertTrue (encrypted != null);
+        assertTrue (!encrypted.equals ("password"));
+    }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/cloud/CloudSiteESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/cloud/CloudSiteESTest.java
new file mode 100644
index 0000000..68bccfc
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/cloud/CloudSiteESTest.java
@@ -0,0 +1,315 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Mon Nov 14 08:42:36 GMT 2016
+ */
+
+package org.openecomp.mso.cloud;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+import static org.evosuite.shaded.org.mockito.Mockito.*;
+import static org.evosuite.runtime.EvoAssertions.*;
+
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.evosuite.runtime.PrivateAccess;
+import org.evosuite.runtime.ViolatedAssumptionAnswer;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class CloudSiteESTest extends CloudSiteESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test00()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      cloudSite0.setAic_version("-t");
+      cloudSite0.hashCode();
+  }
+
+  @Test(timeout = 4000)
+  public void test01()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      cloudSite0.setRegionId("CloudSite: id=");
+      String string0 = cloudSite0.getRegionId();
+      assertEquals("CloudSite: id=", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test02()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      cloudSite0.setRegionId("");
+      String string0 = cloudSite0.getRegionId();
+      assertEquals("", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test03()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      PrivateAccess.setVariable((Class<CloudSite>) CloudSite.class, cloudSite0, "identityServiceId", (Object) "PUBLIC");
+      String string0 = cloudSite0.getIdentityServiceId();
+      assertEquals("PUBLIC", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test04()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudSite0.setIdentityService(cloudIdentity0);
+      cloudIdentity0.setTenantMetadata(false);
+      CloudIdentity cloudIdentity1 = cloudSite0.getIdentityService();
+      assertNull(cloudIdentity1.getAdminTenant());
+  }
+
+  @Test(timeout = 4000)
+  public void test05()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      cloudSite0.setId("");
+      String string0 = cloudSite0.getId();
+      assertEquals("", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test06()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      cloudSite0.setClli("N;w7*-)9\"t|T/jCa");
+      String string0 = cloudSite0.getClli();
+      assertEquals("N;w7*-)9\"t|T/jCa", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test07()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      cloudSite0.setClli("");
+      String string0 = cloudSite0.getClli();
+      assertEquals("", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test08()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      cloudSite0.setAic_version("v&K[by0");
+      String string0 = cloudSite0.getAic_version();
+      assertEquals("v&K[by0", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test09()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      cloudSite0.setAic_version("");
+      String string0 = cloudSite0.getAic_version();
+      assertEquals("", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test10()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      CloudIdentity cloudIdentity0 = mock(CloudIdentity.class, new ViolatedAssumptionAnswer());
+      doReturn((CloudIdentity) null).when(cloudIdentity0).clone();
+      cloudSite0.setIdentityService(cloudIdentity0);
+      CloudSite cloudSite1 = cloudSite0.clone();
+      boolean boolean0 = cloudSite0.equals(cloudSite1);
+      assertFalse(boolean0);
+      assertFalse(cloudSite1.equals((Object)cloudSite0));
+  }
+
+  @Test(timeout = 4000)
+  public void test11()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      CloudSite cloudSite1 = new CloudSite();
+      assertTrue(cloudSite1.equals((Object)cloudSite0));
+      
+      cloudSite1.setClli("CloudSite: id=null, regionId=null, identityServiceId=null, aic_version=null, clli=null");
+      boolean boolean0 = cloudSite0.equals(cloudSite1);
+      assertFalse(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test12()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudSite0.setIdentityService(cloudIdentity0);
+      CloudSite cloudSite1 = cloudSite0.clone();
+      assertTrue(cloudSite1.equals((Object)cloudSite0));
+      
+      cloudSite1.setAic_version("");
+      boolean boolean0 = cloudSite0.equals(cloudSite1);
+      assertFalse(cloudSite1.equals((Object)cloudSite0));
+      assertFalse(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test13()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudSite0.setIdentityService(cloudIdentity0);
+      CloudSite cloudSite1 = cloudSite0.clone();
+      boolean boolean0 = cloudSite0.equals(cloudSite1);
+      assertNotSame(cloudSite1, cloudSite0);
+      assertTrue(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test14()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      cloudSite0.setRegionId("CloudSite: id=null, regionId=null, identityServiceId=null, aic_version=null, clli=null");
+      CloudSite cloudSite1 = new CloudSite();
+      boolean boolean0 = cloudSite0.equals(cloudSite1);
+      assertFalse(cloudSite1.equals((Object)cloudSite0));
+      assertFalse(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test15()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudSite0.setIdentityService(cloudIdentity0);
+      CloudSite cloudSite1 = cloudSite0.clone();
+      assertTrue(cloudSite1.equals((Object)cloudSite0));
+      
+      cloudSite1.setId("Tx;$hjj");
+      boolean boolean0 = cloudSite1.equals(cloudSite0);
+      assertFalse(boolean0);
+      assertFalse(cloudSite1.equals((Object)cloudSite0));
+  }
+
+  @Test(timeout = 4000)
+  public void test16()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      Object object0 = new Object();
+      boolean boolean0 = cloudSite0.equals(object0);
+      assertFalse(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test17()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      boolean boolean0 = cloudSite0.equals((Object) null);
+      assertFalse(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test18()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      boolean boolean0 = cloudSite0.equals(cloudSite0);
+      assertTrue(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test19()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      PrivateAccess.setVariable((Class<CloudSite>) CloudSite.class, cloudSite0, "identityServiceId", (Object) "");
+      CloudSite cloudSite1 = new CloudSite();
+      boolean boolean0 = cloudSite0.equals(cloudSite1);
+      assertFalse(boolean0);
+      assertFalse(cloudSite1.equals((Object)cloudSite0));
+  }
+
+  @Test(timeout = 4000)
+  public void test20()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      PrivateAccess.setVariable((Class<CloudSite>) CloudSite.class, cloudSite0, "clli", (Object) "AgBkO0S\"V'R'");
+      cloudSite0.hashCode();
+  }
+
+  @Test(timeout = 4000)
+  public void test21()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      PrivateAccess.setVariable((Class<CloudSite>) CloudSite.class, cloudSite0, "regionId", (Object) "`V+.b PU'3:EbS");
+      cloudSite0.hashCode();
+  }
+
+  @Test(timeout = 4000)
+  public void test22()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      PrivateAccess.setVariable((Class<CloudSite>) CloudSite.class, cloudSite0, "identityServiceId", (Object) "PUBLIC");
+      cloudSite0.hashCode();
+  }
+
+  @Test(timeout = 4000)
+  public void test23()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      PrivateAccess.setVariable((Class<CloudSite>) CloudSite.class, cloudSite0, "id", (Object) "PUBLIC");
+      cloudSite0.hashCode();
+  }
+
+  @Test(timeout = 4000)
+  public void test24()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      String string0 = cloudSite0.getIdentityServiceId();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test25()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      String string0 = cloudSite0.toString();
+      assertEquals("CloudSite: id=null, regionId=null, identityServiceId=null, aic_version=null, clli=null", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test26()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      String string0 = cloudSite0.getAic_version();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test27()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      CloudIdentity cloudIdentity0 = new CloudIdentity();
+      cloudSite0.setIdentityService(cloudIdentity0);
+      cloudSite0.hashCode();
+  }
+
+  @Test(timeout = 4000)
+  public void test28()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      String string0 = cloudSite0.getClli();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test29()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      String string0 = cloudSite0.getId();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test30()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      String string0 = cloudSite0.getRegionId();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test31()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      cloudSite0.setId("Tx;$hjj");
+      String string0 = cloudSite0.getId();
+      assertEquals("Tx;$hjj", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test32()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      CloudIdentity cloudIdentity0 = cloudSite0.getIdentityService();
+      assertNull(cloudIdentity0);
+  }
+
+  @Test(timeout = 4000)
+  public void test33()  throws Throwable  {
+      CloudSite cloudSite0 = new CloudSite();
+      // Undeclared exception!
+      try { 
+        cloudSite0.clone();
+        fail("Expecting exception: NullPointerException");
+      
+      } catch(NullPointerException e) {
+         //
+         // no message in exception (getMessage() returned null)
+         //
+         verifyException("org.openecomp.mso.cloud.CloudSite", e);
+      }
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/cloud/CloudSiteESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/cloud/CloudSiteESTestscaffolding.java
new file mode 100644
index 0000000..48e800f
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/cloud/CloudSiteESTestscaffolding.java
@@ -0,0 +1,150 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Mon Nov 14 08:42:36 GMT 2016
+ */
+
+package org.openecomp.mso.cloud;
+
+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;
+
+@EvoSuiteClassExclude
+public class CloudSiteESTestscaffolding {
+
+  @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.cloud.CloudSite"; 
+    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(CloudSiteESTestscaffolding.class.getClassLoader() ,
+      "org.openecomp.mso.logger.MsoLogger",
+      "org.openecomp.mso.logger.MessageEnum",
+      "com.att.eelf.i18n.EELFResolvableErrorEnum",
+      "org.openecomp.mso.logger.MsoLogger$ResponseCode",
+      "org.openecomp.mso.entity.MsoRequest",
+      "org.openecomp.mso.cloud.CloudSite",
+      "org.openecomp.mso.logger.MsoLogger$StatusCode",
+      "com.att.eelf.i18n.EELFResourceManager$RESOURCE_TYPES",
+      "com.att.eelf.configuration.EELFManager",
+      "org.openecomp.mso.cloud.CloudIdentity$IdentityServerType",
+      "org.openecomp.mso.logger.MsoLogger$ErrorCode",
+      "com.att.eelf.configuration.EELFLogger",
+      "com.att.eelf.i18n.EELFMsgs",
+      "org.openecomp.mso.openstack.exceptions.MsoException",
+      "com.att.eelf.configuration.EELFLogger$Level",
+      "org.openecomp.mso.logger.MsoLogger$Catalog",
+      "com.att.eelf.configuration.SLF4jWrapper",
+      "com.att.eelf.i18n.EELFResourceManager",
+      "org.openecomp.mso.cloud.CloudIdentity"
+    );
+  } 
+
+  private static void resetClasses() {
+    org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(CloudSiteESTestscaffolding.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",
+      "org.apache.xerces.jaxp.SAXParserFactoryImpl",
+      "org.apache.xerces.jaxp.SAXParserImpl",
+      "org.apache.xerces.parsers.XMLParser",
+      "org.apache.xerces.parsers.AbstractSAXParser",
+      "org.apache.xerces.parsers.SAXParser",
+      "org.apache.xerces.parsers.ObjectFactory",
+      "org.apache.xerces.util.ParserConfigurationSettings",
+      "org.apache.xerces.parsers.XML11Configuration",
+      "org.apache.xerces.parsers.XIncludeAwareParserConfiguration",
+      "org.apache.xerces.util.SymbolTable",
+      "org.apache.xerces.impl.XMLEntityManager",
+      "org.apache.xerces.util.AugmentationsImpl$SmallContainer",
+      "org.apache.xerces.impl.XMLEntityManager$ByteBufferPool",
+      "org.apache.xerces.impl.XMLEntityManager$CharacterBufferPool",
+      "org.apache.xerces.impl.XMLEntityScanner$1",
+      "org.apache.xerces.impl.XMLEntityScanner",
+      "org.apache.xerces.impl.XMLErrorReporter",
+      "org.apache.xerces.impl.XMLScanner",
+      "org.apache.xerces.impl.XMLDocumentFragmentScannerImpl",
+      "org.apache.xerces.impl.XMLDocumentScannerImpl",
+      "org.apache.xerces.util.XMLStringBuffer",
+      "org.apache.xerces.util.XMLAttributesImpl",
+      "org.apache.xerces.impl.XMLDTDScannerImpl",
+      "org.apache.xerces.impl.dtd.XMLDTDProcessor",
+      "org.apache.xerces.impl.dtd.XMLDTDValidator",
+      "org.apache.xerces.impl.validation.ValidationState",
+      "org.apache.xerces.impl.dtd.XMLElementDecl",
+      "org.apache.xerces.impl.dtd.XMLSimpleType",
+      "org.apache.xerces.impl.dv.DTDDVFactory",
+      "org.apache.xerces.impl.dv.ObjectFactory",
+      "org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl",
+      "org.apache.xerces.impl.XMLVersionDetector",
+      "org.apache.xerces.impl.msg.XMLMessageFormatter",
+      "org.apache.xerces.impl.io.UTF8Reader",
+      "org.apache.xerces.util.XMLSymbols",
+      "org.apache.xerces.xni.NamespaceContext",
+      "org.apache.xerces.util.XMLChar",
+      "org.apache.xerces.impl.Constants",
+      "com.att.eelf.configuration.EELFLogger$Level",
+      "com.att.eelf.configuration.EELFManager",
+      "org.openecomp.mso.logger.MessageEnum",
+      "org.openecomp.mso.cloud.CloudIdentity",
+      "org.openecomp.mso.utils.CryptoUtils",
+      "org.openecomp.mso.logger.MsoAlarmLogger",
+      "org.openecomp.mso.openstack.utils.MsoCommonUtils"
+    );
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/MsoTenantESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/MsoTenantESTest.java
new file mode 100644
index 0000000..241ca88
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/MsoTenantESTest.java
@@ -0,0 +1,83 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Mon Nov 14 08:56:50 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.beans;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+import java.util.Map;
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class MsoTenantESTest extends MsoTenantESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test0()  throws Throwable  {
+      MsoTenant msoTenant0 = new MsoTenant("P<5j-:=G4zf", "P<5j-:=G4zf", (Map<String, String>) null);
+      String string0 = msoTenant0.getTenantName();
+      assertEquals("P<5j-:=G4zf", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test1()  throws Throwable  {
+      MsoTenant msoTenant0 = new MsoTenant("", "", (Map<String, String>) null);
+      String string0 = msoTenant0.getTenantName();
+      assertEquals("", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test2()  throws Throwable  {
+      MsoTenant msoTenant0 = new MsoTenant();
+      String string0 = msoTenant0.getTenantName();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test3()  throws Throwable  {
+      MsoTenant msoTenant0 = new MsoTenant();
+      Map<String, String> map0 = msoTenant0.getMetadata();
+      assertNull(map0);
+  }
+
+  @Test(timeout = 4000)
+  public void test4()  throws Throwable  {
+      MsoTenant msoTenant0 = new MsoTenant("", "SsK{%:", (Map<String, String>) null);
+      String string0 = msoTenant0.getTenantId();
+      assertEquals("", string0);
+      assertEquals("SsK{%:", msoTenant0.getTenantName());
+  }
+
+  @Test(timeout = 4000)
+  public void test5()  throws Throwable  {
+      MsoTenant msoTenant0 = new MsoTenant();
+      msoTenant0.setTenantId("9A");
+      String string0 = msoTenant0.getTenantId();
+      assertEquals("9A", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test6()  throws Throwable  {
+      MsoTenant msoTenant0 = new MsoTenant();
+      msoTenant0.setMetadata((Map<String, String>) null);
+      assertNull(msoTenant0.getTenantName());
+  }
+
+  @Test(timeout = 4000)
+  public void test7()  throws Throwable  {
+      MsoTenant msoTenant0 = new MsoTenant();
+      msoTenant0.setTenantName("9A");
+      assertNull(msoTenant0.getTenantId());
+  }
+
+  @Test(timeout = 4000)
+  public void test8()  throws Throwable  {
+      MsoTenant msoTenant0 = new MsoTenant();
+      String string0 = msoTenant0.getTenantId();
+      assertNull(string0);
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/MsoTenantESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/MsoTenantESTestscaffolding.java
new file mode 100644
index 0000000..0ac4893
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/MsoTenantESTestscaffolding.java
@@ -0,0 +1,78 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Mon Nov 14 08:56:50 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.beans;
+
+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;
+
+@EvoSuiteClassExclude
+public class MsoTenantESTestscaffolding {
+
+  @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.openstack.beans.MsoTenant"; 
+    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(MsoTenantESTestscaffolding.class.getClassLoader() ,
+      "org.openecomp.mso.openstack.beans.MsoTenant"
+    );
+  } 
+
+  private static void resetClasses() {
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/NetworkInfoESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/NetworkInfoESTest.java
new file mode 100644
index 0000000..9c15725
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/NetworkInfoESTest.java
@@ -0,0 +1,247 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Mon Nov 14 08:44:14 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.beans;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+import static org.evosuite.shaded.org.mockito.Mockito.*;
+import static org.evosuite.runtime.MockitoExtension.*;
+
+import com.woorea.openstack.quantum.model.Network;
+import com.woorea.openstack.quantum.model.Segment;
+import java.util.List;
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.evosuite.runtime.ViolatedAssumptionAnswer;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class NetworkInfoESTest extends NetworkInfoESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test00()  throws Throwable  {
+      NetworkInfo networkInfo0 = new NetworkInfo();
+      networkInfo0.setVlans((List<Integer>) null);
+      List<Integer> list0 = networkInfo0.getVlans();
+      assertNull(list0);
+  }
+
+  @Test(timeout = 4000)
+  public void test01()  throws Throwable  {
+      Network network0 = mock(Network.class, new ViolatedAssumptionAnswer());
+      doReturn((String) null).when(network0).getId();
+      doReturn((String) null).when(network0).getName();
+      doReturn((String) null).when(network0).getProviderPhysicalNetwork();
+      doReturn((List) null).when(network0).getSegments();
+      doReturn((String) null).when(network0).getStatus();
+      doReturn((List) null).when(network0).getSubnets();
+      NetworkInfo networkInfo0 = new NetworkInfo(network0);
+      List<String> list0 = networkInfo0.getSubnets();
+      assertNull(list0);
+  }
+
+  @Test(timeout = 4000)
+  public void test02()  throws Throwable  {
+      NetworkInfo networkInfo0 = new NetworkInfo();
+      networkInfo0.setShared("Network [id=");
+      String string0 = networkInfo0.getShared();
+      assertEquals("Network [id=", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test03()  throws Throwable  {
+      NetworkInfo networkInfo0 = new NetworkInfo();
+      networkInfo0.setProvider((String) null);
+      String string0 = networkInfo0.getProvider();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test04()  throws Throwable  {
+      NetworkInfo networkInfo0 = new NetworkInfo();
+      networkInfo0.setProvider("ERROR");
+      String string0 = networkInfo0.getProvider();
+      assertEquals("ERROR", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test05()  throws Throwable  {
+      NetworkInfo networkInfo0 = new NetworkInfo();
+      networkInfo0.setId((String) null);
+      String string0 = networkInfo0.getId();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test06()  throws Throwable  {
+      NetworkStatus networkStatus0 = NetworkStatus.DOWN;
+      NetworkInfo networkInfo0 = new NetworkInfo("IghhGdNW B*}", networkStatus0);
+      String string0 = networkInfo0.getId();
+      assertEquals("IghhGdNW B*}", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test07()  throws Throwable  {
+      Network network0 = mock(Network.class, new ViolatedAssumptionAnswer());
+      doReturn((String) null).when(network0).getId();
+      doReturn((String) null).when(network0).getName();
+      doReturn((String) null).when(network0).getProviderPhysicalNetwork();
+      doReturn((List) null).when(network0).getSegments();
+      doReturn((String) null).when(network0).getStatus();
+      doReturn((List) null).when(network0).getSubnets();
+      NetworkInfo networkInfo0 = new NetworkInfo(network0);
+      List<String> list0 = networkInfo0.getSubnets();
+      Network network1 = mock(Network.class, new ViolatedAssumptionAnswer());
+      doReturn((String) null).when(network1).getId();
+      doReturn((String) null).when(network1).getName();
+      doReturn((String) null).when(network1).getProviderPhysicalNetwork();
+      doReturn((List<Segment>) null).when(network1).getSegments();
+      doReturn("uxR^({\"", (String) null).when(network1).getStatus();
+      doReturn(list0).when(network1).getSubnets();
+      NetworkInfo networkInfo1 = new NetworkInfo(network1);
+      assertNull(networkInfo1.getName());
+  }
+
+  @Test(timeout = 4000)
+  public void test08()  throws Throwable  {
+      Network network0 = mock(Network.class, new ViolatedAssumptionAnswer());
+      doReturn(", segments: ").when(network0).getId();
+      doReturn("ACTIVE").when(network0).getName();
+      doReturn("l1~gC_#a'H,#*").when(network0).getProviderNetworkType();
+      doReturn("ACTIVE", "").when(network0).getProviderPhysicalNetwork();
+      doReturn("ERROR", "ERROR", "%<3T-").when(network0).getStatus();
+      doReturn((List) null).when(network0).getSubnets();
+      NetworkInfo networkInfo0 = new NetworkInfo(network0);
+      networkInfo0.getStatus();
+  }
+
+  @Test(timeout = 4000)
+  public void test09()  throws Throwable  {
+      Network network0 = mock(Network.class, new ViolatedAssumptionAnswer());
+      doReturn(", segments: ").when(network0).getId();
+      doReturn("ACTIVE").when(network0).getName();
+      doReturn((String) null).when(network0).getProviderNetworkType();
+      doReturn("ACTIVE", (String) null).when(network0).getProviderPhysicalNetwork();
+      doReturn("ERROR", (String) null).when(network0).getStatus();
+      NetworkInfo networkInfo0 = null;
+      try {
+        networkInfo0 = new NetworkInfo(network0);
+        fail("Expecting exception: NullPointerException");
+      
+      } catch(NullPointerException e) {
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test10()  throws Throwable  {
+      NetworkInfo networkInfo0 = new NetworkInfo((Network) null);
+      assertEquals("", networkInfo0.getId());
+  }
+
+  @Test(timeout = 4000)
+  public void test11()  throws Throwable  {
+      NetworkInfo networkInfo0 = new NetworkInfo();
+      String string0 = networkInfo0.toString();
+      assertEquals("Network: name=,id=,status=UNKNOWN,provider=,vlans=[],subnets=[],shared=", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test12()  throws Throwable  {
+      NetworkInfo networkInfo0 = new NetworkInfo();
+      NetworkStatus networkStatus0 = NetworkStatus.NOTFOUND;
+      networkInfo0.setStatus(networkStatus0);
+      assertEquals("", networkInfo0.getShared());
+  }
+
+  @Test(timeout = 4000)
+  public void test13()  throws Throwable  {
+      NetworkStatus networkStatus0 = NetworkStatus.UNKNOWN;
+      NetworkInfo networkInfo0 = new NetworkInfo((String) null, networkStatus0);
+      String string0 = networkInfo0.getName();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test14()  throws Throwable  {
+      NetworkInfo networkInfo0 = new NetworkInfo();
+      networkInfo0.setShared((String) null);
+      String string0 = networkInfo0.getShared();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test15()  throws Throwable  {
+      NetworkInfo networkInfo0 = new NetworkInfo();
+      String string0 = networkInfo0.getShared();
+      assertEquals("", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test16()  throws Throwable  {
+      NetworkInfo networkInfo0 = new NetworkInfo();
+      List<String> list0 = networkInfo0.getSubnets();
+      Network network0 = mock(Network.class, new ViolatedAssumptionAnswer());
+      doReturn("R65k@>rbu`lzb#").when(network0).getId();
+      doReturn("ERROR").when(network0).getName();
+      doReturn("DOWN").when(network0).getProviderNetworkType();
+      doReturn("u1Z(%z~k-ao5#y", "R65k@>rbu`lzb#").when(network0).getProviderPhysicalNetwork();
+      doReturn("R65k@>rbu`lzb#", "R65k@>rbu`lzb#").when(network0).getStatus();
+      doReturn(list0).when(network0).getSubnets();
+      NetworkInfo networkInfo1 = new NetworkInfo(network0);
+      networkInfo1.getName();
+      assertEquals("R65k@>rbu`lzb#", networkInfo1.getProvider());
+  }
+
+  @Test(timeout = 4000)
+  public void test17()  throws Throwable  {
+      NetworkInfo networkInfo0 = new NetworkInfo();
+      List<Integer> list0 = networkInfo0.getVlans();
+      networkInfo0.setVlans(list0);
+      assertEquals("", networkInfo0.getProvider());
+  }
+
+  @Test(timeout = 4000)
+  public void test18()  throws Throwable  {
+      NetworkInfo networkInfo0 = new NetworkInfo();
+      networkInfo0.setName("");
+      assertEquals(NetworkStatus.UNKNOWN, networkInfo0.getStatus());
+  }
+
+  @Test(timeout = 4000)
+  public void test19()  throws Throwable  {
+      NetworkInfo networkInfo0 = new NetworkInfo();
+      networkInfo0.setSubnets((List<String>) null);
+      assertEquals("", networkInfo0.getShared());
+  }
+
+  @Test(timeout = 4000)
+  public void test20()  throws Throwable  {
+      NetworkInfo networkInfo0 = new NetworkInfo();
+      NetworkStatus networkStatus0 = networkInfo0.getStatus();
+      assertEquals(NetworkStatus.UNKNOWN, networkStatus0);
+  }
+
+  @Test(timeout = 4000)
+  public void test21()  throws Throwable  {
+      NetworkInfo networkInfo0 = new NetworkInfo();
+      String string0 = networkInfo0.getProvider();
+      assertEquals("", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test22()  throws Throwable  {
+      NetworkInfo networkInfo0 = new NetworkInfo();
+      String string0 = networkInfo0.getId();
+      assertEquals("", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test23()  throws Throwable  {
+      NetworkInfo networkInfo0 = new NetworkInfo();
+      String string0 = networkInfo0.getName();
+      assertEquals("", string0);
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/NetworkInfoESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/NetworkInfoESTestscaffolding.java
new file mode 100644
index 0000000..0c87ca9
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/NetworkInfoESTestscaffolding.java
@@ -0,0 +1,92 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Mon Nov 14 08:44:14 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.beans;
+
+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;
+
+@EvoSuiteClassExclude
+public class NetworkInfoESTestscaffolding {
+
+  @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.openstack.beans.NetworkInfo"; 
+    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(NetworkInfoESTestscaffolding.class.getClassLoader() ,
+      "org.codehaus.jackson.annotate.JacksonAnnotation",
+      "com.woorea.openstack.quantum.model.Network",
+      "org.codehaus.jackson.annotate.JsonIgnoreProperties",
+      "com.woorea.openstack.quantum.model.Segment",
+      "org.openecomp.mso.openstack.beans.NetworkInfo",
+      "org.openecomp.mso.openstack.beans.NetworkStatus",
+      "com.woorea.openstack.quantum.model.Network$NetworkType",
+      "org.codehaus.jackson.map.annotate.JsonRootName"
+    );
+  } 
+
+  private static void resetClasses() {
+    org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(NetworkInfoESTestscaffolding.class.getClassLoader());
+
+    org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
+      "org.openecomp.mso.openstack.beans.NetworkStatus",
+      "org.openecomp.mso.openstack.beans.NetworkInfo",
+      "com.woorea.openstack.quantum.model.Network"
+    );
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/NetworkRollbackESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/NetworkRollbackESTest.java
new file mode 100644
index 0000000..bad2bde
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/NetworkRollbackESTest.java
@@ -0,0 +1,303 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Mon Nov 14 08:55:12 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.beans;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+import static org.evosuite.shaded.org.mockito.Mockito.*;
+import static org.evosuite.runtime.MockitoExtension.*;
+import org.openecomp.mso.entity.MsoRequest;
+
+import java.util.List;
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.evosuite.runtime.ViolatedAssumptionAnswer;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class NetworkRollbackESTest extends NetworkRollbackESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test00()  throws Throwable  {
+      NetworkRollback networkRollback0 = new NetworkRollback();
+      networkRollback0.setNetworkStackId("H/r!m+_NT$?ed$IPcLD");
+      networkRollback0.setNeutronNetworkId("H/r!m+_NT$?ed$IPcLD");
+      MsoRequest msoRequest0 = mock(MsoRequest.class, new ViolatedAssumptionAnswer());
+      doReturn((String) null, (String) null, (String) null).when(msoRequest0).toString();
+      networkRollback0.setNetworkStackId("");
+      networkRollback0.setMsoRequest((MsoRequest) null);
+      networkRollback0.setMsoRequest(msoRequest0);
+      networkRollback0.toString();
+      networkRollback0.setNeutronNetworkId("NetworkRollback [networkId=null, neutronNetworkId=H/r!m+_NT$?ed$IPcLD, networkStackId=, tenantId=null, cloudId=null, networkType=null, networkCreated=false, networkName=null, physicalNetwork=null]");
+      networkRollback0.getVlans();
+      networkRollback0.setCloudId("NetworkRollback [networkId=null, neutronNetworkId=H/r!m+_NT$?ed$IPcLD, networkStackId=, tenantId=null, cloudId=null, networkType=null, networkCreated=false, networkName=null, physicalNetwork=null]");
+      networkRollback0.setNetworkType("NetworkRollback [networkId=null, neutronNetworkId=H/r!m+_NT$?ed$IPcLD, networkStackId=, tenantId=null, cloudId=null, networkType=null, networkCreated=false, networkName=null, physicalNetwork=null]");
+      networkRollback0.toString();
+      networkRollback0.setCloudId("NetworkRollback [networkId=null, neutronNetworkId=H/r!m+_NT$?ed$IPcLD, networkStackId=, tenantId=null, cloudId=null, networkType=null, networkCreated=false, networkName=null, physicalNetwork=null]");
+      networkRollback0.setTenantId("80\u0002<]~y|x(#fl");
+      networkRollback0.setCloudId("=:U\"]");
+      networkRollback0.toString();
+      networkRollback0.getVlans();
+      networkRollback0.toString();
+      networkRollback0.getVlans();
+      networkRollback0.getVlans();
+      networkRollback0.getVlans();
+      networkRollback0.setVlans((List<Integer>) null);
+      networkRollback0.toString();
+      networkRollback0.getMsoRequest();
+      networkRollback0.getVlans();
+      networkRollback0.toString();
+      networkRollback0.getMsoRequest();
+      networkRollback0.getVlans();
+      networkRollback0.getMsoRequest();
+      networkRollback0.getVlans();
+      List<Integer> list0 = networkRollback0.getVlans();
+      assertNull(list0);
+  }
+
+  @Test(timeout = 4000)
+  public void test01()  throws Throwable  {
+      NetworkRollback networkRollback0 = new NetworkRollback();
+      networkRollback0.setNetworkType((String) null);
+      networkRollback0.getMsoRequest();
+      networkRollback0.setMsoRequest((MsoRequest) null);
+      networkRollback0.setNetworkId("");
+      networkRollback0.setTenantId("");
+      networkRollback0.getNetworkId();
+      networkRollback0.setNeutronNetworkId("");
+      networkRollback0.setCloudId("O;On");
+      assertFalse(networkRollback0.getNetworkCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test02()  throws Throwable  {
+      NetworkRollback networkRollback0 = new NetworkRollback();
+      networkRollback0.setCloudId("C5FS|V@CMBag");
+      networkRollback0.getVlans();
+      networkRollback0.setVlans((List<Integer>) null);
+      networkRollback0.getPhysicalNetwork();
+      networkRollback0.setVlans((List<Integer>) null);
+      networkRollback0.getNeutronNetworkId();
+      networkRollback0.setNetworkType("C5FS|V@CMBag");
+      networkRollback0.getNetworkType();
+      assertFalse(networkRollback0.getNetworkCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test03()  throws Throwable  {
+      NetworkRollback networkRollback0 = new NetworkRollback();
+      networkRollback0.setNetworkId(", networkName=");
+      networkRollback0.setNetworkStackId("u)");
+      networkRollback0.setNetworkId("u)");
+      networkRollback0.setNetworkId(", networkName=");
+      networkRollback0.getNetworkStackId();
+      assertFalse(networkRollback0.getNetworkCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test04()  throws Throwable  {
+      NetworkRollback networkRollback0 = new NetworkRollback();
+      networkRollback0.setNetworkType("V3$f~dKduUu0");
+      networkRollback0.setNetworkType("");
+      networkRollback0.setTenantId("");
+      networkRollback0.getPhysicalNetwork();
+      networkRollback0.getVlans();
+      networkRollback0.getNetworkType();
+      assertFalse(networkRollback0.getNetworkCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test05()  throws Throwable  {
+      NetworkRollback networkRollback0 = new NetworkRollback();
+      networkRollback0.setTenantId("Lu#)!pt2p=<#T.");
+      networkRollback0.getTenantId();
+      networkRollback0.setNetworkStackId("Lu#)!pt2p=<#T.");
+      networkRollback0.getNeutronNetworkId();
+      networkRollback0.setTenantId("Lu#)!pt2p=<#T.");
+      networkRollback0.setNetworkStackId((String) null);
+      String string0 = networkRollback0.toString();
+      assertEquals("NetworkRollback [networkId=null, neutronNetworkId=null, networkStackId=null, tenantId=Lu#)!pt2p=<#T., cloudId=null, networkType=null, networkCreated=false, networkName=null, physicalNetwork=null]", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test06()  throws Throwable  {
+      NetworkRollback networkRollback0 = new NetworkRollback();
+      networkRollback0.getMsoRequest();
+      networkRollback0.setMsoRequest((MsoRequest) null);
+      String string0 = networkRollback0.toString();
+      assertEquals("NetworkRollback [networkId=null, neutronNetworkId=null, networkStackId=null, tenantId=null, cloudId=null, networkType=null, networkCreated=false, networkName=null, physicalNetwork=null]", string0);
+      
+      networkRollback0.setNetworkName("");
+      networkRollback0.getNetworkName();
+      networkRollback0.setNetworkCreated(true);
+      networkRollback0.setNetworkName("");
+      networkRollback0.getPhysicalNetwork();
+      networkRollback0.setTenantId("");
+      networkRollback0.setNetworkId("");
+      assertTrue(networkRollback0.getNetworkCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test07()  throws Throwable  {
+      NetworkRollback networkRollback0 = new NetworkRollback();
+      networkRollback0.getTenantId();
+      networkRollback0.setNetworkStackId((String) null);
+      networkRollback0.getVlans();
+      networkRollback0.setTenantId("");
+      networkRollback0.getTenantId();
+      networkRollback0.setVlans((List<Integer>) null);
+      String string0 = networkRollback0.toString();
+      assertEquals("NetworkRollback [networkId=null, neutronNetworkId=null, networkStackId=null, tenantId=, cloudId=null, networkType=null, networkCreated=false, networkName=null, physicalNetwork=null]", string0);
+      
+      NetworkRollback networkRollback1 = new NetworkRollback();
+      assertFalse(networkRollback1.getNetworkCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test08()  throws Throwable  {
+      NetworkRollback networkRollback0 = new NetworkRollback();
+      networkRollback0.setNeutronNetworkId("");
+      networkRollback0.setCloudId("");
+      networkRollback0.getTenantId();
+      networkRollback0.setTenantId("");
+      networkRollback0.setNetworkType("Y=x>wx'");
+      networkRollback0.getNeutronNetworkId();
+      networkRollback0.getVlans();
+      networkRollback0.setVlans((List<Integer>) null);
+      networkRollback0.setNetworkStackId("6P7@4aGo &Kd>V");
+      networkRollback0.getCloudId();
+      NetworkRollback networkRollback1 = new NetworkRollback();
+      assertFalse(networkRollback1.getNetworkCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test09()  throws Throwable  {
+      NetworkRollback networkRollback0 = new NetworkRollback();
+      assertFalse(networkRollback0.getNetworkCreated());
+      
+      networkRollback0.setNetworkCreated(true);
+      networkRollback0.toString();
+      networkRollback0.setNeutronNetworkId("NetworkRollback [networkId=null, neutronNetworkId=null, networkStackId=null, tenantId=null, cloudId=null, networkType=null, networkCreated=true, networkName=null, physicalNetwork=null]");
+      networkRollback0.getPhysicalNetwork();
+      boolean boolean0 = networkRollback0.getNetworkCreated();
+      assertTrue(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test10()  throws Throwable  {
+      NetworkRollback networkRollback0 = new NetworkRollback();
+      networkRollback0.setNetworkId(", tenantId=");
+      networkRollback0.setNetworkId("");
+      networkRollback0.setTenantId(", tenantId=");
+      networkRollback0.setNetworkName("+*");
+      networkRollback0.getNetworkName();
+      networkRollback0.setNetworkStackId(", tenantId=");
+      networkRollback0.setCloudId("+*");
+      networkRollback0.getCloudId();
+      NetworkRollback networkRollback1 = new NetworkRollback();
+      assertFalse(networkRollback1.getNetworkCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test11()  throws Throwable  {
+      NetworkRollback networkRollback0 = new NetworkRollback();
+      networkRollback0.setPhysicalNetwork("!(>41heY7e");
+      networkRollback0.setTenantId("j");
+      networkRollback0.setNeutronNetworkId("j");
+      networkRollback0.getPhysicalNetwork();
+      networkRollback0.getVlans();
+      NetworkRollback networkRollback1 = new NetworkRollback();
+      networkRollback1.getMsoRequest();
+      networkRollback0.setMsoRequest((MsoRequest) null);
+      networkRollback0.setNetworkCreated(false);
+      networkRollback0.setNeutronNetworkId("j");
+      assertFalse(networkRollback0.getNetworkCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test12()  throws Throwable  {
+      NetworkRollback networkRollback0 = new NetworkRollback();
+      networkRollback0.setPhysicalNetwork("");
+      networkRollback0.setNetworkStackId("");
+      networkRollback0.setNeutronNetworkId("");
+      networkRollback0.getNetworkStackId();
+      networkRollback0.getMsoRequest();
+      assertFalse(networkRollback0.getNetworkCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test13()  throws Throwable  {
+      NetworkRollback networkRollback0 = new NetworkRollback();
+      networkRollback0.setCloudId("7u@lc[l##+g`2V");
+      networkRollback0.getVlans();
+      networkRollback0.setVlans((List<Integer>) null);
+      networkRollback0.setNetworkType("");
+      networkRollback0.setCloudId(", physicalNetwork=");
+      networkRollback0.setPhysicalNetwork("");
+      networkRollback0.setNeutronNetworkId(", physicalNetwork=");
+      networkRollback0.getPhysicalNetwork();
+      networkRollback0.getNeutronNetworkId();
+      assertFalse(networkRollback0.getNetworkCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test14()  throws Throwable  {
+      NetworkRollback networkRollback0 = new NetworkRollback();
+      networkRollback0.getNetworkId();
+      assertFalse(networkRollback0.getNetworkCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test15()  throws Throwable  {
+      NetworkRollback networkRollback0 = new NetworkRollback();
+      networkRollback0.getMsoRequest();
+      networkRollback0.setMsoRequest((MsoRequest) null);
+      networkRollback0.getNetworkCreated();
+      networkRollback0.setNetworkId(", networkName=");
+      networkRollback0.getNeutronNetworkId();
+      networkRollback0.setPhysicalNetwork((String) null);
+      networkRollback0.getNetworkId();
+      NetworkRollback networkRollback1 = new NetworkRollback();
+      String string0 = networkRollback1.toString();
+      assertEquals("NetworkRollback [networkId=null, neutronNetworkId=null, networkStackId=null, tenantId=null, cloudId=null, networkType=null, networkCreated=false, networkName=null, physicalNetwork=null]", string0);
+      
+      networkRollback1.getVlans();
+      networkRollback0.setVlans((List<Integer>) null);
+      networkRollback0.getNetworkId();
+      networkRollback1.getPhysicalNetwork();
+      networkRollback1.setNetworkCreated(false);
+      assertFalse(networkRollback1.getNetworkCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test16()  throws Throwable  {
+      NetworkRollback networkRollback0 = new NetworkRollback();
+      networkRollback0.getNetworkType();
+      networkRollback0.setTenantId((String) null);
+      networkRollback0.setNetworkName(" networkStacId=");
+      networkRollback0.getCloudId();
+      networkRollback0.getTenantId();
+      networkRollback0.setNetworkStackId(" networkStacId=");
+      networkRollback0.setNeutronNetworkId((String) null);
+      assertFalse(networkRollback0.getNetworkCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test17()  throws Throwable  {
+      NetworkRollback networkRollback0 = new NetworkRollback();
+      networkRollback0.getNetworkName();
+      assertFalse(networkRollback0.getNetworkCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test18()  throws Throwable  {
+      NetworkRollback networkRollback0 = new NetworkRollback();
+      networkRollback0.setNetworkType("uK+JCvyg\"J(C d.w[");
+      networkRollback0.setCloudId("uK+JCvyg\"J(C d.w[");
+      networkRollback0.getNetworkStackId();
+      assertFalse(networkRollback0.getNetworkCreated());
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/NetworkRollbackESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/NetworkRollbackESTestscaffolding.java
new file mode 100644
index 0000000..1665732
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/NetworkRollbackESTestscaffolding.java
@@ -0,0 +1,79 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Mon Nov 14 08:55:12 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.beans;
+
+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;
+
+@EvoSuiteClassExclude
+public class NetworkRollbackESTestscaffolding {
+
+  @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.openstack.beans.NetworkRollback"; 
+    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(NetworkRollbackESTestscaffolding.class.getClassLoader() ,
+      "org.openecomp.mso.entity.MsoRequest",
+      "org.openecomp.mso.openstack.beans.NetworkRollback"
+    );
+  } 
+
+  private static void resetClasses() {
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/PoolESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/PoolESTest.java
new file mode 100644
index 0000000..0ec588d
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/PoolESTest.java
@@ -0,0 +1,70 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Mon Nov 14 08:49:52 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.beans;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class PoolESTest extends PoolESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test0()  throws Throwable  {
+      Pool pool0 = new Pool();
+      pool0.setStart("Allocation_pool [start=null, end=null]");
+      String string0 = pool0.getStart();
+      assertEquals("Allocation_pool [start=null, end=null]", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test1()  throws Throwable  {
+      Pool pool0 = new Pool();
+      pool0.setEnd("Allocation_pool [start=null, end=null]");
+      String string0 = pool0.getEnd();
+      assertEquals("Allocation_pool [start=null, end=null]", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test2()  throws Throwable  {
+      Pool pool0 = new Pool();
+      String string0 = pool0.getEnd();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test3()  throws Throwable  {
+      Pool pool0 = new Pool();
+      pool0.setStart("");
+      String string0 = pool0.getStart();
+      assertEquals("", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test4()  throws Throwable  {
+      Pool pool0 = new Pool();
+      String string0 = pool0.toString();
+      assertEquals("Allocation_pool [start=null, end=null]", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test5()  throws Throwable  {
+      Pool pool0 = new Pool();
+      pool0.setEnd("");
+      String string0 = pool0.getEnd();
+      assertEquals("", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test6()  throws Throwable  {
+      Pool pool0 = new Pool();
+      String string0 = pool0.getStart();
+      assertNull(string0);
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/PoolESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/PoolESTestscaffolding.java
new file mode 100644
index 0000000..8ce9cb8
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/PoolESTestscaffolding.java
@@ -0,0 +1,78 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Mon Nov 14 08:49:52 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.beans;
+
+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;
+
+@EvoSuiteClassExclude
+public class PoolESTestscaffolding {
+
+  @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.openstack.beans.Pool"; 
+    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(PoolESTestscaffolding.class.getClassLoader() ,
+      "org.openecomp.mso.openstack.beans.Pool"
+    );
+  } 
+
+  private static void resetClasses() {
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/SubnetESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/SubnetESTest.java
new file mode 100644
index 0000000..7be8339
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/SubnetESTest.java
@@ -0,0 +1,221 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Mon Nov 14 08:52:14 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.beans;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+import java.util.List;
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class SubnetESTest extends SubnetESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test00()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      subnet0.setSubnetName("lu[c8x");
+      subnet0.getSubnetName();
+      assertEquals("4", subnet0.getIpVersion());
+  }
+
+  @Test(timeout = 4000)
+  public void test01()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      subnet0.setSubnetName("");
+      subnet0.getSubnetName();
+      assertEquals("4", subnet0.getIpVersion());
+  }
+
+  @Test(timeout = 4000)
+  public void test02()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      subnet0.setSubnetId("nL");
+      subnet0.getSubnetId();
+      assertEquals("4", subnet0.getIpVersion());
+  }
+
+  @Test(timeout = 4000)
+  public void test03()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      subnet0.setSubnetId("");
+      subnet0.getSubnetId();
+      assertEquals("4", subnet0.getIpVersion());
+  }
+
+  @Test(timeout = 4000)
+  public void test04()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      subnet0.setNeutronId("`jC)vXXeOG");
+      subnet0.getNeutronId();
+      assertEquals("4", subnet0.getIpVersion());
+  }
+
+  @Test(timeout = 4000)
+  public void test05()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      subnet0.setIpVersion("");
+      String string0 = subnet0.getIpVersion();
+      assertEquals("", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test06()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      subnet0.setGatewayIp((String) null);
+      subnet0.getGatewayIp();
+      assertEquals("4", subnet0.getIpVersion());
+  }
+
+  @Test(timeout = 4000)
+  public void test07()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      subnet0.setGatewayIp("Subnet [subnetName=null, neutronId=null, subnetId=null, cidr=null, gatewayIp=, ipVersion=4, enableDHCP=false, hostRoutes=null, allocationPools=null, dnsNameServers=null]");
+      subnet0.getGatewayIp();
+      assertEquals("4", subnet0.getIpVersion());
+  }
+
+  @Test(timeout = 4000)
+  public void test08()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      subnet0.setCidr("H3%q_*bOC2");
+      subnet0.getCidr();
+      assertEquals("4", subnet0.getIpVersion());
+  }
+
+  @Test(timeout = 4000)
+  public void test09()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      subnet0.setIpVersion((String) null);
+      String string0 = subnet0.getIpVersion();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test10()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      subnet0.setAllocationPools((List<Pool>) null);
+      assertEquals("4", subnet0.getIpVersion());
+  }
+
+  @Test(timeout = 4000)
+  public void test11()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      subnet0.getNeutronId();
+      assertEquals("4", subnet0.getIpVersion());
+  }
+
+  @Test(timeout = 4000)
+  public void test12()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      subnet0.getHostRoutes();
+      assertEquals("4", subnet0.getIpVersion());
+  }
+
+  @Test(timeout = 4000)
+  public void test13()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      String string0 = subnet0.toString();
+      assertEquals("Subnet [subnetName=null, neutronId=null, subnetId=null, cidr=null, gatewayIp=, ipVersion=4, enableDHCP=false, hostRoutes=null, allocationPools=null, dnsNameServers=null]", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test14()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      subnet0.getSubnetName();
+      assertEquals("4", subnet0.getIpVersion());
+  }
+
+  @Test(timeout = 4000)
+  public void test15()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      subnet0.setNeutronId("");
+      subnet0.getNeutronId();
+      assertEquals("4", subnet0.getIpVersion());
+  }
+
+  @Test(timeout = 4000)
+  public void test16()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      subnet0.setCidr("");
+      subnet0.getCidr();
+      assertEquals("4", subnet0.getIpVersion());
+  }
+
+  @Test(timeout = 4000)
+  public void test17()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      subnet0.getDnsNameServers();
+      assertEquals("4", subnet0.getIpVersion());
+  }
+
+  @Test(timeout = 4000)
+  public void test18()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      subnet0.setHostRoutes((List<String>) null);
+      assertEquals("4", subnet0.getIpVersion());
+  }
+
+  @Test(timeout = 4000)
+  public void test19()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      String string0 = subnet0.getIpVersion();
+      assertEquals("4", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test20()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      subnet0.getSubnetId();
+      assertEquals("4", subnet0.getIpVersion());
+  }
+
+  @Test(timeout = 4000)
+  public void test21()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      subnet0.setEnableDHCP((Boolean) null);
+      subnet0.getEnableDHCP();
+      assertEquals("4", subnet0.getIpVersion());
+  }
+
+  @Test(timeout = 4000)
+  public void test22()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      subnet0.getAllocationPools();
+      assertEquals("4", subnet0.getIpVersion());
+  }
+
+  @Test(timeout = 4000)
+  public void test23()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      subnet0.getCidr();
+      assertEquals("4", subnet0.getIpVersion());
+  }
+
+  @Test(timeout = 4000)
+  public void test24()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      subnet0.getGatewayIp();
+      assertEquals("4", subnet0.getIpVersion());
+  }
+
+  @Test(timeout = 4000)
+  public void test25()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      subnet0.setDnsNameServers((List<String>) null);
+      assertEquals("4", subnet0.getIpVersion());
+  }
+
+  @Test(timeout = 4000)
+  public void test26()  throws Throwable  {
+      Subnet subnet0 = new Subnet();
+      Boolean boolean0 = subnet0.getEnableDHCP();
+      assertFalse(boolean0);
+      assertEquals("4", subnet0.getIpVersion());
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/SubnetESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/SubnetESTestscaffolding.java
new file mode 100644
index 0000000..a9bf598
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/SubnetESTestscaffolding.java
@@ -0,0 +1,79 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Mon Nov 14 08:52:14 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.beans;
+
+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;
+
+@EvoSuiteClassExclude
+public class SubnetESTestscaffolding {
+
+  @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.openstack.beans.Subnet"; 
+    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(SubnetESTestscaffolding.class.getClassLoader() ,
+      "org.openecomp.mso.openstack.beans.Pool",
+      "org.openecomp.mso.openstack.beans.Subnet"
+    );
+  } 
+
+  private static void resetClasses() {
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/VnfRollbackESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/VnfRollbackESTest.java
new file mode 100644
index 0000000..e76ce41
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/VnfRollbackESTest.java
@@ -0,0 +1,403 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Mon Nov 14 08:51:17 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.beans;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+import static org.evosuite.shaded.org.mockito.Mockito.*;
+
+import org.openecomp.mso.entity.MsoRequest;
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.evosuite.runtime.ViolatedAssumptionAnswer;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class VnfRollbackESTest extends VnfRollbackESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test00()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      vnfRollback0.setVolumeGroupName(", vnfCreated=");
+      vnfRollback0.getVolumeGroupName();
+      assertFalse(vnfRollback0.getVnfCreated());
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertFalse(vnfRollback0.isBase());
+  }
+
+  @Test(timeout = 4000)
+  public void test01()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      vnfRollback0.setVolumeGroupId("}mvn2f6!r5FG1/_M~M");
+      vnfRollback0.getVolumeGroupId();
+      assertFalse(vnfRollback0.getVnfCreated());
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertFalse(vnfRollback0.isBase());
+  }
+
+  @Test(timeout = 4000)
+  public void test02()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      vnfRollback0.setVolumeGroupId("");
+      vnfRollback0.getVolumeGroupId();
+      assertFalse(vnfRollback0.getVnfCreated());
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertFalse(vnfRollback0.isBase());
+  }
+
+  @Test(timeout = 4000)
+  public void test03()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      vnfRollback0.setVolumeGroupHeatStackId("Z^t$4-eOKP9");
+      vnfRollback0.getVolumeGroupHeatStackId();
+      assertFalse(vnfRollback0.getVnfCreated());
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertFalse(vnfRollback0.isBase());
+  }
+
+  @Test(timeout = 4000)
+  public void test04()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      vnfRollback0.getVnfId();
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertFalse(vnfRollback0.getVnfCreated());
+      assertFalse(vnfRollback0.isBase());
+  }
+
+  @Test(timeout = 4000)
+  public void test05()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      vnfRollback0.setVnfId("");
+      vnfRollback0.getVnfId();
+      assertFalse(vnfRollback0.isBase());
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertFalse(vnfRollback0.getVnfCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test06()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      vnfRollback0.setVfModuleStackId("8y*`!>A$@*l8#a>");
+      vnfRollback0.getVfModuleStackId();
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertFalse(vnfRollback0.isBase());
+      assertFalse(vnfRollback0.getVnfCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test07()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      vnfRollback0.setVfModuleStackId("");
+      vnfRollback0.getVfModuleStackId();
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertFalse(vnfRollback0.getVnfCreated());
+      assertFalse(vnfRollback0.isBase());
+  }
+
+  @Test(timeout = 4000)
+  public void test08()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback(", tenant=", ", tenant=", ", tenant=", false, false, (MsoRequest) null, ", tenant=", "f5`2h^e^.-x", ", tenant=");
+      String string0 = vnfRollback0.getTenantId();
+      assertFalse(vnfRollback0.getVnfCreated());
+      assertEquals(", tenant=", vnfRollback0.getCloudSiteId());
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertFalse(vnfRollback0.isBase());
+      assertEquals(", tenant=", vnfRollback0.getRequestType());
+      assertEquals("f5`2h^e^.-x", vnfRollback0.getVolumeGroupId());
+      assertEquals(", tenant=", vnfRollback0.getVolumeGroupName());
+      assertEquals(", tenant=", vnfRollback0.getVnfId());
+      assertEquals(", tenant=", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test09()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      vnfRollback0.setTenantId("");
+      vnfRollback0.getTenantId();
+      assertFalse(vnfRollback0.isBase());
+      assertFalse(vnfRollback0.getVnfCreated());
+      assertFalse(vnfRollback0.getTenantCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test10()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      assertFalse(vnfRollback0.getTenantCreated());
+      
+      vnfRollback0.setTenantCreated(true);
+      boolean boolean0 = vnfRollback0.getTenantCreated();
+      assertTrue(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test11()  throws Throwable  {
+      MsoRequest msoRequest0 = mock(MsoRequest.class, new ViolatedAssumptionAnswer());
+      VnfRollback vnfRollback0 = new VnfRollback("", ", vnf=", "Jvr", false, false, msoRequest0, "", "f'D", "VnfRollback: cloud=");
+      String string0 = vnfRollback0.getRequestType();
+      assertFalse(vnfRollback0.isBase());
+      assertEquals("Jvr", vnfRollback0.getCloudSiteId());
+      assertEquals("", vnfRollback0.getVnfId());
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertEquals("f'D", vnfRollback0.getVolumeGroupId());
+      assertEquals(", vnf=", vnfRollback0.getTenantId());
+      assertEquals("VnfRollback: cloud=", string0);
+      assertFalse(vnfRollback0.getVnfCreated());
+      assertEquals("", vnfRollback0.getVolumeGroupName());
+  }
+
+  @Test(timeout = 4000)
+  public void test12()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      vnfRollback0.setRequestType("");
+      vnfRollback0.getRequestType();
+      assertFalse(vnfRollback0.getVnfCreated());
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertFalse(vnfRollback0.isBase());
+  }
+
+  @Test(timeout = 4000)
+  public void test13()  throws Throwable  {
+      MsoRequest msoRequest0 = mock(MsoRequest.class, new ViolatedAssumptionAnswer());
+      doReturn("Jvr").when(msoRequest0).toString();
+      VnfRollback vnfRollback0 = new VnfRollback("", ", vnf=", "Jvr", false, false, msoRequest0, "", "f'D", "VnfRollback: cloud=");
+      vnfRollback0.getMsoRequest();
+      assertEquals("Jvr", vnfRollback0.getCloudSiteId());
+      assertEquals("", vnfRollback0.getVnfId());
+      assertFalse(vnfRollback0.isBase());
+      assertEquals(", vnf=", vnfRollback0.getTenantId());
+      assertEquals("", vnfRollback0.getVolumeGroupName());
+      assertEquals("f'D", vnfRollback0.getVolumeGroupId());
+      assertEquals("VnfRollback: cloud=", vnfRollback0.getRequestType());
+      assertFalse(vnfRollback0.getVnfCreated());
+      assertFalse(vnfRollback0.getTenantCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test14()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback(", tenant=", ", tenant=", ", tenant=", false, false, (MsoRequest) null, ", tenant=", "f5`2h^e^.-x", ", tenant=");
+      String string0 = vnfRollback0.getCloudSiteId();
+      assertFalse(vnfRollback0.isBase());
+      assertEquals(", tenant=", string0);
+      assertEquals("f5`2h^e^.-x", vnfRollback0.getVolumeGroupId());
+      assertFalse(vnfRollback0.getVnfCreated());
+      assertEquals(", tenant=", vnfRollback0.getVnfId());
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertEquals(", tenant=", vnfRollback0.getVolumeGroupName());
+      assertEquals(", tenant=", vnfRollback0.getRequestType());
+      assertEquals(", tenant=", vnfRollback0.getTenantId());
+  }
+
+  @Test(timeout = 4000)
+  public void test15()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      vnfRollback0.setCloudSiteId("");
+      vnfRollback0.getCloudSiteId();
+      assertFalse(vnfRollback0.getVnfCreated());
+      assertFalse(vnfRollback0.isBase());
+      assertFalse(vnfRollback0.getTenantCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test16()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      vnfRollback0.setBaseGroupHeatStackId("3(6Q^)Ic kf:zj");
+      vnfRollback0.getBaseGroupHeatStackId();
+      assertFalse(vnfRollback0.isBase());
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertFalse(vnfRollback0.getVnfCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test17()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      vnfRollback0.setBaseGroupHeatStackId("");
+      vnfRollback0.getBaseGroupHeatStackId();
+      assertFalse(vnfRollback0.isBase());
+      assertFalse(vnfRollback0.getVnfCreated());
+      assertFalse(vnfRollback0.getTenantCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test18()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      assertFalse(vnfRollback0.isBase());
+      
+      vnfRollback0.setIsBase(true);
+      boolean boolean0 = vnfRollback0.isBase();
+      assertTrue(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test19()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      vnfRollback0.getVfModuleStackId();
+      assertFalse(vnfRollback0.isBase());
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertFalse(vnfRollback0.getVnfCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test20()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      vnfRollback0.getVolumeGroupName();
+      assertFalse(vnfRollback0.getVnfCreated());
+      assertFalse(vnfRollback0.isBase());
+      assertFalse(vnfRollback0.getTenantCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test21()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      vnfRollback0.setVolumeGroupName("");
+      vnfRollback0.getVolumeGroupName();
+      assertFalse(vnfRollback0.isBase());
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertFalse(vnfRollback0.getVnfCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test22()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      boolean boolean0 = vnfRollback0.getTenantCreated();
+      assertFalse(vnfRollback0.getVnfCreated());
+      assertFalse(boolean0);
+      assertFalse(vnfRollback0.isBase());
+  }
+
+  @Test(timeout = 4000)
+  public void test23()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      boolean boolean0 = vnfRollback0.isBase();
+      assertFalse(vnfRollback0.getVnfCreated());
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertFalse(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test24()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      String string0 = vnfRollback0.toString();
+      assertFalse(vnfRollback0.isBase());
+      assertEquals("VnfRollback: cloud=null, tenant=null, vnf=null, tenantCreated=false, vnfCreated=false, requestType = null", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test25()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      boolean boolean0 = vnfRollback0.getVnfCreated();
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertFalse(boolean0);
+      assertFalse(vnfRollback0.isBase());
+  }
+
+  @Test(timeout = 4000)
+  public void test26()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      vnfRollback0.getVolumeGroupHeatStackId();
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertFalse(vnfRollback0.getVnfCreated());
+      assertFalse(vnfRollback0.isBase());
+  }
+
+  @Test(timeout = 4000)
+  public void test27()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      vnfRollback0.getBaseGroupHeatStackId();
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertFalse(vnfRollback0.getVnfCreated());
+      assertFalse(vnfRollback0.isBase());
+  }
+
+  @Test(timeout = 4000)
+  public void test28()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      vnfRollback0.getCloudSiteId();
+      assertFalse(vnfRollback0.isBase());
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertFalse(vnfRollback0.getVnfCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test29()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      vnfRollback0.getTenantId();
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertFalse(vnfRollback0.isBase());
+      assertFalse(vnfRollback0.getVnfCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test30()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      MsoRequest msoRequest0 = mock(MsoRequest.class, new ViolatedAssumptionAnswer());
+      vnfRollback0.setMsoRequest(msoRequest0);
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertFalse(vnfRollback0.getVnfCreated());
+      assertFalse(vnfRollback0.isBase());
+  }
+
+  @Test(timeout = 4000)
+  public void test31()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      vnfRollback0.getMsoRequest();
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertFalse(vnfRollback0.getVnfCreated());
+      assertFalse(vnfRollback0.isBase());
+  }
+
+  @Test(timeout = 4000)
+  public void test32()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      assertFalse(vnfRollback0.getVnfCreated());
+      
+      vnfRollback0.setVnfCreated(true);
+      boolean boolean0 = vnfRollback0.getVnfCreated();
+      assertTrue(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test33()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      vnfRollback0.getVolumeGroupId();
+      assertFalse(vnfRollback0.getVnfCreated());
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertFalse(vnfRollback0.isBase());
+  }
+
+  @Test(timeout = 4000)
+  public void test34()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      vnfRollback0.getRequestType();
+      assertFalse(vnfRollback0.isBase());
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertFalse(vnfRollback0.getVnfCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test35()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback();
+      vnfRollback0.setVolumeGroupHeatStackId("");
+      vnfRollback0.getVolumeGroupHeatStackId();
+      assertFalse(vnfRollback0.isBase());
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertFalse(vnfRollback0.getVnfCreated());
+  }
+
+  @Test(timeout = 4000)
+  public void test36()  throws Throwable  {
+      VnfRollback vnfRollback0 = new VnfRollback(", tenant=", ", tenant=", ", tenant=", false, false, (MsoRequest) null, ", tenant=", "f5`2h^e^.-x", ", tenant=");
+      String string0 = vnfRollback0.getVnfId();
+      assertEquals(", tenant=", string0);
+      assertEquals(", tenant=", vnfRollback0.getTenantId());
+      assertFalse(vnfRollback0.getVnfCreated());
+      assertFalse(vnfRollback0.isBase());
+      assertFalse(vnfRollback0.getTenantCreated());
+      assertEquals(", tenant=", vnfRollback0.getCloudSiteId());
+      assertEquals(", tenant=", vnfRollback0.getVolumeGroupName());
+      assertEquals(", tenant=", vnfRollback0.getRequestType());
+      assertEquals("f5`2h^e^.-x", vnfRollback0.getVolumeGroupId());
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/VnfRollbackESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/VnfRollbackESTestscaffolding.java
new file mode 100644
index 0000000..e07b2cf
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/beans/VnfRollbackESTestscaffolding.java
@@ -0,0 +1,79 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Mon Nov 14 08:51:17 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.beans;
+
+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;
+
+@EvoSuiteClassExclude
+public class VnfRollbackESTestscaffolding {
+
+  @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.openstack.beans.VnfRollback"; 
+    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(VnfRollbackESTestscaffolding.class.getClassLoader() ,
+      "org.openecomp.mso.openstack.beans.VnfRollback",
+      "org.openecomp.mso.entity.MsoRequest"
+    );
+  } 
+
+  private static void resetClasses() {
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoAdapterExceptionESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoAdapterExceptionESTest.java
new file mode 100644
index 0000000..ccc5a94
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoAdapterExceptionESTest.java
@@ -0,0 +1,24 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Mon Nov 14 08:51:02 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class MsoAdapterExceptionESTest extends MsoAdapterExceptionESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test0()  throws Throwable  {
+      MsoAdapterException msoAdapterException0 = new MsoAdapterException("");
+      MsoAdapterException msoAdapterException1 = new MsoAdapterException("", (Throwable) msoAdapterException0);
+      assertFalse(msoAdapterException1.equals((Object)msoAdapterException0));
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoAdapterExceptionESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoAdapterExceptionESTestscaffolding.java
new file mode 100644
index 0000000..657b8b2
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoAdapterExceptionESTestscaffolding.java
@@ -0,0 +1,87 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Mon Nov 14 08:51:02 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+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;
+
+@EvoSuiteClassExclude
+public class MsoAdapterExceptionESTestscaffolding {
+
+  @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.openstack.exceptions.MsoAdapterException"; 
+    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(MsoAdapterExceptionESTestscaffolding.class.getClassLoader() ,
+      "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory",
+      "org.openecomp.mso.openstack.exceptions.MsoException",
+      "org.openecomp.mso.openstack.exceptions.MsoAdapterException"
+    );
+  } 
+
+  private static void resetClasses() {
+    org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(MsoAdapterExceptionESTestscaffolding.class.getClassLoader());
+
+    org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
+      "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory",
+      "org.openecomp.mso.openstack.exceptions.MsoException",
+      "org.openecomp.mso.openstack.exceptions.MsoAdapterException"
+    );
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoCloudSiteNotFoundESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoCloudSiteNotFoundESTest.java
new file mode 100644
index 0000000..f840c12
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoCloudSiteNotFoundESTest.java
@@ -0,0 +1,30 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Mon Nov 14 08:56:48 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class MsoCloudSiteNotFoundESTest extends MsoCloudSiteNotFoundESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test0()  throws Throwable  {
+      MsoCloudSiteNotFound msoCloudSiteNotFound0 = new MsoCloudSiteNotFound();
+      assertEquals(MsoExceptionCategory.USERDATA, msoCloudSiteNotFound0.getCategory());
+  }
+
+  @Test(timeout = 4000)
+  public void test1()  throws Throwable  {
+      MsoCloudSiteNotFound msoCloudSiteNotFound0 = new MsoCloudSiteNotFound("NQz5T^");
+      String string0 = msoCloudSiteNotFound0.toString();
+      assertEquals("Cloud Site [NQz5T^] not found", string0);
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoCloudSiteNotFoundESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoCloudSiteNotFoundESTestscaffolding.java
new file mode 100644
index 0000000..ba28705
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoCloudSiteNotFoundESTestscaffolding.java
@@ -0,0 +1,87 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Mon Nov 14 08:56:48 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+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;
+
+@EvoSuiteClassExclude
+public class MsoCloudSiteNotFoundESTestscaffolding {
+
+  @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.openstack.exceptions.MsoCloudSiteNotFound"; 
+    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(MsoCloudSiteNotFoundESTestscaffolding.class.getClassLoader() ,
+      "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory",
+      "org.openecomp.mso.openstack.exceptions.MsoCloudSiteNotFound",
+      "org.openecomp.mso.openstack.exceptions.MsoException"
+    );
+  } 
+
+  private static void resetClasses() {
+    org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(MsoCloudSiteNotFoundESTestscaffolding.class.getClassLoader());
+
+    org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
+      "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory",
+      "org.openecomp.mso.openstack.exceptions.MsoException",
+      "org.openecomp.mso.openstack.exceptions.MsoCloudSiteNotFound"
+    );
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoExceptionESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoExceptionESTest.java
new file mode 100644
index 0000000..2bd71fb
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoExceptionESTest.java
@@ -0,0 +1,77 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Mon Nov 14 08:48:01 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class MsoExceptionESTest extends MsoExceptionESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test0()  throws Throwable  {
+      MsoTenantNotFound msoTenantNotFound0 = new MsoTenantNotFound("T&~q", "Cloud Site [");
+      MsoIOException msoIOException0 = new MsoIOException("", (Throwable) msoTenantNotFound0);
+      String string0 = msoIOException0.getContextMessage();
+      assertEquals("", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test1()  throws Throwable  {
+      MsoNetworkNotFound msoNetworkNotFound0 = new MsoNetworkNotFound("", "", "");
+      msoNetworkNotFound0.addContext("");
+      String string0 = msoNetworkNotFound0.getContext();
+      assertEquals("", string0);
+      assertNotNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test2()  throws Throwable  {
+      MsoAdapterException msoAdapterException0 = new MsoAdapterException(" ");
+      msoAdapterException0.setContext(" ");
+      String string0 = msoAdapterException0.getContextMessage();
+      assertEquals("[ ]  ", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test3()  throws Throwable  {
+      MsoCloudSiteNotFound msoCloudSiteNotFound0 = new MsoCloudSiteNotFound();
+      MsoAdapterException msoAdapterException0 = new MsoAdapterException("", (Throwable) msoCloudSiteNotFound0);
+      msoAdapterException0.addContext("");
+      msoAdapterException0.addContext("");
+      String string0 = msoAdapterException0.getContext();
+      assertEquals(":", msoAdapterException0.getContext());
+      assertNotNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test4()  throws Throwable  {
+      MsoCloudSiteNotFound msoCloudSiteNotFound0 = new MsoCloudSiteNotFound((String) null);
+      MsoExceptionCategory msoExceptionCategory0 = msoCloudSiteNotFound0.getCategory();
+      MsoAdapterException msoAdapterException0 = new MsoAdapterException((String) null, (Throwable) msoCloudSiteNotFound0);
+      msoAdapterException0.setCategory(msoExceptionCategory0);
+      assertNull(msoAdapterException0.getContext());
+  }
+
+  @Test(timeout = 4000)
+  public void test5()  throws Throwable  {
+      MsoNetworkNotFound msoNetworkNotFound0 = new MsoNetworkNotFound("", "", "");
+      String string0 = msoNetworkNotFound0.getContext();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test6()  throws Throwable  {
+      MsoCloudSiteNotFound msoCloudSiteNotFound0 = new MsoCloudSiteNotFound((String) null);
+      MsoAdapterException msoAdapterException0 = new MsoAdapterException((String) null, (Throwable) msoCloudSiteNotFound0);
+      String string0 = msoAdapterException0.getContextMessage();
+      assertNull(string0);
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoExceptionESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoExceptionESTestscaffolding.java
new file mode 100644
index 0000000..8ce85b7
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoExceptionESTestscaffolding.java
@@ -0,0 +1,101 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Mon Nov 14 08:48:01 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+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;
+
+@EvoSuiteClassExclude
+public class MsoExceptionESTestscaffolding {
+
+  @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.openstack.exceptions.MsoException"; 
+    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(MsoExceptionESTestscaffolding.class.getClassLoader() ,
+      "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory",
+      "org.openecomp.mso.openstack.exceptions.MsoTenantNotFound",
+      "org.openecomp.mso.openstack.exceptions.MsoIOException",
+      "org.openecomp.mso.openstack.exceptions.MsoCloudSiteNotFound",
+      "org.openecomp.mso.openstack.exceptions.MsoNetworkNotFound",
+      "org.openecomp.mso.openstack.exceptions.MsoException",
+      "org.openecomp.mso.openstack.exceptions.MsoAdapterException",
+      "org.openecomp.mso.openstack.exceptions.MsoOpenstackException"
+    );
+  } 
+
+  private static void resetClasses() {
+    org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(MsoExceptionESTestscaffolding.class.getClassLoader());
+
+    org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
+      "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory",
+      "org.openecomp.mso.openstack.exceptions.MsoCloudSiteNotFound",
+      "org.openecomp.mso.openstack.exceptions.MsoIOException",
+      "org.openecomp.mso.openstack.exceptions.MsoOpenstackException",
+      "org.openecomp.mso.openstack.exceptions.MsoNetworkAlreadyExists",
+      "org.openecomp.mso.openstack.exceptions.MsoNetworkNotFound",
+      "org.openecomp.mso.openstack.exceptions.MsoStackAlreadyExists",
+      "org.openecomp.mso.openstack.exceptions.MsoStackNotFound",
+      "org.openecomp.mso.openstack.exceptions.MsoTenantNotFound",
+      "org.openecomp.mso.openstack.exceptions.MsoAdapterException",
+      "org.openecomp.mso.openstack.exceptions.MsoTenantAlreadyExists",
+      "org.openecomp.mso.openstack.exceptions.MsoException"
+    );
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoIOExceptionESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoIOExceptionESTest.java
new file mode 100644
index 0000000..ec2699c
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoIOExceptionESTest.java
@@ -0,0 +1,24 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Mon Nov 14 08:50:20 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class MsoIOExceptionESTest extends MsoIOExceptionESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test0()  throws Throwable  {
+      MsoIOException msoIOException0 = new MsoIOException("");
+      MsoIOException msoIOException1 = new MsoIOException("", (Throwable) msoIOException0);
+      assertNull(msoIOException1.getContext());
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoIOExceptionESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoIOExceptionESTestscaffolding.java
new file mode 100644
index 0000000..e657718
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoIOExceptionESTestscaffolding.java
@@ -0,0 +1,87 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Mon Nov 14 08:50:20 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+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;
+
+@EvoSuiteClassExclude
+public class MsoIOExceptionESTestscaffolding {
+
+  @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.openstack.exceptions.MsoIOException"; 
+    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(MsoIOExceptionESTestscaffolding.class.getClassLoader() ,
+      "org.openecomp.mso.openstack.exceptions.MsoIOException",
+      "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory",
+      "org.openecomp.mso.openstack.exceptions.MsoException"
+    );
+  } 
+
+  private static void resetClasses() {
+    org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(MsoIOExceptionESTestscaffolding.class.getClassLoader());
+
+    org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
+      "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory",
+      "org.openecomp.mso.openstack.exceptions.MsoException",
+      "org.openecomp.mso.openstack.exceptions.MsoIOException"
+    );
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoNetworkAlreadyExistsESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoNetworkAlreadyExistsESTest.java
new file mode 100644
index 0000000..2c423b7
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoNetworkAlreadyExistsESTest.java
@@ -0,0 +1,23 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Mon Nov 14 08:52:37 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class MsoNetworkAlreadyExistsESTest extends MsoNetworkAlreadyExistsESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test0()  throws Throwable  {
+      MsoNetworkAlreadyExists msoNetworkAlreadyExists0 = new MsoNetworkAlreadyExists((String) null, (String) null, (String) null);
+      assertNull(msoNetworkAlreadyExists0.getContext());
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoNetworkAlreadyExistsESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoNetworkAlreadyExistsESTestscaffolding.java
new file mode 100644
index 0000000..1c00ba9
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoNetworkAlreadyExistsESTestscaffolding.java
@@ -0,0 +1,89 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Mon Nov 14 08:52:37 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+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;
+
+@EvoSuiteClassExclude
+public class MsoNetworkAlreadyExistsESTestscaffolding {
+
+  @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.openstack.exceptions.MsoNetworkAlreadyExists"; 
+    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(MsoNetworkAlreadyExistsESTestscaffolding.class.getClassLoader() ,
+      "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory",
+      "org.openecomp.mso.openstack.exceptions.MsoNetworkAlreadyExists",
+      "org.openecomp.mso.openstack.exceptions.MsoException",
+      "org.openecomp.mso.openstack.exceptions.MsoOpenstackException"
+    );
+  } 
+
+  private static void resetClasses() {
+    org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(MsoNetworkAlreadyExistsESTestscaffolding.class.getClassLoader());
+
+    org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
+      "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory",
+      "org.openecomp.mso.openstack.exceptions.MsoException",
+      "org.openecomp.mso.openstack.exceptions.MsoOpenstackException",
+      "org.openecomp.mso.openstack.exceptions.MsoNetworkAlreadyExists"
+    );
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoNetworkNotFoundESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoNetworkNotFoundESTest.java
new file mode 100644
index 0000000..4185450
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoNetworkNotFoundESTest.java
@@ -0,0 +1,23 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Mon Nov 14 08:54:45 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class MsoNetworkNotFoundESTest extends MsoNetworkNotFoundESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test0()  throws Throwable  {
+      MsoNetworkNotFound msoNetworkNotFound0 = new MsoNetworkNotFound("6", "6", "yX9(}I;;7<c%.4HYX");
+      assertNull(msoNetworkNotFound0.getContext());
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoNetworkNotFoundESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoNetworkNotFoundESTestscaffolding.java
new file mode 100644
index 0000000..1506836
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoNetworkNotFoundESTestscaffolding.java
@@ -0,0 +1,89 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Mon Nov 14 08:54:45 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+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;
+
+@EvoSuiteClassExclude
+public class MsoNetworkNotFoundESTestscaffolding {
+
+  @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.openstack.exceptions.MsoNetworkNotFound"; 
+    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(MsoNetworkNotFoundESTestscaffolding.class.getClassLoader() ,
+      "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory",
+      "org.openecomp.mso.openstack.exceptions.MsoNetworkNotFound",
+      "org.openecomp.mso.openstack.exceptions.MsoException",
+      "org.openecomp.mso.openstack.exceptions.MsoOpenstackException"
+    );
+  } 
+
+  private static void resetClasses() {
+    org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(MsoNetworkNotFoundESTestscaffolding.class.getClassLoader());
+
+    org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
+      "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory",
+      "org.openecomp.mso.openstack.exceptions.MsoException",
+      "org.openecomp.mso.openstack.exceptions.MsoOpenstackException",
+      "org.openecomp.mso.openstack.exceptions.MsoNetworkNotFound"
+    );
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackExceptionESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackExceptionESTest.java
new file mode 100644
index 0000000..00d7035
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackExceptionESTest.java
@@ -0,0 +1,32 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Mon Nov 14 08:51:53 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class MsoOpenstackExceptionESTest extends MsoOpenstackExceptionESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test0()  throws Throwable  {
+      MsoOpenstackException msoOpenstackException0 = new MsoOpenstackException((-20), "zOT*@]B@O~zuv2", "zOT*@]B@O~zuv2");
+      MsoOpenstackException msoOpenstackException1 = new MsoOpenstackException((-20), "zOT*@]B@O~zuv2", "zOT*@]B@O~zuv2", (Exception) msoOpenstackException0);
+      assertEquals(MsoExceptionCategory.OPENSTACK, msoOpenstackException1.getCategory());
+  }
+
+  @Test(timeout = 4000)
+  public void test1()  throws Throwable  {
+      MsoOpenstackException msoOpenstackException0 = new MsoOpenstackException((-20), "zOT*@]B@O~zuv2", "zOT*@]B@O~zuv2");
+      String string0 = msoOpenstackException0.toString();
+      assertNotNull(string0);
+      assertEquals("-20 zOT*@]B@O~zuv2: zOT*@]B@O~zuv2", string0);
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackExceptionESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackExceptionESTestscaffolding.java
new file mode 100644
index 0000000..78a71cc
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoOpenstackExceptionESTestscaffolding.java
@@ -0,0 +1,87 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Mon Nov 14 08:51:53 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+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;
+
+@EvoSuiteClassExclude
+public class MsoOpenstackExceptionESTestscaffolding {
+
+  @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.openstack.exceptions.MsoOpenstackException"; 
+    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(MsoOpenstackExceptionESTestscaffolding.class.getClassLoader() ,
+      "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory",
+      "org.openecomp.mso.openstack.exceptions.MsoException",
+      "org.openecomp.mso.openstack.exceptions.MsoOpenstackException"
+    );
+  } 
+
+  private static void resetClasses() {
+    org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(MsoOpenstackExceptionESTestscaffolding.class.getClassLoader());
+
+    org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
+      "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory",
+      "org.openecomp.mso.openstack.exceptions.MsoException",
+      "org.openecomp.mso.openstack.exceptions.MsoOpenstackException"
+    );
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoStackAlreadyExistsESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoStackAlreadyExistsESTest.java
new file mode 100644
index 0000000..289b2a6
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoStackAlreadyExistsESTest.java
@@ -0,0 +1,23 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Mon Nov 14 08:55:08 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class MsoStackAlreadyExistsESTest extends MsoStackAlreadyExistsESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test0()  throws Throwable  {
+      MsoStackAlreadyExists msoStackAlreadyExists0 = new MsoStackAlreadyExists("", "", "");
+      assertEquals(MsoExceptionCategory.OPENSTACK, msoStackAlreadyExists0.getCategory());
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoStackAlreadyExistsESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoStackAlreadyExistsESTestscaffolding.java
new file mode 100644
index 0000000..c7b8c85
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoStackAlreadyExistsESTestscaffolding.java
@@ -0,0 +1,89 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Mon Nov 14 08:55:08 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+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;
+
+@EvoSuiteClassExclude
+public class MsoStackAlreadyExistsESTestscaffolding {
+
+  @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.openstack.exceptions.MsoStackAlreadyExists"; 
+    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(MsoStackAlreadyExistsESTestscaffolding.class.getClassLoader() ,
+      "org.openecomp.mso.openstack.exceptions.MsoStackAlreadyExists",
+      "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory",
+      "org.openecomp.mso.openstack.exceptions.MsoException",
+      "org.openecomp.mso.openstack.exceptions.MsoOpenstackException"
+    );
+  } 
+
+  private static void resetClasses() {
+    org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(MsoStackAlreadyExistsESTestscaffolding.class.getClassLoader());
+
+    org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
+      "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory",
+      "org.openecomp.mso.openstack.exceptions.MsoException",
+      "org.openecomp.mso.openstack.exceptions.MsoOpenstackException",
+      "org.openecomp.mso.openstack.exceptions.MsoStackAlreadyExists"
+    );
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoStackNotFoundESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoStackNotFoundESTest.java
new file mode 100644
index 0000000..e8b6e85
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoStackNotFoundESTest.java
@@ -0,0 +1,23 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Mon Nov 14 08:55:36 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class MsoStackNotFoundESTest extends MsoStackNotFoundESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test0()  throws Throwable  {
+      MsoStackNotFound msoStackNotFound0 = new MsoStackNotFound("", (String) null, (String) null);
+      assertEquals(MsoExceptionCategory.OPENSTACK, msoStackNotFound0.getCategory());
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoStackNotFoundESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoStackNotFoundESTestscaffolding.java
new file mode 100644
index 0000000..3ce0916
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoStackNotFoundESTestscaffolding.java
@@ -0,0 +1,89 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Mon Nov 14 08:55:36 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+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;
+
+@EvoSuiteClassExclude
+public class MsoStackNotFoundESTestscaffolding {
+
+  @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.openstack.exceptions.MsoStackNotFound"; 
+    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(MsoStackNotFoundESTestscaffolding.class.getClassLoader() ,
+      "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory",
+      "org.openecomp.mso.openstack.exceptions.MsoStackNotFound",
+      "org.openecomp.mso.openstack.exceptions.MsoException",
+      "org.openecomp.mso.openstack.exceptions.MsoOpenstackException"
+    );
+  } 
+
+  private static void resetClasses() {
+    org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(MsoStackNotFoundESTestscaffolding.class.getClassLoader());
+
+    org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
+      "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory",
+      "org.openecomp.mso.openstack.exceptions.MsoException",
+      "org.openecomp.mso.openstack.exceptions.MsoOpenstackException",
+      "org.openecomp.mso.openstack.exceptions.MsoStackNotFound"
+    );
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoTenantAlreadyExistsESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoTenantAlreadyExistsESTest.java
new file mode 100644
index 0000000..a47f778
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoTenantAlreadyExistsESTest.java
@@ -0,0 +1,23 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Mon Nov 14 08:56:00 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class MsoTenantAlreadyExistsESTest extends MsoTenantAlreadyExistsESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test0()  throws Throwable  {
+      MsoTenantAlreadyExists msoTenantAlreadyExists0 = new MsoTenantAlreadyExists("Q]>\u00018.eW8", "Q]>\u00018.eW8");
+      assertEquals(MsoExceptionCategory.OPENSTACK, msoTenantAlreadyExists0.getCategory());
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoTenantAlreadyExistsESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoTenantAlreadyExistsESTestscaffolding.java
new file mode 100644
index 0000000..11700e6
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoTenantAlreadyExistsESTestscaffolding.java
@@ -0,0 +1,89 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Mon Nov 14 08:56:00 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+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;
+
+@EvoSuiteClassExclude
+public class MsoTenantAlreadyExistsESTestscaffolding {
+
+  @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.openstack.exceptions.MsoTenantAlreadyExists"; 
+    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(MsoTenantAlreadyExistsESTestscaffolding.class.getClassLoader() ,
+      "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory",
+      "org.openecomp.mso.openstack.exceptions.MsoTenantAlreadyExists",
+      "org.openecomp.mso.openstack.exceptions.MsoException",
+      "org.openecomp.mso.openstack.exceptions.MsoOpenstackException"
+    );
+  } 
+
+  private static void resetClasses() {
+    org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(MsoTenantAlreadyExistsESTestscaffolding.class.getClassLoader());
+
+    org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
+      "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory",
+      "org.openecomp.mso.openstack.exceptions.MsoException",
+      "org.openecomp.mso.openstack.exceptions.MsoOpenstackException",
+      "org.openecomp.mso.openstack.exceptions.MsoTenantAlreadyExists"
+    );
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoTenantNotFoundESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoTenantNotFoundESTest.java
new file mode 100644
index 0000000..b65bd1f
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoTenantNotFoundESTest.java
@@ -0,0 +1,23 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Mon Nov 14 08:52:17 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class MsoTenantNotFoundESTest extends MsoTenantNotFoundESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test0()  throws Throwable  {
+      MsoTenantNotFound msoTenantNotFound0 = new MsoTenantNotFound("", "");
+      assertEquals(MsoExceptionCategory.OPENSTACK, msoTenantNotFound0.getCategory());
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoTenantNotFoundESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoTenantNotFoundESTestscaffolding.java
new file mode 100644
index 0000000..bd45ba6
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/exceptions/MsoTenantNotFoundESTestscaffolding.java
@@ -0,0 +1,89 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Mon Nov 14 08:52:17 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.exceptions;
+
+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;
+
+@EvoSuiteClassExclude
+public class MsoTenantNotFoundESTestscaffolding {
+
+  @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.openstack.exceptions.MsoTenantNotFound"; 
+    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(MsoTenantNotFoundESTestscaffolding.class.getClassLoader() ,
+      "org.openecomp.mso.openstack.exceptions.MsoTenantNotFound",
+      "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory",
+      "org.openecomp.mso.openstack.exceptions.MsoException",
+      "org.openecomp.mso.openstack.exceptions.MsoOpenstackException"
+    );
+  } 
+
+  private static void resetClasses() {
+    org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(MsoTenantNotFoundESTestscaffolding.class.getClassLoader());
+
+    org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
+      "org.openecomp.mso.openstack.exceptions.MsoExceptionCategory",
+      "org.openecomp.mso.openstack.exceptions.MsoException",
+      "org.openecomp.mso.openstack.exceptions.MsoOpenstackException",
+      "org.openecomp.mso.openstack.exceptions.MsoTenantNotFound"
+    );
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentEntryESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentEntryESTest.java
new file mode 100644
index 0000000..6eaac45
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentEntryESTest.java
@@ -0,0 +1,562 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Mon Nov 14 08:40:12 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.utils;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+import static org.evosuite.shaded.org.mockito.Mockito.*;
+import static org.evosuite.runtime.EvoAssertions.*;
+import org.openecomp.mso.db.catalog.beans.HeatTemplateParam;
+
+import java.util.LinkedHashSet;
+import java.util.Set;
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.evosuite.runtime.PrivateAccess;
+import org.evosuite.runtime.ViolatedAssumptionAnswer;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true)
+public class MsoHeatEnvironmentEntryESTest {
+
+  @Test(timeout = 4000)
+  public void test00()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      Set<MsoHeatEnvironmentResource> set0 = (Set<MsoHeatEnvironmentResource>) mock(Set.class, new ViolatedAssumptionAnswer());
+      doReturn((-237540137)).when(set0).size();
+      msoHeatEnvironmentEntry0.setResources(set0);
+      boolean boolean0 = msoHeatEnvironmentEntry0.hasResources();
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+      assertFalse(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test01()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      PrivateAccess.setVariable((Class<MsoHeatEnvironmentEntry>) MsoHeatEnvironmentEntry.class, msoHeatEnvironmentEntry0, "valid", (Object) false);
+      boolean boolean0 = msoHeatEnvironmentEntry0.isValid();
+      assertFalse(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test02()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      LinkedHashSet<MsoHeatEnvironmentResource> linkedHashSet0 = new LinkedHashSet<MsoHeatEnvironmentResource>();
+      msoHeatEnvironmentEntry0.setResources(linkedHashSet0);
+      msoHeatEnvironmentEntry0.getResources();
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+
+  @Test(timeout = 4000)
+  public void test03()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource("9>KEckx", "8&T!e[SABZ");
+      msoHeatEnvironmentEntry0.addResource(msoHeatEnvironmentResource0);
+      msoHeatEnvironmentEntry0.getResources();
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+
+  @Test(timeout = 4000)
+  public void test04()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      StringBuilder stringBuilder0 = msoHeatEnvironmentEntry0.toFullString();
+      PrivateAccess.setVariable((Class<MsoHeatEnvironmentEntry>) MsoHeatEnvironmentEntry.class, msoHeatEnvironmentEntry0, "rawEntry", (Object) stringBuilder0);
+      StringBuilder stringBuilder1 = msoHeatEnvironmentEntry0.getRawEntry();
+      assertEquals("\nnull", stringBuilder1.toString());
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+
+  @Test(timeout = 4000)
+  public void test05()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      LinkedHashSet<MsoHeatEnvironmentParameter> linkedHashSet0 = new LinkedHashSet<MsoHeatEnvironmentParameter>();
+      msoHeatEnvironmentEntry0.setParameters(linkedHashSet0);
+      msoHeatEnvironmentEntry0.getParameters();
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+
+  @Test(timeout = 4000)
+  public void test06()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter();
+      msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter0);
+      msoHeatEnvironmentEntry0.getParameters();
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+
+  @Test(timeout = 4000)
+  public void test07()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      LinkedHashSet<MsoHeatEnvironmentResource> linkedHashSet0 = new LinkedHashSet<MsoHeatEnvironmentResource>();
+      msoHeatEnvironmentEntry0.setResources(linkedHashSet0);
+      msoHeatEnvironmentEntry0.getNumberOfResources();
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+
+  @Test(timeout = 4000)
+  public void test08()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource();
+      msoHeatEnvironmentEntry0.addResource(msoHeatEnvironmentResource0);
+      msoHeatEnvironmentEntry0.getNumberOfResources();
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+
+  @Test(timeout = 4000)
+  public void test09()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      Set<MsoHeatEnvironmentResource> set0 = (Set<MsoHeatEnvironmentResource>) mock(Set.class, new ViolatedAssumptionAnswer());
+      doReturn(0).when(set0).size();
+      msoHeatEnvironmentEntry0.setResources(set0);
+      msoHeatEnvironmentEntry0.getNumberOfResources();
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+
+  @Test(timeout = 4000)
+  public void test10()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      LinkedHashSet<MsoHeatEnvironmentParameter> linkedHashSet0 = new LinkedHashSet<MsoHeatEnvironmentParameter>();
+      msoHeatEnvironmentEntry0.setParameters(linkedHashSet0);
+      msoHeatEnvironmentEntry0.getNumberOfParameters();
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+
+  @Test(timeout = 4000)
+  public void test11()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter();
+      msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter0);
+      msoHeatEnvironmentEntry0.getNumberOfParameters();
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+
+  @Test(timeout = 4000)
+  public void test12()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      PrivateAccess.setVariable((Class<MsoHeatEnvironmentEntry>) MsoHeatEnvironmentEntry.class, msoHeatEnvironmentEntry0, "errorString", (Object) "Param=");
+      msoHeatEnvironmentEntry0.getErrorString();
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+
+  @Test(timeout = 4000)
+  public void test13()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      Set<HeatTemplateParam> set0 = (Set<HeatTemplateParam>) mock(Set.class, new ViolatedAssumptionAnswer());
+      doReturn((-2945)).when(set0).size();
+      // Undeclared exception!
+      try {
+        msoHeatEnvironmentEntry0.toFullStringExcludeNonParams(set0);
+        fail("Expecting exception: IllegalArgumentException");
+
+      } catch(IllegalArgumentException e) {
+         //
+         // Illegal Capacity: -2945
+         //
+         verifyException("java.util.ArrayList", e);
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test14()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      LinkedHashSet<MsoHeatEnvironmentParameter> linkedHashSet0 = new LinkedHashSet<MsoHeatEnvironmentParameter>();
+      linkedHashSet0.add((MsoHeatEnvironmentParameter) null);
+      msoHeatEnvironmentEntry0.setParameters(linkedHashSet0);
+      // Undeclared exception!
+      try {
+        msoHeatEnvironmentEntry0.toFullString();
+        fail("Expecting exception: NullPointerException");
+
+      } catch(NullPointerException e) {
+         //
+         // no message in exception (getMessage() returned null)
+         //
+         verifyException("org.openecomp.mso.openstack.utils.MsoHeatEnvironmentEntry", e);
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test15()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter();
+      msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter0);
+      // Undeclared exception!
+      try {
+        msoHeatEnvironmentEntry0.containsParameter((String) null, "");
+        fail("Expecting exception: NullPointerException");
+
+      } catch(NullPointerException e) {
+         //
+         // no message in exception (getMessage() returned null)
+         //
+         verifyException("org.openecomp.mso.openstack.utils.MsoHeatEnvironmentParameter", e);
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test16()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      LinkedHashSet<MsoHeatEnvironmentParameter> linkedHashSet0 = new LinkedHashSet<MsoHeatEnvironmentParameter>();
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter();
+      linkedHashSet0.add(msoHeatEnvironmentParameter0);
+      msoHeatEnvironmentEntry0.setParameters(linkedHashSet0);
+      // Undeclared exception!
+      try {
+        msoHeatEnvironmentEntry0.containsParameter((String) null);
+        fail("Expecting exception: NullPointerException");
+
+      } catch(NullPointerException e) {
+         //
+         // no message in exception (getMessage() returned null)
+         //
+         verifyException("org.openecomp.mso.openstack.utils.MsoHeatEnvironmentParameter", e);
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test17()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource();
+      msoHeatEnvironmentEntry0.addResource(msoHeatEnvironmentResource0);
+      MsoHeatEnvironmentResource msoHeatEnvironmentResource1 = new MsoHeatEnvironmentResource();
+      // Undeclared exception!
+      try {
+        msoHeatEnvironmentEntry0.addResource(msoHeatEnvironmentResource1);
+        fail("Expecting exception: NullPointerException");
+
+      } catch(NullPointerException e) {
+         //
+         // no message in exception (getMessage() returned null)
+         //
+         verifyException("org.openecomp.mso.openstack.utils.MsoHeatEnvironmentResource", e);
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test18()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter();
+      msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter0);
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter1 = new MsoHeatEnvironmentParameter();
+      // Undeclared exception!
+      try {
+        msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter1);
+        fail("Expecting exception: NullPointerException");
+
+      } catch(NullPointerException e) {
+         //
+         // no message in exception (getMessage() returned null)
+         //
+         verifyException("org.openecomp.mso.openstack.utils.MsoHeatEnvironmentParameter", e);
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test19()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter("", "");
+      msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter0);
+      boolean boolean0 = msoHeatEnvironmentEntry0.containsParameter("");
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+      assertTrue(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test20()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter();
+      msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter0);
+      boolean boolean0 = msoHeatEnvironmentEntry0.hasParameters();
+      assertTrue(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test21()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      msoHeatEnvironmentEntry0.hasParameters();
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+
+  @Test(timeout = 4000)
+  public void test22()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      LinkedHashSet<MsoHeatEnvironmentParameter> linkedHashSet0 = new LinkedHashSet<MsoHeatEnvironmentParameter>();
+      msoHeatEnvironmentEntry0.setParameters(linkedHashSet0);
+      boolean boolean0 = msoHeatEnvironmentEntry0.hasParameters();
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+      assertFalse(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test23()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      PrivateAccess.callMethod((Class<MsoHeatEnvironmentEntry>) MsoHeatEnvironmentEntry.class, msoHeatEnvironmentEntry0, "getResourceRegistryRawEntry");
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+
+  @Test(timeout = 4000)
+  public void test24()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      LinkedHashSet<HeatTemplateParam> linkedHashSet0 = new LinkedHashSet<HeatTemplateParam>();
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter();
+      msoHeatEnvironmentParameter0.setValue("_BAD");
+      HeatTemplateParam heatTemplateParam0 = new HeatTemplateParam();
+      linkedHashSet0.add(heatTemplateParam0);
+      msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter0);
+      msoHeatEnvironmentEntry0.toFullStringExcludeNonParams(linkedHashSet0);
+      assertTrue(msoHeatEnvironmentEntry0.hasParameters());
+  }
+
+  @Test(timeout = 4000)
+  public void test25()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      LinkedHashSet<HeatTemplateParam> linkedHashSet0 = new LinkedHashSet<HeatTemplateParam>();
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter();
+      msoHeatEnvironmentParameter0.setValue("t'N`.KI:L9");
+      HeatTemplateParam heatTemplateParam0 = new HeatTemplateParam();
+      linkedHashSet0.add(heatTemplateParam0);
+      msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter0);
+      msoHeatEnvironmentEntry0.toFullStringExcludeNonParams(linkedHashSet0);
+      assertTrue(msoHeatEnvironmentEntry0.hasParameters());
+  }
+
+  @Test(timeout = 4000)
+  public void test26()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      LinkedHashSet<HeatTemplateParam> linkedHashSet0 = new LinkedHashSet<HeatTemplateParam>();
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter();
+      HeatTemplateParam heatTemplateParam0 = new HeatTemplateParam();
+      linkedHashSet0.add(heatTemplateParam0);
+      msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter0);
+      // Undeclared exception!
+      try {
+        msoHeatEnvironmentEntry0.toFullStringExcludeNonParams(linkedHashSet0);
+        fail("Expecting exception: NullPointerException");
+
+      } catch(NullPointerException e) {
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test27()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter("");
+      msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter0);
+      LinkedHashSet<HeatTemplateParam> linkedHashSet0 = new LinkedHashSet<HeatTemplateParam>();
+      msoHeatEnvironmentEntry0.toFullStringExcludeNonParams(linkedHashSet0);
+      assertTrue(msoHeatEnvironmentEntry0.hasParameters());
+  }
+
+  @Test(timeout = 4000)
+  public void test28()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      LinkedHashSet<HeatTemplateParam> linkedHashSet0 = new LinkedHashSet<HeatTemplateParam>();
+      HeatTemplateParam heatTemplateParam0 = new HeatTemplateParam();
+      linkedHashSet0.add(heatTemplateParam0);
+      msoHeatEnvironmentEntry0.toFullStringExcludeNonParams(linkedHashSet0);
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+
+  @Test(timeout = 4000)
+  public void test29()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      assertFalse(msoHeatEnvironmentEntry0.hasParameters());
+
+      LinkedHashSet<HeatTemplateParam> linkedHashSet0 = new LinkedHashSet<HeatTemplateParam>();
+      StringBuilder stringBuilder0 = msoHeatEnvironmentEntry0.toFullStringExcludeNonParams(linkedHashSet0);
+      PrivateAccess.setVariable((Class<MsoHeatEnvironmentEntry>) MsoHeatEnvironmentEntry.class, msoHeatEnvironmentEntry0, "rawEntry", (Object) stringBuilder0);
+      StringBuilder stringBuilder1 = (StringBuilder)PrivateAccess.callMethod((Class<MsoHeatEnvironmentEntry>) MsoHeatEnvironmentEntry.class, msoHeatEnvironmentEntry0, "getResourceRegistryRawEntry");
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+      assertNull(stringBuilder1);
+  }
+
+  @Test(timeout = 4000)
+  public void test30()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter("");
+      msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter0);
+      boolean boolean0 = msoHeatEnvironmentEntry0.containsParameter("9MTP2Qt0FH.^", "");
+      assertTrue(boolean0);
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+
+  @Test(timeout = 4000)
+  public void test31()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      boolean boolean0 = msoHeatEnvironmentEntry0.containsParameter("dP:* hj", "dP:* hj");
+      assertFalse(boolean0);
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+
+  @Test(timeout = 4000)
+  public void test32()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter("");
+      msoHeatEnvironmentEntry0.addParameter(msoHeatEnvironmentParameter0);
+      boolean boolean0 = msoHeatEnvironmentEntry0.containsParameter("", "");
+      assertTrue(boolean0);
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+
+  @Test(timeout = 4000)
+  public void test33()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      LinkedHashSet<MsoHeatEnvironmentParameter> linkedHashSet0 = new LinkedHashSet<MsoHeatEnvironmentParameter>();
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = mock(MsoHeatEnvironmentParameter.class, new ViolatedAssumptionAnswer());
+      linkedHashSet0.add(msoHeatEnvironmentParameter0);
+      msoHeatEnvironmentEntry0.setParameters(linkedHashSet0);
+      boolean boolean0 = msoHeatEnvironmentEntry0.containsParameter("kz`LZx");
+      assertTrue(msoHeatEnvironmentEntry0.hasParameters());
+      assertFalse(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test34()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      LinkedHashSet<MsoHeatEnvironmentParameter> linkedHashSet0 = new LinkedHashSet<MsoHeatEnvironmentParameter>();
+      msoHeatEnvironmentEntry0.setParameters(linkedHashSet0);
+      boolean boolean0 = msoHeatEnvironmentEntry0.containsParameter("kz`LZx");
+      assertFalse(boolean0);
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+
+  @Test(timeout = 4000)
+  public void test35()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      boolean boolean0 = msoHeatEnvironmentEntry0.containsParameter(",=?%4z");
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+      assertFalse(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test36()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      LinkedHashSet<MsoHeatEnvironmentParameter> linkedHashSet0 = new LinkedHashSet<MsoHeatEnvironmentParameter>();
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = mock(MsoHeatEnvironmentParameter.class, new ViolatedAssumptionAnswer());
+      doReturn((String) null).when(msoHeatEnvironmentParameter0).getName();
+      doReturn((String) null).when(msoHeatEnvironmentParameter0).getValue();
+      linkedHashSet0.add(msoHeatEnvironmentParameter0);
+      msoHeatEnvironmentEntry0.setParameters(linkedHashSet0);
+      msoHeatEnvironmentEntry0.toFullString();
+      assertTrue(msoHeatEnvironmentEntry0.hasParameters());
+  }
+
+  @Test(timeout = 4000)
+  public void test37()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource("");
+      msoHeatEnvironmentEntry0.addResource(msoHeatEnvironmentResource0);
+      boolean boolean0 = msoHeatEnvironmentEntry0.hasResources();
+      assertTrue(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test38()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      Set<MsoHeatEnvironmentResource> set0 = (Set<MsoHeatEnvironmentResource>) mock(Set.class, new ViolatedAssumptionAnswer());
+      doReturn(0).when(set0).size();
+      msoHeatEnvironmentEntry0.setResources(set0);
+      boolean boolean0 = msoHeatEnvironmentEntry0.hasResources();
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+      assertFalse(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test39()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      boolean boolean0 = msoHeatEnvironmentEntry0.hasResources();
+      assertFalse(boolean0);
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+
+  @Test(timeout = 4000)
+  public void test40()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      msoHeatEnvironmentEntry0.setResources((Set<MsoHeatEnvironmentResource>) null);
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+
+  @Test(timeout = 4000)
+  public void test41()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      msoHeatEnvironmentEntry0.setParameters((Set<MsoHeatEnvironmentParameter>) null);
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+
+
+  @Test(timeout = 4000)
+  public void test43()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      // Undeclared exception!
+      try {
+        msoHeatEnvironmentEntry0.getNumberOfResources();
+        fail("Expecting exception: NullPointerException");
+
+      } catch(NullPointerException e) {
+         //
+         // no message in exception (getMessage() returned null)
+         //
+         verifyException("org.openecomp.mso.openstack.utils.MsoHeatEnvironmentEntry", e);
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test44()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      boolean boolean0 = msoHeatEnvironmentEntry0.isValid();
+      assertTrue(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test45()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry((StringBuilder) null);
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+
+  @Test(timeout = 4000)
+  public void test46()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      // Undeclared exception!
+      try {
+        msoHeatEnvironmentEntry0.getNumberOfParameters();
+        fail("Expecting exception: NullPointerException");
+
+      } catch(NullPointerException e) {
+         //
+         // no message in exception (getMessage() returned null)
+         //
+         verifyException("org.openecomp.mso.openstack.utils.MsoHeatEnvironmentEntry", e);
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test47()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      msoHeatEnvironmentEntry0.getRawEntry();
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+
+  @Test(timeout = 4000)
+  public void test48()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      msoHeatEnvironmentEntry0.getParameters();
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+
+  @Test(timeout = 4000)
+  public void test49()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      msoHeatEnvironmentEntry0.getResources();
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+
+  @Test(timeout = 4000)
+  public void test50()  throws Throwable  {
+      MsoHeatEnvironmentEntry msoHeatEnvironmentEntry0 = new MsoHeatEnvironmentEntry();
+      msoHeatEnvironmentEntry0.getErrorString();
+      assertTrue(msoHeatEnvironmentEntry0.isValid());
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentParameterESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentParameterESTest.java
new file mode 100644
index 0000000..6ec389b
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentParameterESTest.java
@@ -0,0 +1,129 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Mon Nov 14 08:45:40 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.utils;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class MsoHeatEnvironmentParameterESTest extends MsoHeatEnvironmentParameterESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test00()  throws Throwable  {
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter();
+      msoHeatEnvironmentParameter0.hashCode();
+  }
+
+  @Test(timeout = 4000)
+  public void test01()  throws Throwable  {
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter("");
+      boolean boolean0 = msoHeatEnvironmentParameter0.equals(msoHeatEnvironmentParameter0);
+      assertTrue(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test02()  throws Throwable  {
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter("");
+      msoHeatEnvironmentParameter0.setValue("");
+      String string0 = msoHeatEnvironmentParameter0.getValue();
+      assertEquals("", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test03()  throws Throwable  {
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter();
+      String string0 = msoHeatEnvironmentParameter0.getName();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test04()  throws Throwable  {
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter("<*+ogA@v;MO4'8{1");
+      String string0 = msoHeatEnvironmentParameter0.getName();
+      assertEquals("<*+ogA@v;MO4'8{1", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test05()  throws Throwable  {
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter("");
+      String string0 = msoHeatEnvironmentParameter0.getName();
+      assertEquals("", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test06()  throws Throwable  {
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter("", "-3Y=_MqzpVL7|^$8");
+      String string0 = msoHeatEnvironmentParameter0.getValue();
+      assertEquals("-3Y=_MqzpVL7|^$8", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test07()  throws Throwable  {
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter("");
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter1 = new MsoHeatEnvironmentParameter("{Ox?zu\"*");
+      boolean boolean0 = msoHeatEnvironmentParameter1.equals(msoHeatEnvironmentParameter0);
+      assertFalse(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test08()  throws Throwable  {
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter("?.@!au:}y7xGSg|}8");
+      boolean boolean0 = msoHeatEnvironmentParameter0.equals("?.@!au:}y7xGSg|}8");
+      assertFalse(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test09()  throws Throwable  {
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter("");
+      msoHeatEnvironmentParameter0.setName("");
+      assertEquals("", msoHeatEnvironmentParameter0.getName());
+  }
+
+  @Test(timeout = 4000)
+  public void test10()  throws Throwable  {
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter("");
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter1 = new MsoHeatEnvironmentParameter("");
+      boolean boolean0 = msoHeatEnvironmentParameter0.equals(msoHeatEnvironmentParameter1);
+      assertTrue(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test11()  throws Throwable  {
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter("");
+      String string0 = msoHeatEnvironmentParameter0.getValue();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test12()  throws Throwable  {
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter("");
+      msoHeatEnvironmentParameter0.hashCode();
+  }
+
+  @Test(timeout = 4000)
+  public void test13()  throws Throwable  {
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter();
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter1 = new MsoHeatEnvironmentParameter();
+      // Undeclared exception!
+      try { 
+        msoHeatEnvironmentParameter0.equals(msoHeatEnvironmentParameter1);
+        fail("Expecting exception: NullPointerException");
+      
+      } catch(NullPointerException e) {
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test14()  throws Throwable  {
+      MsoHeatEnvironmentParameter msoHeatEnvironmentParameter0 = new MsoHeatEnvironmentParameter("");
+      String string0 = msoHeatEnvironmentParameter0.toString();
+      assertEquals(": null", string0);
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentParameterESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentParameterESTestscaffolding.java
new file mode 100644
index 0000000..f7e33bb
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentParameterESTestscaffolding.java
@@ -0,0 +1,78 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Mon Nov 14 08:45:40 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.utils;
+
+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;
+
+@EvoSuiteClassExclude
+public class MsoHeatEnvironmentParameterESTestscaffolding {
+
+  @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.openstack.utils.MsoHeatEnvironmentParameter"; 
+    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(MsoHeatEnvironmentParameterESTestscaffolding.class.getClassLoader() ,
+      "org.openecomp.mso.openstack.utils.MsoHeatEnvironmentParameter"
+    );
+  } 
+
+  private static void resetClasses() {
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentResourceESTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentResourceESTest.java
new file mode 100644
index 0000000..d3e7d29
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentResourceESTest.java
@@ -0,0 +1,129 @@
+/*
+ * This file was automatically generated by EvoSuite
+ * Mon Nov 14 08:45:54 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.utils;
+
+import org.junit.Test;
+import static org.junit.Assert.*;
+
+import org.evosuite.runtime.EvoRunner;
+import org.evosuite.runtime.EvoRunnerParameters;
+import org.junit.runner.RunWith;
+
+@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
+public class MsoHeatEnvironmentResourceESTest extends MsoHeatEnvironmentResourceESTestscaffolding {
+
+  @Test(timeout = 4000)
+  public void test00()  throws Throwable  {
+      MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource("", "");
+      msoHeatEnvironmentResource0.hashCode();
+  }
+
+  @Test(timeout = 4000)
+  public void test01()  throws Throwable  {
+      MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource("8{,8]8v", "8{,8]8v");
+      String string0 = msoHeatEnvironmentResource0.getValue();
+      assertEquals("8{,8]8v", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test02()  throws Throwable  {
+      MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource("", "");
+      String string0 = msoHeatEnvironmentResource0.getValue();
+      assertEquals("", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test03()  throws Throwable  {
+      MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource("\"(_{*)._$D2+w8wk");
+      String string0 = msoHeatEnvironmentResource0.getName();
+      assertEquals("\"(_{*)._$D2+w8wk", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test04()  throws Throwable  {
+      MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource();
+      MsoHeatEnvironmentResource msoHeatEnvironmentResource1 = new MsoHeatEnvironmentResource();
+      // Undeclared exception!
+      try { 
+        msoHeatEnvironmentResource0.equals(msoHeatEnvironmentResource1);
+        fail("Expecting exception: NullPointerException");
+      
+      } catch(NullPointerException e) {
+      }
+  }
+
+  @Test(timeout = 4000)
+  public void test05()  throws Throwable  {
+      MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource("", "");
+      MsoHeatEnvironmentResource msoHeatEnvironmentResource1 = new MsoHeatEnvironmentResource("", "");
+      boolean boolean0 = msoHeatEnvironmentResource0.equals(msoHeatEnvironmentResource1);
+      assertTrue(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test06()  throws Throwable  {
+      MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource("m");
+      MsoHeatEnvironmentResource msoHeatEnvironmentResource1 = new MsoHeatEnvironmentResource("l", "l");
+      boolean boolean0 = msoHeatEnvironmentResource0.equals(msoHeatEnvironmentResource1);
+      assertFalse(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test07()  throws Throwable  {
+      MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource();
+      boolean boolean0 = msoHeatEnvironmentResource0.equals("1Z^#74OJV(OBf<=#r");
+      assertFalse(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test08()  throws Throwable  {
+      MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource();
+      boolean boolean0 = msoHeatEnvironmentResource0.equals(msoHeatEnvironmentResource0);
+      assertTrue(boolean0);
+  }
+
+  @Test(timeout = 4000)
+  public void test09()  throws Throwable  {
+      MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource();
+      String string0 = msoHeatEnvironmentResource0.getName();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test10()  throws Throwable  {
+      MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource();
+      msoHeatEnvironmentResource0.setName("");
+      String string0 = msoHeatEnvironmentResource0.getName();
+      assertEquals("", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test11()  throws Throwable  {
+      MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource("");
+      String string0 = msoHeatEnvironmentResource0.getValue();
+      assertNull(string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test12()  throws Throwable  {
+      MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource();
+      msoHeatEnvironmentResource0.hashCode();
+  }
+
+  @Test(timeout = 4000)
+  public void test13()  throws Throwable  {
+      MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource();
+      String string0 = msoHeatEnvironmentResource0.toString();
+      assertEquals("\"null\": null", string0);
+  }
+
+  @Test(timeout = 4000)
+  public void test14()  throws Throwable  {
+      MsoHeatEnvironmentResource msoHeatEnvironmentResource0 = new MsoHeatEnvironmentResource();
+      msoHeatEnvironmentResource0.setValue("");
+      assertNull(msoHeatEnvironmentResource0.getName());
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentResourceESTestscaffolding.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentResourceESTestscaffolding.java
new file mode 100644
index 0000000..3917b89
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/openstack/utils/MsoHeatEnvironmentResourceESTestscaffolding.java
@@ -0,0 +1,78 @@
+/**
+ * Scaffolding file used to store all the setups needed to run 
+ * tests automatically generated by EvoSuite
+ * Mon Nov 14 08:45:54 GMT 2016
+ */
+
+package org.openecomp.mso.openstack.utils;
+
+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;
+
+@EvoSuiteClassExclude
+public class MsoHeatEnvironmentResourceESTestscaffolding {
+
+  @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.openstack.utils.MsoHeatEnvironmentResource"; 
+    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(MsoHeatEnvironmentResourceESTestscaffolding.class.getClassLoader() ,
+      "org.openecomp.mso.openstack.utils.MsoHeatEnvironmentResource"
+    );
+  } 
+
+  private static void resetClasses() {
+  }
+}
diff --git a/adapters/mso-adapter-utils/src/test/resources/cloud_config.json b/adapters/mso-adapter-utils/src/test/resources/cloud_config.json
new file mode 100644
index 0000000..0230a7d
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/resources/cloud_config.json
@@ -0,0 +1,80 @@
+{ "cloud_config": {
+	"identity_services":
+	{
+		"MT_KEYSTONE":
+		{
+			"identity_url": "http://localhost:5000/v2.0",
+			"mso_id": "john",
+			"mso_pass": "FD205490A48D48475607C36B9AD902BF",
+			"admin_tenant": "admin",
+			"member_role": "_member_",
+			"tenant_metadata": false,
+			"identity_server_type": "KEYSTONE",
+			"identity_authentication_type": "RACKSPACE_APIKEY"
+		},
+		"DAN_KEYSTONE":
+		{
+			"identity_url": "http://localhost:5000/v2.0",
+			"mso_id": "mockId",
+			"mso_pass": "BC59F80E38208A42ABB81ECCDD4FB3E4",
+			"admin_tenant": "service",
+			"member_role": "_member_",
+			"tenant_metadata": false,
+			"identity_server_type": "KEYSTONE",
+			"identity_authentication_type": "USERNAME_PASSWORD"
+		},
+		"MTINJVCC101_DCP":
+		{
+			"identity_url": "http://localhost:5000/v2.0",
+			"mso_id": "mockIdToo",
+			"mso_pass": "95604B9EAAC4D77D74786FAE54177206",
+			"admin_tenant": "service",
+			"member_role": "admin",
+			"tenant_metadata": true,
+			"identity_server_type": "KEYSTONE",
+			"identity_authentication_type": "USERNAME_PASSWORD"
+		},
+		"MTSNJA3DCP1":
+		{
+			"identity_url": "https://localhost:5000/v2.0",
+			"mso_id": "mockIdToo",
+			"mso_pass": "1491DE07AC9D716A7966BB8C2848F031",
+			"admin_tenant": "service",
+			"member_role": "admin",
+			"tenant_metadata": true,
+			"identity_server_type": "KEYSTONE",
+			"identity_authentication_type": "USERNAME_PASSWORD"
+		}
+		
+	},
+	"cloud_sites":
+	{
+		"MT":
+		{
+			"region_id": "regionOne",
+			"clli": "MT",
+			"aic_version": "2.5",
+			"identity_service_id": "MT_KEYSTONE"
+		},
+		"DAN":
+		{
+			"region_id": "RegionOne",
+			"clli": "DAN",
+			"aic_version": "2.5",
+			"identity_service_id": "DAN_KEYSTONE"
+		},
+		"MTINJVCC101":
+		{
+			"region_id": "regionTwo",
+			"clli": "MTINJVCC101",
+			"aic_version": "2.5",
+			"identity_service_id": "MTINJVCC101_DCP"
+		}
+		
+	}
+}
+}
+	
+
+
+		
diff --git a/adapters/mso-adapter-utils/src/test/resources/logback-test.xml b/adapters/mso-adapter-utils/src/test/resources/logback-test.xml
new file mode 100644
index 0000000..d2c1719
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/resources/logback-test.xml
@@ -0,0 +1,48 @@
+<!--
+  ============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=========================================================
+  -->
+
+<configuration >
+  
+  
+  <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+    <encoder>
+      <pattern>%d{MM/dd-HH:mm:ss.SSS}|%X{RequestId}|%X{ServiceInstanceId}|%thread|%X{ServiceName}|%X{InstanceUUID}|%.-5level|%X{AlertSeverity}||%X{ServerIPAddress}|%X{ServerFQDN}|%X{RemoteHost}||%X{Timer}|%msg%n</pattern>
+    </encoder>
+  </appender>
+
+
+  <logger name="com.att.eelf.audit" level="info" additivity="false">
+    <appender-ref ref="STDOUT" />
+  </logger>
+  
+  <logger name="com.att.eelf.metrics" level="info" additivity="false">
+        <appender-ref ref="STDOUT" />
+  </logger>
+
+  <logger name="com.att.eelf.error" level="trace" additivity="false">
+    <appender-ref ref="STDOUT" />
+  </logger> 
+
+  <root level="info">
+    <appender-ref ref="STDOUT" />
+  </root>
+ 
+
+</configuration>
diff --git a/adapters/mso-adapter-utils/src/test/resources/mso.properties b/adapters/mso-adapter-utils/src/test/resources/mso.properties
new file mode 100644
index 0000000..d58521f
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/resources/mso.properties
@@ -0,0 +1,27 @@
+###
+# ============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=========================================================
+###
+
+ecomp.mso.cloud.1.cloudId=MT
+ecomp.mso.cloud.1.keystoneUrl=http://localhost:5000/v2.0
+ecomp.mso.cloud.1.msoId=John
+ecomp.mso.cloud.1.publicNetId=FD205490A48D48475607C36B9AD902BF
+ecomp.mso.cloud.1.test=1234
+ecomp.mso.cloud.1.boolean=true
+ecomp.mso.cloud.1.enum=enum1
diff --git a/adapters/mso-adapter-utils/src/test/resources/mso2.properties b/adapters/mso-adapter-utils/src/test/resources/mso2.properties
new file mode 100644
index 0000000..a47ce77
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/resources/mso2.properties
@@ -0,0 +1,21 @@
+###
+# ============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=========================================================
+###
+
+ecomp.mso.cloud.1.cloudId=MT2
