diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudConfig.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudConfig.java
index 0af0e94..ef37f9f 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudConfig.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudConfig.java
@@ -7,9 +7,9 @@
  * 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.
@@ -26,6 +26,7 @@
 import java.util.Map;
 import java.util.Map.Entry;
 
+import java.util.Optional;
 import org.codehaus.jackson.annotate.JsonProperty;
 import org.codehaus.jackson.map.DeserializationConfig;
 import org.codehaus.jackson.map.ObjectMapper;
@@ -36,8 +37,8 @@
 /**
  * JavaBean JSON class for a CloudConfig. This bean maps a JSON-format cloud
  * configuration file to Java. The CloudConfig contains information about
- * Openstack cloud configurations. It includes: 
- * - CloudIdentity objects,representing DCP nodes (Openstack Identity Service) 
+ * Openstack cloud configurations. It includes:
+ * - CloudIdentity objects,representing DCP nodes (Openstack Identity Service)
  * - CloudSite objects, representing LCP nodes (Openstack Compute & other services)
  *
  * Note that this is only used to access Cloud Configurations loaded from a JSON
@@ -51,19 +52,17 @@
 @JsonRootName("cloud_config")
 public class CloudConfig {
 
-    private boolean                    validCloudConfig = false;
+    private static final String CLOUD_SITE_VERSION = "2.5";
+    private static final String DEFAULT_CLOUD_SITE_ID = "default";
+    private boolean validCloudConfig = false;
+    private static ObjectMapper mapper = new ObjectMapper();
+    private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA);
+    protected String configFilePath;
+    protected int refreshTimerInMinutes;
     @JsonProperty("identity_services")
     private Map<String, CloudIdentity> identityServices = new HashMap<>();
     @JsonProperty("cloud_sites")
-    private Map<String, CloudSite>     cloudSites       = new HashMap<>();
-
-    private static ObjectMapper        mapper           = new ObjectMapper();
-
-    private static final MsoLogger     LOGGER           = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA);
-
-    protected String                   configFilePath;
-
-    protected int                      refreshTimerInMinutes;
+    private Map<String, CloudSite> cloudSites = new HashMap<>();
 
     public CloudConfig() {
         mapper.enable(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE);
@@ -71,18 +70,14 @@
     }
 
     /**
-     * Get a Map of all IdentityServices that have been loaded.
-     * 
-     * @return the Map
+     * Get a map of all identity services that have been loaded.
      */
     public synchronized Map<String, CloudIdentity> getIdentityServices() {
         return identityServices;
     }
 
     /**
-     * Get a Map of all CloudSites that have been loaded.
-     * 
-     * @return the Map
+     * Get a map of all cloud sites that have been loaded.
      */
     public synchronized Map<String, CloudSite> getCloudSites() {
         return cloudSites;
@@ -93,7 +88,7 @@
      * against the regions, and if no match is found there, then against
      * individual entries to try and find one with a CLLI that matches the ID
      * and an AIC version of 2.5.
-     * 
+     *
      * @param id
      *            the ID to match
      * @return a CloudSite, or null of no match found
@@ -104,53 +99,35 @@
                 return cloudSites.get(id);
             }
             // check for id == CLLI now as well
-            return getCloudSiteWithClli(id, "2.5");
+            return getCloudSiteWithClli(id);
         }
         return null;
     }
 
-    /**
-     * Get a specific CloudSites, based on a CLLI and (optional) version, which
-     * will be matched against the aic_version field of the CloudSite.
-     * 
-     * @param clli
-     *            the CLLI to match
-     * @param version
-     *            the version to match; may be null in which case any version
-     *            matches
-     * @return a CloudSite, or null of no match found
-     */
-    public synchronized CloudSite getCloudSiteWithClli(String clli, String version) {
-        if (clli != null) {
-            // New with 1610 - find cloud site called "DEFAULT" - return that
-            // object,with the name modified to match what they asked for. We're
-            // looping thru the cloud sites anyway - so save off the default one in case we
-            // need it.
-            CloudSite defaultCloudSite = null;
-            for (CloudSite cs : cloudSites.values()) {
-                if (cs.getClli() != null && clli.equals(cs.getClli())) {
-                    if (version == null || version.equals(cs.getAic_version())) {
-                        return cs;
-                    }
-                } else if ("default".equalsIgnoreCase(cs.getId())) {
-                    // save it off in case we need it
-                    defaultCloudSite = cs.clone();
-                }
-            }
-            // If we get here - we didn't find a match - so return the default
-            // cloud site
-            if (defaultCloudSite != null) {
-                defaultCloudSite.setRegionId(clli);
-                defaultCloudSite.setId(clli);
-            }
+    private CloudSite getCloudSiteWithClli(String clli) {
+        Optional <CloudSite> cloudSiteOptional = cloudSites.values().stream().filter(cs ->
+                cs.getClli() != null && clli.equals(cs.getClli()) && (CLOUD_SITE_VERSION.equals(cs.getAic_version())))
+                .findAny();
+        return cloudSiteOptional.orElse(getDefaultCloudSite(clli));
+    }
+
+    // TODO in future the result will be optional
+    private CloudSite getDefaultCloudSite(String clli) {
+        Optional<CloudSite> cloudSiteOpt = cloudSites.values().stream()
+                .filter(cs -> cs.getId().equalsIgnoreCase(DEFAULT_CLOUD_SITE_ID)).findAny();
+        if (cloudSiteOpt.isPresent()) {
+            CloudSite defaultCloudSite = cloudSiteOpt.get();
+            defaultCloudSite.setRegionId(clli);
+            defaultCloudSite.setId(clli);
             return defaultCloudSite;
+        } else {
+            return null;
         }
-        return null;
     }
 
     /**
      * Get a specific CloudIdentity, based on an ID.
-     * 
+     *
      * @param id
      *            the ID to match
      * @return a CloudIdentity, or null of no match found
@@ -173,7 +150,7 @@
         configFilePath = configFile;
         this.refreshTimerInMinutes = refreshTimer;
         this.validCloudConfig=false;
-        
+
         try {
             reader = new FileReader(configFile);
             // Parse the JSON input into a CloudConfig
@@ -200,7 +177,7 @@
                 }
             }
             this.validCloudConfig=true;
-            
+
         } finally {
             try {
                 if (reader != null) {
@@ -227,12 +204,9 @@
     public synchronized CloudConfig clone() {
         CloudConfig ccCopy = new CloudConfig();
         for (Entry<String, CloudIdentity> e : identityServices.entrySet()) {
-
             ccCopy.identityServices.put(e.getKey(), e.getValue().clone());
         }
-
         for (Entry<String, CloudSite> e : cloudSites.entrySet()) {
-
             ccCopy.cloudSites.put(e.getKey(), e.getValue().clone());
         }
         ccCopy.configFilePath = this.configFilePath;
@@ -290,5 +264,5 @@
         return true;
     }
 
-  
+
 }
diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudConfigIdentityMapper.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudConfigIdentityMapper.java
deleted file mode 100644
index 9677d0e..0000000
--- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/cloud/CloudConfigIdentityMapper.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-package org.openecomp.mso.cloud;
-
-/**
- * This interface provides the method signature for mapping registration.
- * All mappings should be registered by the implementing class.
- */
-@FunctionalInterface
-public interface CloudConfigIdentityMapper {
-
-	public void registerAllMappings();
-}
diff --git a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatUtils.java b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatUtils.java
index fad0c23..08ea84d 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatUtils.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/openecomp/mso/openstack/utils/MsoHeatUtils.java
@@ -22,12 +22,10 @@
 package org.openecomp.mso.openstack.utils;
 
 import java.io.Serializable;
-import java.rmi.server.ObjID;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Calendar;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
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
deleted file mode 100644
index dd1b396..0000000
--- a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/adapter_utils/tests/CloudConfigTest.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.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.Assert;
-import org.junit.Before;
-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;
-import org.openecomp.mso.openstack.exceptions.MsoCloudIdentityNotFound;
-
-/**
- * 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
-	 * @throws MsoCloudIdentityNotFound 
-    */
-   @Before
-   public final void prepare () throws MsoCloudIdentityNotFound {
-	   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");
-	   CloudSite site4 = siteMap.get("MTSNJA4LCP1");
-
-	   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");
-	   assertEquals (site4.getRegionId(), "mtsnjlcp1");
-	   assertEquals (site4.getIdentityServiceId(), "MTSNJA3DCP1");
-   }
-
-
-   /**
-    * 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("john", identity1.getMsoId());
-	   assertEquals("changeme", identity1.getMsoPass());
-	   assertEquals("admin", identity1.getAdminTenant());
-	   assertEquals("_member_", identity1.getMemberRole());
-	   assertEquals(false, identity1.hasTenantMetadata());
-
-	   assertEquals("mockId", identity2.getMsoId());
-	   assertEquals("stack123", identity2.getMsoPass());
-	   assertEquals("service", identity2.getAdminTenant());
-	   assertEquals("_member_", identity2.getMemberRole());
-	   assertEquals(false, identity2.hasTenantMetadata());
-
-	   assertEquals("mockIdToo", identity3.getMsoId());
-	   assertEquals("AICG@mm@@2015", identity3.getMsoPass());
-	   assertEquals("service", identity3.getAdminTenant());
-	   assertEquals("admin", identity3.getMemberRole());
-	   assertEquals(true, identity3.hasTenantMetadata());
-
-	   assertEquals("mockIdToo", identity4.getMsoId());
-	   assertEquals("2315QRS2015srq", identity4.getMsoPass());
-	   assertEquals("service", identity4.getAdminTenant());
-	   assertEquals("admin", identity4.getMemberRole());
-	   assertEquals(true, identity4.hasTenantMetadata());
-
-   }
-
-   /**
-    * 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.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);
-   }
-   
-   @Test (expected = MsoCloudIdentityNotFound.class)
-   public final void testLoadWithWrongFile () throws MsoCloudIdentityNotFound {
-       ClassLoader classLoader = CloudConfigTest.class.getClassLoader();
-       String config = classLoader.getResource("cloud_config_bad.json").toString().substring(5);
-
-       cloudConfigFactory.initializeCloudConfig(config,1);
-   }
-   
-   @Test
-   public final void testReloadWithWrongFile () {
-       ClassLoader classLoader = CloudConfigTest.class.getClassLoader();
-       String config = classLoader.getResource("cloud_config_bad.json").toString().substring(5);
-
-       try {
-           cloudConfigFactory.initializeCloudConfig(config,1);
-           Assert.fail("MsoCloudIdentityNotFound was expected");
-       } catch (MsoCloudIdentityNotFound e) {
-           
-       }
-       Assert.assertTrue("Should be an empty CloudConfig", cloudConfigFactory.getCloudConfig().getCloudSites().isEmpty());
-       Assert.assertTrue("Should be an empty CloudConfig", cloudConfigFactory.getCloudConfig().getIdentityServices().isEmpty());
-       
-       // Now reload the right config
-       config = classLoader.getResource("cloud_config.json").toString().substring(5);
-       cloudConfigFactory.changeMsoPropertiesFilePath(config);
-       cloudConfigFactory.reloadCloudConfig();
-       Assert.assertTrue("Flag valid Config should be true now that the cloud_config is correct", cloudConfigFactory.getCloudConfig().isValidCloudConfig());
-
-   }
-
-}
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
index cd96756..6fd95d5 100644
--- 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
@@ -25,6 +25,7 @@
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.openecomp.mso.cloud.CloudConfigFactory;
+import org.openecomp.mso.cloud.CloudConfigTest;
 import org.openecomp.mso.openstack.exceptions.MsoCloudIdentityNotFound;
 import org.openecomp.mso.openstack.exceptions.MsoCloudSiteNotFound;
 import org.openecomp.mso.openstack.exceptions.MsoException;
diff --git a/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/cloud/CloudConfigTest.java b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/cloud/CloudConfigTest.java
new file mode 100644
index 0000000..a73e435
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/java/org/openecomp/mso/cloud/CloudConfigTest.java
@@ -0,0 +1,179 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.mso.cloud;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import java.util.Map;
+import org.openecomp.mso.openstack.exceptions.MsoCloudIdentityNotFound;
+
+public class CloudConfigTest {
+
+    private static String cloudConfigJsonFilePath;
+    private static String cloudDefaultConfigJsonFilePath;
+    private static String cloudConfigInvalidJsonFilePath;
+
+    @BeforeClass
+    public static void preparePaths() {
+        ClassLoader classLoader = CloudConfigTest.class.getClassLoader();
+        cloudConfigJsonFilePath = classLoader.getResource("cloud_config.json").getPath();
+        cloudDefaultConfigJsonFilePath = classLoader.getResource("cloud_default_config.json").getPath();
+        cloudConfigInvalidJsonFilePath = classLoader.getResource("cloud_config_bad.json").getPath();
+    }
+
+    private CloudConfig createTestObject(String jsonFilePath) throws MsoCloudIdentityNotFound {
+        CloudConfigFactory cloudConfigFactory = new CloudConfigFactory();
+        cloudConfigFactory.initializeCloudConfig(jsonFilePath, 1);
+        return cloudConfigFactory.getCloudConfig();
+    }
+
+    @Test
+    public void testGetCloudSites() throws MsoCloudIdentityNotFound {
+        CloudConfig con = createTestObject(cloudConfigJsonFilePath);
+        Map<String, CloudSite> siteMap = con.getCloudSites();
+        assertNotNull(siteMap);
+
+        CloudSite site1 = siteMap.get("MT");
+        CloudSite site2 = siteMap.get("DAN");
+        CloudSite site3 = siteMap.get("MTINJVCC101");
+        CloudSite site4 = siteMap.get("MTSNJA4LCP1");
+
+        assertEquals("regionOne", site1.getRegionId());
+        assertEquals("MT_KEYSTONE", site1.getIdentityServiceId());
+        assertEquals("RegionOne", site2.getRegionId());
+        assertEquals("DAN_KEYSTONE", site2.getIdentityServiceId());
+        assertEquals("regionTwo", site3.getRegionId());
+        assertEquals("MTINJVCC101_DCP", site3.getIdentityServiceId());
+        assertEquals("mtsnjlcp1", site4.getRegionId());
+        assertEquals("MTSNJA3DCP1", site4.getIdentityServiceId());
+    }
+
+    @Test
+    public void testGetIdentityServices() throws MsoCloudIdentityNotFound {
+        CloudConfig con = createTestObject(cloudConfigJsonFilePath);
+        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("john", identity1.getMsoId());
+        assertEquals("changeme", identity1.getMsoPass());
+        assertEquals("admin", identity1.getAdminTenant());
+        assertEquals("_member_", identity1.getMemberRole());
+        assertFalse(identity1.hasTenantMetadata());
+
+        assertEquals("mockId", identity2.getMsoId());
+        assertEquals("stack123", identity2.getMsoPass());
+        assertEquals("service", identity2.getAdminTenant());
+        assertEquals("_member_", identity2.getMemberRole());
+        assertFalse(identity2.hasTenantMetadata());
+
+        assertEquals("mockIdToo", identity3.getMsoId());
+        assertEquals("AICG@mm@@2015", identity3.getMsoPass());
+        assertEquals("service", identity3.getAdminTenant());
+        assertEquals("admin", identity3.getMemberRole());
+        assertTrue(identity3.hasTenantMetadata());
+
+        assertEquals("mockIdToo", identity4.getMsoId());
+        assertEquals("2315QRS2015srq", identity4.getMsoPass());
+        assertEquals("service", identity4.getAdminTenant());
+        assertEquals("admin", identity4.getMemberRole());
+        assertTrue(identity4.hasTenantMetadata());
+    }
+
+    @Test
+    public void cloudSiteIsGotById_when_IdFound() throws MsoCloudIdentityNotFound {
+        CloudConfig con = createTestObject(cloudConfigJsonFilePath);
+        CloudSite cloudSite = con.getCloudSite("MT");
+        assertNotNull(cloudSite);
+        assertEquals("regionOne", cloudSite.getRegionId());
+        assertEquals("MT_KEYSTONE", cloudSite.getIdentityServiceId());
+    }
+
+    @Test
+    public void cloudSiteIsGotByClli_when_IdNotFound() throws MsoCloudIdentityNotFound {
+        CloudConfig con = createTestObject(cloudConfigJsonFilePath);
+        CloudSite cloudSite = con.getCloudSite("CS_clli");
+        assertNotNull(cloudSite);
+        assertEquals("clliRegion", cloudSite.getRegionId());
+        assertEquals("CS_clli", cloudSite.getClli());
+        assertEquals("CS_service", cloudSite.getIdentityServiceId());
+    }
+
+    @Test
+    public void cloudSiteIsGotByDefault_when_IdAndClliNotFound() throws MsoCloudIdentityNotFound {
+        CloudConfig con = createTestObject(cloudDefaultConfigJsonFilePath);
+        CloudSite cloudSite = con.getCloudSite("not_existing_id");
+        assertNotNull(cloudSite);
+        assertEquals("not_existing_id", cloudSite.getId());
+        assertEquals("not_existing_id", cloudSite.getRegionId());
+    }
+
+    @Test
+    public void testGetIdentityService() throws MsoCloudIdentityNotFound {
+        CloudConfig con = createTestObject(cloudConfigJsonFilePath);
+        CloudIdentity identity1 = con.getIdentityService("MT_KEYSTONE");
+        assertNotNull(identity1);
+        assertEquals("john", identity1.getMsoId());
+        assertEquals("changeme", identity1.getMsoPass());
+        assertEquals("admin", identity1.getAdminTenant());
+        assertEquals("_member_", identity1.getMemberRole());
+        assertFalse(identity1.hasTenantMetadata());
+
+        CloudIdentity identity2 = con.getIdentityService("Test");
+        assertNull(identity2);
+    }
+
+    @Test(expected = MsoCloudIdentityNotFound.class)
+    public void testLoadWithWrongFile() throws MsoCloudIdentityNotFound {
+        createTestObject(cloudConfigInvalidJsonFilePath);
+    }
+
+    @Test
+    public void testReloadWithWrongFile() {
+        CloudConfigFactory cloudConfigFactory = new CloudConfigFactory();
+        try {
+            cloudConfigFactory.initializeCloudConfig(cloudConfigInvalidJsonFilePath, 1);
+            Assert.fail("MsoCloudIdentityNotFound was expected");
+        } catch (MsoCloudIdentityNotFound e) {
+
+        }
+        assertTrue("Should be an empty CloudConfig", cloudConfigFactory.getCloudConfig().getCloudSites().isEmpty());
+        assertTrue("Should be an empty CloudConfig",
+                cloudConfigFactory.getCloudConfig().getIdentityServices().isEmpty());
+        // Now reload the right config
+        cloudConfigFactory.changeMsoPropertiesFilePath(cloudConfigJsonFilePath);
+        cloudConfigFactory.reloadCloudConfig();
+        assertTrue("Flag valid Config should be true now that the cloud_config is correct",
+                cloudConfigFactory.getCloudConfig().isValidCloudConfig());
+    }
+
+}
diff --git a/adapters/mso-adapter-utils/src/test/resources/cloud_config.json b/adapters/mso-adapter-utils/src/test/resources/cloud_config.json
index ee3532f..ff24633 100644
--- a/adapters/mso-adapter-utils/src/test/resources/cloud_config.json
+++ b/adapters/mso-adapter-utils/src/test/resources/cloud_config.json
@@ -44,7 +44,8 @@
 			"tenant_metadata": true,
 			"identity_server_type": "KEYSTONE",
 			"identity_authentication_type": "USERNAME_PASSWORD"
-		}
+		},
+		"CS_service": {}
 
 	},
 	"cloud_sites":
@@ -76,8 +77,14 @@
 			"clli": "MTSNJA4LCP1",
 			"aic_version": "2.5",
 			"identity_service_id": "MTSNJA3DCP1"
+		},
+		"CS":
+		{
+			"region_id": "clliRegion",
+			"clli": "CS_clli",
+			"aic_version": "2.5",
+			"identity_service_id": "CS_service"
 		}
-
 	}
 }
 }
diff --git a/adapters/mso-adapter-utils/src/test/resources/cloud_default_config.json b/adapters/mso-adapter-utils/src/test/resources/cloud_default_config.json
new file mode 100644
index 0000000..35d18e9
--- /dev/null
+++ b/adapters/mso-adapter-utils/src/test/resources/cloud_default_config.json
@@ -0,0 +1,13 @@
+{
+  "cloud_config": {
+    "identity_services": {
+      "default_service": {}
+    },
+    "cloud_sites": {
+      "default": {
+        "region_id": "defaultRegion",
+        "identity_service_id": "default_service"
+      }
+    }
+  }
+}
\ No newline at end of file
