added assert statements in jUnits
[appc.git] / appc-adapters / appc-iaas-adapter / appc-iaas-adapter-bundle / src / test / java / org / onap / appc / adapter / iaas / impl / TestTenantCache.java
index 449db89..32f8d45 100644 (file)
@@ -1,9 +1,11 @@
 /*
- * ============LICENSE_START======================================================= Copyright (C)
- * 2016-2018 Ericsson. 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
+ * ============LICENSE_START======================================================= 
+ * Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ * ================================================================================
+ * Modifications Copyright (C) 2019 IBM.
+ * ================================================================================
+ * 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
  *
@@ -20,6 +22,7 @@ package org.onap.appc.adapter.iaas.impl;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 import static org.mockito.Matchers.anyObject;
 import static org.mockito.Matchers.anyString;
 import static org.mockito.Mockito.doThrow;
@@ -115,6 +118,7 @@ public class TestTenantCache {
     public void testDestroy() {
         TenantCache spy = Mockito.spy(tenantCache);
         spy.destroy(context, pool);
+        assertNotNull(spy);
     }
 
     @Test
@@ -122,6 +126,7 @@ public class TestTenantCache {
         doThrow(new IOException("I/O Exception occured while closing context")).when(context).close();
         TenantCache spy = Mockito.spy(tenantCache);
         spy.destroy(context, pool);
+        assertNotNull(spy);
     }
 
     @Test
@@ -131,6 +136,7 @@ public class TestTenantCache {
         when(catalog.getProjectId()).thenReturn(TENANT_ID);
         when(catalog.getProjectName()).thenReturn(TENANT_NAME);
         spyTenant.initialize();
+        assertNotNull(spyTenant);
     }
 
     @Test
@@ -142,6 +148,7 @@ public class TestTenantCache {
         when(spyTenant.getTenantName()).thenReturn(TENANT_NAME);
         when(catalog.getRegions()).thenReturn(regions);
         spyTenant.initialize();
+        assertNotNull(props);
     }
 
     @Test
@@ -152,6 +159,7 @@ public class TestTenantCache {
         doThrow(new ContextConnectionException("Contex Connection Exception")).when(catalog).init();
         TenantCache spyTenant = Mockito.spy(tenantCache);
         spyTenant.initialize();
+        assertNotNull(props);
     }
 
     @Test
@@ -220,4 +228,15 @@ public class TestTenantCache {
     public void testPoolsProperty() {
         assertNotNull(tenantCache.getPools());
     }
+    
+    @Test
+    public void testProvider() {
+        tenantCache.setProvider(provider);
+        assertEquals(provider, tenantCache.getProvider());
+    }
+    
+    @Test
+    public void testServiceCatalog() {
+        assertTrue(tenantCache.getServiceCatalog() instanceof ServiceCatalog);
+    }
 }