summaryrefslogtreecommitdiffstats
path: root/adapters/mso-tenant-adapter
diff options
context:
space:
mode:
Diffstat (limited to 'adapters/mso-tenant-adapter')
-rw-r--r--adapters/mso-tenant-adapter/src/main/java/org/openecomp/mso/adapters/tenant/MsoTenantAdapterImpl.java5
-rw-r--r--adapters/mso-tenant-adapter/src/test/java/org/openecomp/mso/adapters/tenant/MsoTenantAdapterImplTest.java22
2 files changed, 25 insertions, 2 deletions
diff --git a/adapters/mso-tenant-adapter/src/main/java/org/openecomp/mso/adapters/tenant/MsoTenantAdapterImpl.java b/adapters/mso-tenant-adapter/src/main/java/org/openecomp/mso/adapters/tenant/MsoTenantAdapterImpl.java
index 58169f6f92..85d50aee47 100644
--- a/adapters/mso-tenant-adapter/src/main/java/org/openecomp/mso/adapters/tenant/MsoTenantAdapterImpl.java
+++ b/adapters/mso-tenant-adapter/src/main/java/org/openecomp/mso/adapters/tenant/MsoTenantAdapterImpl.java
@@ -58,6 +58,11 @@ public class MsoTenantAdapterImpl implements MsoTenantAdapter {
WebServiceContext wsContext;
private static MsoLogger logger = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA);
+
+ protected MsoTenantUtilsFactory getTenantUtilsFactory() {
+ return tFactory;
+ }
+
/**
* Health Check web method. Does nothing but return to show the adapter is deployed.
*/
diff --git a/adapters/mso-tenant-adapter/src/test/java/org/openecomp/mso/adapters/tenant/MsoTenantAdapterImplTest.java b/adapters/mso-tenant-adapter/src/test/java/org/openecomp/mso/adapters/tenant/MsoTenantAdapterImplTest.java
index e60a143b11..821c114351 100644
--- a/adapters/mso-tenant-adapter/src/test/java/org/openecomp/mso/adapters/tenant/MsoTenantAdapterImplTest.java
+++ b/adapters/mso-tenant-adapter/src/test/java/org/openecomp/mso/adapters/tenant/MsoTenantAdapterImplTest.java
@@ -19,8 +19,13 @@
*/
package org.openecomp.mso.adapters.tenant;
+import org.junit.BeforeClass;
import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.Mockito;
import org.openecomp.mso.adapters.tenantrest.TenantRollback;
+import org.openecomp.mso.cloud.CloudConfig;
+import org.openecomp.mso.cloud.CloudConfigFactory;
import org.openecomp.mso.entity.MsoRequest;
import javax.validation.constraints.Null;
@@ -28,11 +33,24 @@ import javax.xml.ws.Holder;
import java.util.HashMap;
public class MsoTenantAdapterImplTest {
+
+ @Mock
+ private static MsoTenantAdapterImpl msoTenantAdapter;
+ @Mock
+ private static CloudConfigFactory cloudConfigFactory;
+
// TODO: following test case is done for coverage
// later it should be modified for proper test.
-
- MsoTenantAdapterImpl msoTenantAdapter = new MsoTenantAdapterImpl();
+
+ @BeforeClass
+ public static final void prepare () {
+ msoTenantAdapter = Mockito.spy (new MsoTenantAdapterImpl());
+ cloudConfigFactory = Mockito.mock(CloudConfigFactory.class);
+ CloudConfig cloudConfig = Mockito.mock(CloudConfig.class);
+ Mockito.when(cloudConfigFactory.getCloudConfig()).thenReturn(cloudConfig);
+ msoTenantAdapter.getTenantUtilsFactory().setCloudConfigFactory(cloudConfigFactory);
+ }
@Test
public void healthCheck() throws Exception {