diff options
Diffstat (limited to 'adapters/mso-tenant-adapter/src/test/java')
-rw-r--r-- | adapters/mso-tenant-adapter/src/test/java/org/openecomp/mso/adapters/tenant/MsoTenantAdapterImplTest.java | 22 |
1 files changed, 20 insertions, 2 deletions
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 { |